Attached Files |
language_refactoring_email_events_modules.patch [^] (48,498 bytes) 2010-01-26 14:23
[Show Content]
Index: in-auction/install/english.lang
===================================================================
--- in-auction/install/english.lang (revision 13128)
+++ in-auction/install/english.lang (working copy)
@@ -88,9 +88,6 @@
<PHRASE Label="la_eBayMarketplace" Module="In-Auction" Type="1">ZUJheSBNYXJrZXRwbGFjZQ==</PHRASE>
<PHRASE Label="la_eBayStoreFixed" Module="In-Auction" Type="1">ZUJheSBTdG9yZSAvIEZpeGVk</PHRASE>
<PHRASE Label="la_Ended" Module="In-Auction" Type="1">RW5kZWQ=</PHRASE>
- <PHRASE Label="la_event_eBay_feedback_not_received" Module="In-Auction" Type="1">ZUJheSBmZWVkYmFjayBub3QgcmVjZWl2ZWQ=</PHRASE>
- <PHRASE Label="la_event_eBay_item_not_paid" Module="In-Auction" Type="1">ZUJheSBpdGVtIG5vdCBwYWlk</PHRASE>
- <PHRASE Label="la_event_eBay_order_create" Module="In-Auction" Type="1">ZUJheSBvcmRlciBjcmVhdGVk</PHRASE>
<PHRASE Label="la_Fees" Module="In-Auction" Type="1">RmVlcw==</PHRASE>
<PHRASE Label="la_fld_Answer" Module="In-Auction" Type="1">QW5zd2Vy</PHRASE>
<PHRASE Label="la_fld_AnswerStatus" Module="In-Auction" Type="1">QW5zd2VyIFN0YXR1cw==</PHRASE>
Index: in-auction/install/install_data.sql
===================================================================
--- in-auction/install/install_data.sql (revision 13128)
+++ in-auction/install/install_data.sql (working copy)
@@ -1815,10 +1815,10 @@
INSERT INTO eBayStoreCategories VALUES (1, 0, 'Other');
INSERT INTO eBayListingDetailTemplates VALUES (1, 'Default Details Template', 'Product Name: <inp2:p_Field name="Title"/>\r\nProduct Description: <inp2:p_Field name="Description"/>\r\nProduct Retail Price: <inp2:p_Field name="MSRP"/>\r\nProduct Features: <inp2:p_Field name="cust_Features"/>\r\n');
-INSERT INTO Events VALUES(DEFAULT, 'EBAYORDER.CREATE', NULL, 1, 0, NULL, 'In-Auction', 'la_event_eBay_order_create', 0);
-INSERT INTO Events VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'la_event_eBay_item_not_paid', 0);
-INSERT INTO Events VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'la_event_eBay_item_not_paid', 1);
-INSERT INTO Events VALUES(DEFAULT, 'EBAYFEEDBACKNOTRECEIVED.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'la_event_eBay_feedback_not_received', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYORDER.CREATE', NULL, 1, 0, NULL, 'In-Auction', 'eBay order created', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYFEEDBACKNOTRECEIVED.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay feedback not received', 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:setting_folder.view', 11, 1, 1, 0);
Index: in-bulletin/install/english.lang
===================================================================
--- in-bulletin/install/english.lang (revision 13128)
+++ in-bulletin/install/english.lang (working copy)
@@ -14,13 +14,6 @@
<PHRASE Label="la_col_TopicText" Module="In-Bulletin" Type="1">VG9waWM=</PHRASE>
<PHRASE Label="la_col_Views" Module="In-Bulletin" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_col_VoteCount" Module="In-Bulletin" Type="1">Vm90ZXM=</PHRASE>
- <PHRASE Label="la_event_post.add" Module="In-Bulletin" Type="1">UG9zdCBBZGRlZA==</PHRASE>
- <PHRASE Label="la_event_post.modify" Module="In-Bulletin" Type="1">UG9zdCBNb2RpZmllZA==</PHRASE>
- <PHRASE Label="la_event_topic.add" Module="In-Bulletin" Type="1">VG9waWMgQWRkZWQ=</PHRASE>
- <PHRASE Label="la_event_topic.add.pending" Module="In-Bulletin" Type="1">QWRkIFBlbmRpbmcgVG9waWM=</PHRASE>
- <PHRASE Label="la_event_topic.approve" Module="In-Bulletin" Type="1">QXBwcm92ZSBUb3BpYw==</PHRASE>
- <PHRASE Label="la_event_topic.modify" Module="In-Bulletin" Type="1">TW9kaWZ5IFRvcGlj</PHRASE>
- <PHRASE Label="la_event_topic.modify.pending" Module="In-Bulletin" Type="1">VG9waWMgTW9kaWZpY2F0aW9ucyBQZW5kaW5n</PHRASE>
<PHRASE Label="la_fld_AllowComments" Module="In-Bulletin" Type="1">QWxsb3cgQ29tbWVudHM=</PHRASE>
<PHRASE Label="la_fld_AllowMultipleVotings" Module="In-Bulletin" Type="1">QWxsb3cgTXVsdGlwbGUgVm90aW5ncw==</PHRASE>
<PHRASE Label="la_fld_BadWord" Module="In-Bulletin" Type="1">Q2Vuc29yZWQgV29yZA==</PHRASE>
Index: in-bulletin/install/install_data.sql
===================================================================
--- in-bulletin/install/install_data.sql (revision 13128)
+++ in-bulletin/install/install_data.sql (working copy)
@@ -112,19 +112,19 @@
UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif');
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.modify', 1);
-INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_post.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_pm.add', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'Approve Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Modified', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'Post Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'New Private Message', 0);
INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
Index: in-commerce/install/english.lang
===================================================================
--- in-commerce/install/english.lang (revision 13128)
+++ in-commerce/install/english.lang (working copy)
@@ -252,20 +252,6 @@
<PHRASE Label="la_ETB" Module="In-Commerce" Type="1">RXRoaW9waWFuIEJpcnI=</PHRASE>
<PHRASE Label="la_EUR" Module="In-Commerce" Type="1">RXVybw==</PHRASE>
<PHRASE Label="la_EuropeanCentralBank" Module="In-Commerce" Type="1">RXVyb3BlYW4gQ2VudHJhbCBCYW5rIC0gd3d3LmVjYi5pbnQ=</PHRASE>
- <PHRASE Label="la_event_prod_affiliate.payment" Module="In-Commerce" Type="1">QWZmaWxpYXRlIHBheW1lbnQgaXNzdWVk</PHRASE>
- <PHRASE Label="la_event_prod_affiliate.payment_type_changed" Module="In-Commerce" Type="1">QWZmaWxpYXRlIHBheW1lbnQgdHlwZSBjaGFuZ2Vk</PHRASE>
- <PHRASE Label="la_event_prod_affiliate.register" Module="In-Commerce" Type="1">QWZmaWxpYXRlIHJlZ2lzdGVyZWQ=</PHRASE>
- <PHRASE Label="la_event_prod_affiliate.registration_approved" Module="In-Commerce" Type="1">QWZmaWxpYXRlIHJlZ2lzdHJhdGlvbiBhcHByb3ZlZA==</PHRASE>
- <PHRASE Label="la_event_prod_affiliate.registration_denied" Module="In-Commerce" Type="1">QWZmaWxpYXRlIHJlZ2lzdHJhdGlvbiBkZW5pZWQ=</PHRASE>
- <PHRASE Label="la_event_prod_backorder.add" Module="In-Commerce" Type="1">QmFja29yZGVyIEFkZGVk</PHRASE>
- <PHRASE Label="la_event_prod_backorder.fullfill" Module="In-Commerce" Type="1">QmFjay1vcmRlciBpcyBGdWxmaWxsZWQ=</PHRASE>
- <PHRASE Label="la_event_prod_backorder.process" Module="In-Commerce" Type="1">QmFja29yZGVyIFByb2Nlc3NlZA==</PHRASE>
- <PHRASE Label="la_event_prod_order.approve" Module="In-Commerce" Type="1">T3JkZXIgQXBwcm92ZWQ=</PHRASE>
- <PHRASE Label="la_event_prod_order.deny" Module="In-Commerce" Type="1">T3JkZXIgRGVuaWVk</PHRASE>
- <PHRASE Label="la_event_prod_order.ship" Module="In-Commerce" Type="1">T3JkZXIgU2hpcHBlZA==</PHRASE>
- <PHRASE Label="la_event_prod_order.submit" Module="In-Commerce" Type="1">T3JkZXIgU3VibWl0dGVk</PHRASE>
- <PHRASE Label="la_event_user.GiftCertificate" Module="In-Commerce" Type="1">R2lmdCBDZXJ0aWZpY2F0ZQ==</PHRASE>
- <PHRASE Label="la_event_user.suggest_product" Module="In-Commerce" Type="1">U3VnZ2VzdCBwcm9kdWN0IHRvIGEgZnJpZW5k</PHRASE>
<PHRASE Label="la_ExchangeRateSource" Module="In-Commerce" Type="1">Q2hvb3NlIHRoZSBleGNoYW5nZSByYXRlIHNvdXJjZQ==</PHRASE>
<PHRASE Label="la_Expiration" Module="In-Commerce" Type="1">RXhwaXJhdGlvbg==</PHRASE>
<PHRASE Label="la_Features" Module="In-Commerce" Type="1">RmVhdHVyZXM=</PHRASE>
Index: in-commerce/install/install_data.sql
===================================================================
--- in-commerce/install/install_data.sql (revision 13128)
+++ in-commerce/install/install_data.sql (working copy)
@@ -325,33 +325,33 @@
INSERT INTO CustomField 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 CustomField 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 Events VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_order.submit', 1);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_order.submit', 0);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_order.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_order.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_order.ship', 0);
-INSERT INTO Events VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_backorder.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_backorder.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_backorder.fullfill', 1);
-INSERT INTO Events VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_backorder.process', 0);
-INSERT INTO Events VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_user.suggest_product', 0);
-INSERT INTO Events VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_user.suggest_product', 1);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_affiliate.register', 0);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'la_event_prod_affiliate.register', 1);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.payment', 0);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.payment', 1);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.registration_approved', 0);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.registration_approved', 1);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.registration_denied', 0);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.registration_denied', 1);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.payment_type_changed', 0);
-INSERT INTO Events VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_prod_affiliate.payment_type_changed', 1);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'la_RecurringOrderProcessed', 0);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'la_RecurringOrderProcessed', 1);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'la_RecurringOrderDenied', 0);
-INSERT INTO Events VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'la_RecurringOrderDenied', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_user.giftcertificate', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'la_event_user.giftcertificate', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, NULL, 'In-Commerce', 'Order Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, NULL, 'In-Commerce', 'Order Denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, NULL, 'In-Commerce', 'Order Shipped', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, NULL, 'In-Commerce', 'Back-order is Fulfilled', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, NULL, 'In-Commerce', 'Backorder Processed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, NULL, 'In-Commerce', 'Suggest product to a friend', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, NULL, 'In-Commerce', 'Suggest product to a friend', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 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: in-link/install/english.lang
===================================================================
--- in-link/install/english.lang (revision 13128)
+++ in-link/install/english.lang (working copy)
@@ -16,23 +16,6 @@
<PHRASE Label="la_config_ReciprocalLinkChecking" Module="In-Link" Type="1">UmVjaXByb2NhbCBMaW5rIENoZWNraW5n</PHRASE>
<PHRASE Label="la_DecreaseBy" Module="In-Link" Type="1">RGVjcmVhc2UgQnk=</PHRASE>
<PHRASE Label="la_DontChange" Module="In-Link" Type="1">RG9uJ3QgQ2hhbmdl</PHRASE>
- <PHRASE Label="la_event_link.link.contactform" Module="In-Link" Type="1">TGluayBDb250YWN0IEZvcm0=</PHRASE>
- <PHRASE Label="la_event_link.link.enhance" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ=</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.approve" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA==</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.deny" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBkZW5pZWQ=</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.expire" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBleHBpcmVk</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.extend" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA==</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.renew" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA==</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.renewal_notice" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU=</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.renew_cancel" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ=</PHRASE>
- <PHRASE Label="la_event_link.link.enhance.renew_failed" Module="In-Link" Type="1">TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA==</PHRASE>
- <PHRASE Label="la_event_link.modify" Module="In-Link" Type="1">TW9kaWZ5IExpbms=</PHRASE>
- <PHRASE Label="la_event_Link.Reciprocal.Check.Failed" Module="In-Link" Type="1">UmVjaXByb2NhbCBDaGVjayBGYWlsZWQ=</PHRASE>
- <PHRASE Label="la_event_link.review.add" Module="In-Link" Type="1">TGluayBDb21tZW50IEFkZGVk</PHRASE>
- <PHRASE Label="la_event_link.review.add.pending" Module="In-Link" Type="1">TGluayBDb21tZW50IFBlbmRpbmc=</PHRASE>
- <PHRASE Label="la_event_link.review.approve" Module="In-Link" Type="1">TGluayBDb21tZW50IEFwcHJvdmVk</PHRASE>
- <PHRASE Label="la_event_link.review.deny" Module="In-Link" Type="1">TGluayBDb21tZW50IERlY2xpbmVk</PHRASE>
- <PHRASE Label="la_event_link.validation.results" Module="In-Link" Type="1">TGluayBWYWxpZGF0aW9uIFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_fld_AdditionalSection" Module="In-Link" Type="1">QWRkaXRpb25hbCBTZWN0aW9u</PHRASE>
<PHRASE Label="la_fld_cust_l_ItemTemplate" Module="In-Link" Type="1">TGluayBJdGVtIFRlbXBsYXRl</PHRASE>
<PHRASE Label="la_fld_EnableBuying" Module="In-Link" Type="1">RW5hYmxlIFB1cmNoYXNpbmc=</PHRASE>
Index: in-link/install/install_data.sql
===================================================================
--- in-link/install/install_data.sql (revision 13128)
+++ in-link/install/install_data.sql (working copy)
@@ -118,46 +118,46 @@
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_EnableLinkContactForm', 1, 'In-Link', 'in-link:configuration_output');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ReciprocalLinkChecking', '0', 'In-Link', 'in-link:configuration_output');
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.modify', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.modify.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.review.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.approve', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.deny', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.expire', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.expire', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.extend', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.extend', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_failed', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_failed', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_cancel', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_cancel', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renewal_notice', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renewal_notice', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.contactform', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.contactform', 0);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.reciprocal.check.failed', 1);
-INSERT INTO Events VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.validation.results', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, NULL, 'In-Link', 'Add Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, NULL, 'In-Link', 'Add Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Add Pending Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Add Pending Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, NULL, 'In-Link', 'Modify Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, NULL, 'In-Link', 'Modify Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Modification Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Link Modification Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Link Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, NULL, 'In-Link', 'Decline link modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Pending Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, NULL, 'In-Link', 'Deny Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, NULL, 'In-Link', 'Link Comment Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Declined', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement approved', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement extended', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement extended', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Reciprocal Check Failed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, NULL, 'In-Link', 'Link Validation Results', 1);
INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkAddress', 'lu_fld_LinkAddress', 0, 'la_section_BusinessLocation', 'la_fld_LinkAddress', 'text', 'size="40"', '', 1, 1, 0, 0);
INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkCity', 'lu_fld_LinkCity', 0, 'la_section_BusinessLocation', 'la_fld_LinkCity', 'text', 'size="40"', '', 2, 1, 0, 0);
Index: in-news/install/english.lang
===================================================================
--- in-news/install/english.lang (revision 13128)
+++ in-news/install/english.lang (working copy)
@@ -12,18 +12,6 @@
<PHRASE Label="la_col_LeadCatStory" Module="In-News" Type="1">U2VjdGlvbiBMZWFk</PHRASE>
<PHRASE Label="la_col_LeadStory" Module="In-News" Type="1">U2l0ZSBMZWFk</PHRASE>
<PHRASE Label="la_col_StartDate" Module="In-News" Type="1">U3RhcnQgRGF0ZQ==</PHRASE>
- <PHRASE Label="la_event_article.add" Module="In-News" Type="1">QWRkIEFydGljbGU=</PHRASE>
- <PHRASE Label="la_event_article.approve" Module="In-News" Type="1">QXBwcm92ZSBBcnRpY2xl</PHRASE>
- <PHRASE Label="la_event_article.deny" Module="In-News" Type="1">RGVjbGluZSBBcnRpY2xl</PHRASE>
- <PHRASE Label="la_event_article.modify" Module="In-News" Type="1">TW9kaWZ5IEFydGljbGU=</PHRASE>
- <PHRASE Label="la_event_article.modify.approve" Module="In-News" Type="1">QXBwcm92ZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
- <PHRASE Label="la_event_article.modify.deny" Module="In-News" Type="1">RGVjbGluZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
- <PHRASE Label="la_event_article.review.add" Module="In-News" Type="1">QXJ0aWNsZSBDb21tZW50IEFkZGVk</PHRASE>
- <PHRASE Label="la_event_article.review.add.pending" Module="In-News" Type="1">QXJ0aWNsZSBDb21tZW50IFBlbmRpbmc=</PHRASE>
- <PHRASE Label="la_event_article.review.approve" Module="In-News" Type="1">QXJ0aWNsZSBDb21tZW50IEFwcHJvdmVk</PHRASE>
- <PHRASE Label="la_event_article.review.deny" Module="In-News" Type="1">QXJ0aWNsZSBDb21tZW50IERlY2xpbmVk</PHRASE>
- <PHRASE Label="la_event_news.add.pending" Module="In-News" Type="1">QXJ0aWNsZSBBZGQgUGVuZGluZw==</PHRASE>
- <PHRASE Label="la_event_news.modify.pending" Module="In-News" Type="1">QXJ0aWNsZSBNb2RpZnkgUGVuZGluZw==</PHRASE>
<PHRASE Label="la_fld_Author" Module="In-News" Type="1">QXV0aG9y</PHRASE>
<PHRASE Label="la_fld_Body" Module="In-News" Type="1">QXJ0aWNsZSBCb2R5</PHRASE>
<PHRASE Label="la_fld_cust_n_ItemTemplate" Module="In-News" Type="1">TmV3cyBJdGVtIFRlbXBsYXRl</PHRASE>
Index: in-news/install/install_data.sql
===================================================================
--- in-news/install/install_data.sql (revision 13128)
+++ in-news/install/install_data.sql (working copy)
@@ -91,24 +91,24 @@
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'n_MaxCategories', '3', 'In-News', 'in-news:configuration_output');
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 1, NULL, 'In-News', 'la_event_article.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 0, NULL, 'In-News', 'la_event_article.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 1, NULL, 'In-News', 'la_event_news.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'la_event_news.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 1, NULL, 'In-News', 'la_event_article.modify', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 0, NULL, 'In-News', 'la_event_article.modify', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-News', 'la_event_news.modify.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-News', 'la_event_news.modify.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-News', 'la_event_article.modify.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.MODIFY.DENY', NULL, 1, 0, NULL, 'In-News', 'la_event_article.modify.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.APPROVE', NULL, 1, 0, NULL, 'In-News', 'la_event_article.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.DENY', NULL, 1, 0, NULL, 'In-News', 'la_event_article.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 1, NULL, 'In-News', 'la_event_article.review.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.DENY', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.add.pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 1, NULL, 'In-News', 'Add Article', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 0, NULL, 'In-News', 'Add Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Add Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Add Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 1, NULL, 'In-News', 'Modify Article', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 0, NULL, 'In-News', 'Modify Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Modify Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Modify Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 1, NULL, 'In-News', 'Article Comment Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 0, NULL, 'In-News', 'Article Comment Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Article Comment Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.DENY', NULL, 1, 0, NULL, 'In-News', 'Article Comment Declined', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 0);
INSERT INTO ItemTypes VALUES (2, 'In-News', 'n', 'News', 'Title', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_News', 1, 'in-news/admin/addarticle.php', 'clsNews', 'Article');
language_refactoring_email_events_core.patch [^] (120,030 bytes) 2010-01-26 14:39
[Show Content]
Index: admin_templates/config/config_email_edit.tpl
===================================================================
--- admin_templates/config/config_email_edit.tpl (revision 13128)
+++ admin_templates/config/config_email_edit.tpl (working copy)
@@ -71,7 +71,7 @@
<inp2:m_RenderElement name="inp_edit_user" prefix="emailevents" field="FromUserId" title="la_fld_FromToUser"/>
<inp2:m_RenderElement name="inp_label" prefix="emailevents" field="Module" title="la_fld_Module"/>
- <inp2:m_RenderElement name="inp_label" prefix="emailevents" field="Description" title="la_fld_Description" as_label="1"/>
+ <inp2:m_RenderElement name="inp_label" prefix="emailevents" field="Description" title="la_fld_Description"/>
<inp2:m_RenderElement name="inp_label" prefix="emailevents" field="Type" title="la_fld_Type"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
Index: admin_templates/emails/mass_mail.tpl
===================================================================
--- admin_templates/emails/mass_mail.tpl (revision 13128)
+++ admin_templates/emails/mass_mail.tpl (working copy)
@@ -1,64 +0,0 @@
-<inp2:adm_SetPopupSize width="900" height="600"/>
-
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send_form"/>
-
-<!-- ToolBar -->
-<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
-<tbody>
- <tr>
- <td>
- <script type="text/javascript">
- var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_SendEmail" escape="1"/>', function() {
- submit_event('emailmessages', 'OnMassMail');
- }
- ) );
- a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- submit_event('emailmessages', 'OnGoBack');
- }
- ) );
-
- a_toolbar.Render();
- </script>
- </td>
- </tr>
-</tbody>
-</table>
-
-<inp2:emailmessages_SaveWarning name="grid_save_warning"/>
-<inp2:emailmessages_ErrorWarning name="form_error_warning"/>
-
-<div id="scroll_container">
- <table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="la_section_General"/>
-
- <!-- recipients list -->
- <tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="label-cell">
- <inp2:m_phrase label="la_fld_To"/>:
- </td>
- <td class="control-mid"> </td>
- <td class="control-cell">
- <inp2:m_DefineElement name="recipient_element">
- <<inp2:m_Param name="recipient_name"/>>
- <inp2:m_if check="m_Param" name="not_last">
- ;
- </inp2:m_if>
- </inp2:m_DefineElement>
-
- <inp2:emailmessages_PrintRecipients render_as="recipient_element" strip_nl="2"/>
- </td>
- </tr>
- <!-- // recipients list -->
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="MassSubject" title="la_fld_Subject" size="60"/>
- <inp2:m_RenderElement name="inp_edit_upload" prefix="emailmessages" field="MassAttachment" title="la_fld_Attachment" size="60"/>
- <inp2:m_RenderElement name="subsection" title="la_section_Message"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassHtmlMessage" title="la_fld_HtmlVersion" rows="10" cols="100"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassTextMessage" allow_html="0" title="la_fld_TextVersion" rows="10" cols="100"/>
- </table>
-</div>
-
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/emails/prepare_queue.tpl
===================================================================
--- admin_templates/emails/prepare_queue.tpl (revision 13128)
+++ admin_templates/emails/prepare_queue.tpl (working copy)
@@ -1,15 +0,0 @@
-<inp2:adm_SetPopupSize width="900" height="600"/>
-
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_prepare"/>
-
- <inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
- <script type="text/javascript">
- function cancel_action() {
- redirect('<inp2:m_Link template="emails/send_complete"/>');
- }
-
- $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailmessages_event="OnPrepareEmailQueue" finish_template="emails/send_queue" pass="m,emailmessages" no_amp="1"/>');
- </script>
-
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/emails/send_complete.tpl
===================================================================
--- admin_templates/emails/send_complete.tpl (revision 13128)
+++ admin_templates/emails/send_complete.tpl (working copy)
@@ -1,28 +0,0 @@
-<inp2:adm_SetPopupSize width="900" height="600"/>
-
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send_complete"/>
-
-<script type="text/javascript">
- function close_window() {
- var $opener = getWindowOpener(window);
- if ($opener) {
- $opener.location.reload();
- }
-
- window_close();
- }
-</script>
-
-<div id="scroll_container">
- <table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="la_prompt_EmailCompleteMessage"/>
- <tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
- <td colspan="3" align="center">
- <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="close_window();"/>
- </td>
- </tr>
- </table>
-</div>
-
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/emails/send_queue.tpl
===================================================================
--- admin_templates/emails/send_queue.tpl (revision 13128)
+++ admin_templates/emails/send_queue.tpl (working copy)
@@ -1,15 +0,0 @@
-<inp2:adm_SetPopupSize width="900" height="600"/>
-
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send"/>
-
-<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
-<script type="text/javascript">
- function cancel_action() {
- redirect('<inp2:m_Link template="emails/send_complete"/>');
- }
-
- $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailevents_event="OnProcessEmailQueue" type="return_progress" finish_template="emails/send_complete" pass="m,emailevents" no_amp="1"/>');
-</script>
-
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/groups/groups_list.tpl
===================================================================
--- admin_templates/groups/groups_list.tpl (revision 13128)
+++ admin_templates/groups/groups_list.tpl (working copy)
@@ -30,15 +30,6 @@
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- /*<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <inp2:m_if check="m_Recall" name="user_id" equals_to="-1">
- a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
- openSelector('emailmessages', '<inp2:m_Link template="emails/mass_mail"/>', 'UserEmail', null, 'OnPrepareMassRecipients');
- }
- ) );
- </inp2:m_if>
- </inp2:m_if>*/
-
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
a_toolbar.AddButton(
new ToolBarButton(
Index: admin_templates/incs/grid_blocks.tpl
===================================================================
--- admin_templates/incs/grid_blocks.tpl (revision 13128)
+++ admin_templates/incs/grid_blocks.tpl (working copy)
@@ -885,4 +885,21 @@
<inp2:m_RenderElement name="nlsmenu_declaration" pass_params="true"/>
$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="grid_ml_selector">
+ <inp2:m_if check="lang_IsMultiLanguage">
+ <inp2:m_phrase name="la_fld_Language"/>:
+ <select name="language" onchange="submit_event('<inp2:m_param name='prefix'/>', 'OnPreSaveAndChangeLanguage');">
+ <inp2:m_DefineElement name="lang_elem">
+ <option value="<inp2:Field name='LanguageId'/>" <inp2:m_if check="SelectedLanguage" type="data">selected="selected"</inp2:m_if> ><inp2:Field name="LocalName" no_special='no_special' /></option>
+ </inp2:m_DefineElement>
+ <inp2:lang_PrintList render_as="lang_elem"/>
+ </select>
+ <inp2:m_else/>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:$prefix_SelectParam possible_names="pagination_prefix,prefix" result_to_var="pagination_prefix"/>
+ <inp2:m_RenderElement name="grid_pagination_elem" PrefixSpecial="$pagination_prefix" pass_params="1"/>
+ </inp2:m_if>
+ </inp2:m_if>
</inp2:m_DefineElement>
\ No newline at end of file
Index: admin_templates/languages/email_message_edit.tpl
===================================================================
--- admin_templates/languages/email_message_edit.tpl (revision 13128)
+++ admin_templates/languages/email_message_edit.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="875" height="650"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" prefix="emailmessages" title_preset="email_messages_edit_direct"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" prefix="emailevents" title_preset="email_messages_edit_direct"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -11,18 +11,18 @@
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
- submit_event('emailmessages','<inp2:emailmessages_SaveEvent/>');
+ submit_event('emailevents','<inp2:emailevents_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- cancel_edit('emailmessages','OnCancelEdit','<inp2:emailmessages_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ cancel_edit('emailevents','OnCancelEdit','<inp2:emailevents_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
- reset_form('emailmessages', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ reset_form('emailevents', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
) );
@@ -30,29 +30,34 @@
</script>
</td>
+
+ <inp2:m_RenderElement name="ml_selector" prefix="emailevents"/>
</tr>
</tbody>
</table>
-<inp2:emailmessages_SaveWarning name="grid_save_warning"/>
-<inp2:emailmessages_ErrorWarning name="form_error_warning"/>
+<inp2:emailevents_SaveWarning name="grid_save_warning"/>
+<inp2:emailevents_ErrorWarning name="form_error_warning"/>
+<inp2:m_RenderElement name="inp_edit_hidden" prefix="emailevents" field="EventId"/>
<div id="scroll_container">
<table class="edit-form">
- <inp2:m_RenderElement name="subsection" prefix="emailmessages" fields="Description,Subject,MessageType,Headers" title="!la_section_General!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="emailmessages" field="LanguageId"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="emailmessages" field="EventId"/>
+ <inp2:m_RenderElement name="subsection" prefix="emailevents" fields="EventId,Event,Subject,Enabled,FrontEndOnly,FromUserId,Module,Description,Type,MessageType,Headers" title="!la_section_General!"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="emailevents" field="EventId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="emailevents" field="Event" title="la_fld_Event"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="emailevents" field="Subject" title="la_fld_Subject"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="Description" title="la_fld_Description" control_options="{max_height: 50}"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailevents" field="Headers" title="la_fld_ExtraHeaders" control_options="{max_height: 50}"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="emailevents" field="Enabled" title="la_fld_Enabled"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="emailevents" field="FrontEndOnly" title="la_fld_FrontEndOnly"/>
+ <inp2:m_RenderElement name="inp_edit_user" prefix="emailevents" field="FromUserId" title="la_fld_FromToUser"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="emailevents" field="Type" title="la_fld_Type"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="emailevents" field="Module" title="la_fld_Module" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="emailevents" field="MessageType" title="la_fld_MessageType"/>
- <inp2:m_RenderElement name="inp_label" prefix="emailmessages" field="Description" title="!la_fld_Description!" as_label="1"/>
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="Subject" title="!la_fld_Subject!" size="60"/>
-
- <inp2:m_RenderElement name="inp_edit_radio" prefix="emailmessages" field="MessageType" title="!la_fld_MessageType!"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="Headers" title="!la_fld_ExtraHeaders!" control_options="{max_height: 50}"/>
-
- <inp2:m_RenderElement name="subsection" prefix="emailmessages" fields="Body" title="!la_section_Message!"/>
-
- <inp2:m_RenderElement name="inp_edit_fck" prefix="emailmessages" field="Body" title="!la_fld_ExtraHeaders!" rows="5" cols="60" control_options="{min_height: 200}"/>
+ <inp2:m_RenderElement name="subsection" prefix="emailevents" fields="Body" title="!la_section_Message!"/>
+ <inp2:m_RenderElement name="inp_edit_fck" prefix="emailevents" field="Body" title="la_fld_MessageBody" rows="5" cols="60" control_options="{min_height: 200}"/>
+ <!-- <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="Body" title="la_fld_MessageBody" control_options="{min_height: 200}"/> -->
<inp2:m_RenderElement name="inp_edit_filler" control_options="{max_height: 8}"/>
</table>
</div>
Index: admin_templates/languages/email_message_list.tpl
===================================================================
--- admin_templates/languages/email_message_list.tpl (revision 13128)
+++ admin_templates/languages/email_message_list.tpl (working copy)
@@ -1,21 +1,39 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" pagination="1" prefix="emailmessages.st" grid="Emails" title_preset="email_messages_direct_list"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" pagination="1" prefix="emailevents" grid="Emails" title_preset="email_messages_direct_list" additional_blue_bar_render_as="grid_ml_selector"/>
+
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
-
- function edit()
- {
- set_hidden_field('remove_specials[emailmessages.st]', 1);
- std_edit_item('emailmessages.st', 'languages/email_message_edit');
+ function edit() {
+ std_edit_item('emailevents', 'languages/email_message_edit');
}
a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'new_item',
+ '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('emailevents', 'languages/email_message_edit');
+ }
+ )
+ );
+
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'delete',
+ '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('emailevents');
+ }
+ )
+ );
<inp2:m_if check="m_IsDebugMode">
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
@@ -25,8 +43,7 @@
'approve',
'<inp2:m_phrase label="la_ToolTip_Enable" escape="1"/>',
function() {
- set_hidden_field('remove_specials[emailmessages.st]', 1);
- submit_event('emailmessages.st', 'OnMassApprove');
+ submit_event('emailevents', 'OnMassApprove');
}
)
);
@@ -36,8 +53,7 @@
'decline',
'<inp2:m_phrase label="la_ToolTip_Disable" escape="1"/>',
function() {
- set_hidden_field('remove_specials[emailmessages.st]', 1);
- submit_event('emailmessages.st', 'OnMassDecline');
+ submit_event('emailevents', 'OnMassDecline');
}
)
);
@@ -54,7 +70,7 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="emailmessages.st" grid="Emails"/>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="emailevents" grid="Emails"/>
</tr>
</tbody>
</table>
@@ -75,8 +91,8 @@
</inp2:m_ifnot>
</inp2:m_DefineElement>
-<inp2:m_RenderElement name="grid" PrefixSpecial="emailmessages.st" IdField="EmailMessageId" grid="Emails" row_class_render_as="row_class"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="emailevents" IdField="EventId" grid="Emails" row_class_render_as="row_class"/>
<script type="text/javascript">
- Grids['emailmessages.st'].SetDependantToolbarButtons( new Array('edit', 'approve', 'decline') );
+ Grids['emailevents'].SetDependantToolbarButtons( new Array('edit', 'delete', 'approve', 'decline') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/logs/email_logs/email_queue_list.tpl
===================================================================
--- admin_templates/logs/email_logs/email_queue_list.tpl (revision 13128)
+++ admin_templates/logs/email_logs/email_queue_list.tpl (working copy)
@@ -55,7 +55,7 @@
'e-mail',
'<inp2:m_phrase label="la_ToolTip_ProcessQueue" escape="1"/>',
function() {
- open_popup('emailmessages', null, 'emails/send_queue');
+ open_popup('emailevents', null, 'mailing_lists/send_queue');
}
)
);
Index: admin_templates/mailing_lists/send_queue.tpl
===================================================================
--- admin_templates/mailing_lists/send_queue.tpl (revision 13128)
+++ admin_templates/mailing_lists/send_queue.tpl (working copy)
@@ -6,10 +6,10 @@
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
- redirect('<inp2:m_Link template="emails/send_complete"/>');
+ redirect('<inp2:m_Link template="mailing_lists/send_complete"/>');
}
- $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailevents_event="OnProcessEmailQueue" type="return_progress" finish_template="emails/send_complete" pass="m,emailevents" no_amp="1"/>');
+ $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailevents_event="OnProcessEmailQueue" type="return_progress" finish_template="mailing_lists/send_complete" pass="m,emailevents" no_amp="1"/>');
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/regional/email_messages_edit.tpl
===================================================================
--- admin_templates/regional/email_messages_edit.tpl (revision 13128)
+++ admin_templates/regional/email_messages_edit.tpl (working copy)
@@ -11,12 +11,12 @@
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
- submit_event('emailmessages','<inp2:m_if check="emailmessages_PropertyEquals" property="ID" value="0" >OnCreate<inp2:m_else/>OnUpdate</inp2:m_if>');
+ submit_event('emailevents','<inp2:emailevents_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- submit_event('emailmessages','OnCancel');
+ submit_event('emailevents','OnCancel');
}
) );
@@ -28,20 +28,23 @@
</tbody>
</table>
-<inp2:emailmessages_SaveWarning name="grid_save_warning"/>
-<inp2:emailmessages_ErrorWarning name="form_error_warning"/>
+<inp2:emailevents_SaveWarning name="grid_save_warning"/>
+<inp2:emailevents_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="emailmessages" field="LanguageId"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="emailmessages" field="EventId"/>
- <!-- <inp2:m_RenderElement name="inp_label" prefix="emailmessages" field="Type" title="!la_fld_EventType!"/> -->
- <inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="Subject" title="!la_fld_Subject!" size="60"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="emailmessages" field="MessageType" title="!la_fld_MessageType!"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="Headers" title="!la_fld_ExtraHeaders!" allow_html="0" control_options="{min_height: 50}" rows="3" cols="60"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="emailevents" field="EventId" title="la_fld_Id"/>
+ <!--## <inp2:m_RenderElement name="inp_label" prefix="emailevents" field="Type" title="!la_fld_EventType!"/> ##-->
+
+ <inp2:lang_Field name="LanguageId" result_to_var="language_id"/>
+ <inp2:m_RenderElement name="inp_edit_box_ml" prefix="emailevents" field="l{$language_id}_Subject" title="!la_fld_Subject!" size="60"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="emailevents" field="MessageType" title="!la_fld_MessageType!"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailevents" field="Headers" title="!la_fld_ExtraHeaders!" allow_html="0" control_options="{min_height: 50}" rows="3" cols="60"/>
+
<inp2:m_RenderElement name="subsection" title="!la_section_Message!"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="Body" title="!la_fld_MessageBody!" control_options="{min_height: 200}" rows="20" cols="85"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="l{$language_id}_Body" title="!la_fld_MessageBody!" control_options="{min_height: 200}" rows="20" cols="85"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
Index: admin_templates/users/users_list.tpl
===================================================================
--- admin_templates/users/users_list.tpl (revision 13128)
+++ admin_templates/users/users_list.tpl (working copy)
@@ -55,16 +55,6 @@
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
- /*<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <inp2:m_if check="m_Recall" name="user_id" equals_to="-1">
- a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
- set_hidden_field('remove_specials[u.regular]', 1);
- openSelector('emailmessages', '<inp2:m_Link template="emails/mass_mail"/>', 'UserEmail', null, 'OnPrepareMassRecipients');
- }
- ) );
- </inp2:m_if>
- </inp2:m_if>*/
-
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
a_toolbar.AddButton(
new ToolBarButton(
Index: install/english.lang
===================================================================
--- install/english.lang (revision 13128)
+++ install/english.lang (working copy)
@@ -535,32 +535,6 @@
<PHRASE Label="la_err_required" Module="Core" Type="1">RmllbGQgaXMgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_err_unique" Module="Core" Type="1">RmllbGQgdmFsdWUgbXVzdCBiZSB1bmlxdWU=</PHRASE>
<PHRASE Label="la_err_value_out_of_range" Module="Core" Type="1">RmllbGQgaXMgb3V0IG9mIHJhbmdlLCBwb3NzaWJsZSB2YWx1ZXMgZnJvbSAlcyB0byAlcw==</PHRASE>
- <PHRASE Label="la_event_category.add" Module="Core" Type="1">QWRkIENhdGVnb3J5</PHRASE>
- <PHRASE Label="la_event_category.add.pending" Module="Core" Type="1">QWRkIFBlbmRpbmcgQ2F0ZWdvcnk=</PHRASE>
- <PHRASE Label="la_event_category.approve" Module="Core" Type="1">QXBwcm92ZSBDYXRlZ29yeQ==</PHRASE>
- <PHRASE Label="la_event_category.deny" Module="Core" Type="1">RGVueSBDYXRlZ29yeQ==</PHRASE>
- <PHRASE Label="la_event_common.footer" Module="Core" Type="1">Q29tbW9uIEZvb3RlciBUZW1wbGF0ZQ==</PHRASE>
- <PHRASE Label="la_event_FormSubmitted" Module="Core" Type="1">VGhpcyBlLW1haWwgaXMgc2VudCB0byBhIHVzZXIgYWZ0ZXIgZmlsbGluZyBpbiB0aGUgQ29udGFjdCBVcyBmb3Jt</PHRASE>
- <PHRASE Label="la_event_link.add" Module="Core" Type="1">QWRkIExpbms=</PHRASE>
- <PHRASE Label="la_event_link.add.pending" Module="Core" Type="1">QWRkIFBlbmRpbmcgTGluaw==</PHRASE>
- <PHRASE Label="la_event_link.approve" Module="Core" Type="1">QXBwcm92ZSBQZW5kaW5nIExpbms=</PHRASE>
- <PHRASE Label="la_event_link.deny" Module="Core" Type="1">RGVueSBMaW5r</PHRASE>
- <PHRASE Label="la_event_link.modify.approve" Module="Core" Type="1">QXBwcm92ZSBMaW5rIE1vZGlmaWNhdGlvbg==</PHRASE>
- <PHRASE Label="la_event_link.modify.deny" Module="Core" Type="1">RGVjbGluZSBsaW5rIG1vZGlmaWNhdGlvbg==</PHRASE>
- <PHRASE Label="la_event_link.modify.pending" Module="Core" Type="1">TGluayBNb2RpZmljYXRpb24gUGVuZGluZw==</PHRASE>
- <PHRASE Label="la_event_pm.add" Module="Core" Type="1">TmV3IFByaXZhdGUgTWVzc2FnZQ==</PHRASE>
- <PHRASE Label="la_event_user.add" Module="Core" Type="1">QWRkIFVzZXI=</PHRASE>
- <PHRASE Label="la_event_user.add.pending" Module="Core" Type="1">QWRkIFBlbmRpbmcgVXNlcg==</PHRASE>
- <PHRASE Label="la_event_user.approve" Module="Core" Type="1">QXBwcm92ZSBVc2Vy</PHRASE>
- <PHRASE Label="la_event_user.deny" Module="Core" Type="1">RGVueSBVc2Vy</PHRASE>
- <PHRASE Label="la_event_user.forgotpw" Module="Core" Type="1">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
- <PHRASE Label="la_event_user.membership_expiration_notice" Module="Core" Type="1">TWVtYmVyc2hpcCBleHBpcmF0aW9uIG5vdGljZQ==</PHRASE>
- <PHRASE Label="la_event_user.membership_expired" Module="Core" Type="1">TWVtYmVyc2hpcCBleHBpcmVk</PHRASE>
- <PHRASE Label="la_event_user.pswd_confirm" Module="Core" Type="1">UGFzc3dvcmQgQ29uZmlybWF0aW9u</PHRASE>
- <PHRASE Label="la_event_user.subscribe" Module="Core" Type="1">VXNlciBzdWJzY3JpYmVk</PHRASE>
- <PHRASE Label="la_event_user.suggest" Module="Core" Type="1">U3VnZ2VzdCB0byBhIGZyaWVuZA==</PHRASE>
- <PHRASE Label="la_event_user.unsubscribe" Module="Core" Type="1">VXNlciB1bnN1YnNjcmliZWQ=</PHRASE>
- <PHRASE Label="la_event_user.validate" Module="Core" Type="1">VmFsaWRhdGUgVXNlcg==</PHRASE>
<PHRASE Label="la_exportfoldernotwritable" Module="Core" Type="1">RXhwb3J0IGZvbGRlciBpcyBub3Qgd3JpdGFibGU=</PHRASE>
<PHRASE Label="la_fck_ErrorCreatingFolder" Module="Core" Type="1">RXJyb3IgY3JlYXRpbmcgZm9sZGVyLiBFcnJvciBudW1iZXI6</PHRASE>
<PHRASE Label="la_fck_ErrorFileName" Module="Core" Type="1">UGxlYXNlIG5hbWUgeW91ciBmaWxlcyB0byBiZSB3ZWItZnJpZW5kbHkuIFdlIHJlY29tbWVuZCB1c2luZyBvbmx5IHRoZXNlIGNoYXJhY3RlcnMgaW4gZmlsZSBuYW1lczogDQpMZXR0ZXJzIGEteiwgQS1aLCBOdW1iZXJzIDAtOSwgIl8iICh1bmRlcnNjb3JlKSwgIi0iIChkYXNoKSwgIiAiIChzcGFjZSksICIuIiAocGVyaW9kKQ0KUGxlYXNlIGF2b2lkIHVzaW5nIGFueSBvdGhlciBjaGFyYWN0ZXJzIGxpa2UgcXVvdGVzLCBicmFja2V0cywgcXVvdGF0aW9uIG1hcmtzLCAiPyIsICIhIiwgIj0iLCBmb3JlaWduIHN5bWJvbHMsIGV0Yy4=</PHRASE>
@@ -1380,6 +1354,7 @@
<PHRASE Label="la_title_Adding_Category" Module="Core" Type="1">QWRkaW5nIFNlY3Rpb24=</PHRASE>
<PHRASE Label="la_title_Adding_ConfigSearch" Module="Core" Type="1">QWRkaW5nIFNlYXJjaCBGaWVsZA==</PHRASE>
<PHRASE Label="la_title_Adding_Content" Module="Core" Type="1">QWRkaW5nIENNUyBCbG9jaw==</PHRASE>
+ <PHRASE Label="la_title_Adding_E-mail" Module="Core" Type="1">QWRkaW5nIEVtYWlsIEV2ZW50</PHRASE>
<PHRASE Label="la_title_Adding_Form" Module="Core" Type="1">QWRkaW5nIEZvcm0=</PHRASE>
<PHRASE Label="la_title_Adding_FormField" Module="Core" Type="1">QWRkaW5nIEZvcm0gRmllbGQ=</PHRASE>
<PHRASE Label="la_title_Adding_Group" Module="Core" Type="1">QWRkaW5nIEdyb3Vw</PHRASE>
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 13128)
+++ install/install_data.sql (working copy)
@@ -239,38 +239,38 @@
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
-INSERT INTO Events VALUES(DEFAULT, 'USER.ADD', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.ADD', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.approve', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.validate', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.validate', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.DENY', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.DENY', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.deny', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.forgotpw', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.forgotpw', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 0, NULL, 'Core:Category', 'la_event_category.add', 0);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Category', 'la_event_category.add.pending', 0);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Category', 'la_event_category.add.pending', 1);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 1, NULL, 'Core:Category', 'la_event_category.add', 1);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.APPROVE', NULL, 1, 0, NULL, 'Core:Category', 'la_event_category.approve', 0);
-INSERT INTO Events VALUES(DEFAULT, 'CATEGORY.DENY', NULL, 1, 0, NULL, 'Core:Category', 'la_event_category.deny', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.subscribe', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.subscribe', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.unsubscribe', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.unsubscribe', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.suggest', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 1, NULL, 'Core:Users', 'la_event_user.suggest', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.PSWDC', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.pswd_confirm', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.membership_expired', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.membership_expired', 1);
-INSERT INTO Events VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.membership_expiration_notice', 0);
-INSERT INTO Events VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'la_event_user.membership_expiration_notice', 1);
-INSERT INTO Events VALUES(DEFAULT, 'COMMON.FOOTER', NULL, 1, 0, NULL, 'Core', 'la_event_common.footer', 1);
-INSERT INTO Events VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'la_event_FormSubmitted', 1);
-INSERT INTO Events VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'la_event_FormSubmitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 0, NULL, 'Core:Users', 'Add User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 1, NULL, 'Core:Users', 'Add User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 0, NULL, 'Core:Users', 'Approve User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 1, NULL, 'Core:Users', 'Approve User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 0, NULL, 'Core:Users', 'Validate User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 1, NULL, 'Core:Users', 'Validate User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 0, NULL, 'Core:Users', 'Deny User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 1, NULL, 'Core:Users', 'Deny User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 1, NULL, 'Core:Users', 'Forgot Password', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 0, NULL, 'Core:Users', 'Forgot Password', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Users', 'Add Pending User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Users', 'Add Pending User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 0, NULL, 'Core:Category', 'Add Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Category', 'Add Pending Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Category', 'Add Pending Category', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 1, NULL, 'Core:Category', 'Add Category', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.APPROVE', NULL, 1, 0, NULL, 'Core:Category', 'Approve Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.DENY', NULL, 1, 0, NULL, 'Core:Category', 'Deny Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User subscribed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User subscribed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User unsubscribed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User unsubscribed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 0, NULL, 'Core:Users', 'Suggest to a friend', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 1, NULL, 'Core:Users', 'Suggest to a friend', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWDC', NULL, 1, 0, NULL, 'Core:Users', 'Password Confirmation', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'COMMON.FOOTER', NULL, 1, 0, NULL, 'Core', 'Common Footer Template', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 0);
INSERT INTO IdGenerator VALUES ('100');
@@ -637,7 +637,9 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:phrases.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configemail.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configemail.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configemail.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configemail.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, 0);
Index: install/install_schema.sql
===================================================================
--- install/install_schema.sql (revision 13128)
+++ install/install_schema.sql (working copy)
@@ -69,16 +69,6 @@
UNIQUE KEY VariableName (VariableName)
);
-CREATE TABLE EmailMessage (
- EmailMessageId int(10) NOT NULL auto_increment,
- Template longtext,
- MessageType enum('html','text') NOT NULL default 'text',
- LanguageId int(11) NOT NULL default '0',
- EventId int(11) NOT NULL default '0',
- `Subject` text,
- PRIMARY KEY (EmailMessageId)
-);
-
CREATE TABLE EmailQueue (
EmailQueueId int(10) unsigned NOT NULL AUTO_INCREMENT,
ToEmail varchar(255) NOT NULL DEFAULT '',
@@ -103,19 +93,35 @@
);
CREATE TABLE Events (
- EventId int(11) NOT NULL auto_increment,
- Event varchar(40) NOT NULL default '',
+ EventId int(11) NOT NULL AUTO_INCREMENT,
+ `Event` varchar(40) NOT NULL DEFAULT '',
ReplacementTags text,
- Enabled int(11) NOT NULL default '1',
- FrontEndOnly tinyint(3) unsigned NOT NULL default '0',
- FromUserId int(11) default NULL,
- Module varchar(40) NOT NULL default '',
- Description varchar(255) NOT NULL default '',
- `Type` int(11) NOT NULL default '0',
- PRIMARY KEY (EventId),
+ l1_Subject text,
+ l2_Subject text,
+ l3_Subject text,
+ l4_Subject text,
+ l5_Subject text,
+ l1_Body longtext,
+ l2_Body longtext,
+ l3_Body longtext,
+ l4_Body longtext,
+ l5_Body longtext,
+ Headers text,
+ MessageType varchar(4) NOT NULL DEFAULT 'text',
+ Enabled int(11) NOT NULL DEFAULT '1',
+ FrontEndOnly tinyint(3) unsigned NOT NULL DEFAULT '0',
+ FromUserId int(11) DEFAULT NULL,
+ Module varchar(40) NOT NULL DEFAULT '',
+ l1_Description text,
+ l2_Description text,
+ l3_Description text,
+ l4_Description text,
+ l5_Description text,
+ `Type` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (EventId),
KEY `Type` (`Type`),
KEY Enabled (Enabled),
- KEY Event (Event),
+ KEY `Event` (`Event`),
KEY FrontEndOnly (FrontEndOnly)
);
Index: install/remove_schema.sql
===================================================================
--- install/remove_schema.sql (revision 13128)
+++ install/remove_schema.sql (working copy)
@@ -3,7 +3,6 @@
DROP TABLE CustomField;
DROP TABLE ConfigurationAdmin;
DROP TABLE ConfigurationValues;
-DROP TABLE EmailMessage;
DROP TABLE EmailQueue;
DROP TABLE EmailSubscribers;
DROP TABLE Events;
Index: install/upgrades.php
===================================================================
--- install/upgrades.php (revision 13128)
+++ install/upgrades.php (working copy)
@@ -1318,4 +1318,60 @@
}
}
}
+
+ /**
+ * Update to 5.1.0-B1; Makes email message fields multilingual
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_1_0_B1($mode)
+ {
+ if ($mode == 'before') {
+ $table_structure = $this->Conn->Query('DESCRIBE ' . TABLE_PREFIX . 'Events', 'Field');
+
+ if (!array_key_exists('Headers', $table_structure)) {
+ $sql = 'ALTER TABLE ' . TABLE_PREFIX . 'Events
+ ADD `Headers` TEXT NULL AFTER `ReplacementTags`,
+ ADD `MessageType` VARCHAR(4) NOT NULL default "text" AFTER `Headers`';
+ $this->Conn->Query($sql);
+ }
+
+ // create multilingual Subject and Template fields
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ $ml_helper->createFields('emailevents');
+
+ $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
+ /* @var $email_message_helper EmailMessageHelper */
+
+ for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) {
+ if (!$ml_helper->LanguageFound($language_id)) {
+ continue;
+ }
+
+ $sql = 'SELECT EmailMessageId, Template, EventId
+ FROM ' . TABLE_PREFIX . 'EmailMessage
+ WHERE LanguageId = ' . $language_id;
+ $translations = $this->Conn->Query($sql, 'EventId');
+
+ foreach ($translations as $event_id => $translation_data) {
+ $parsed = $email_message_helper->parseTemplate($translation_data['Template']);
+
+ $fields_hash = Array (
+ 'l' . $language_id . '_Subject' => $parsed['Subject'],
+ 'l' . $language_id . '_Body' => $parsed['Body'],
+ );
+
+ if ($parsed['Headers']) {
+ $fields_hash['Headers'] = $parsed['Headers'];
+ }
+
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Events', 'EventId = ' . $event_id);
+
+ $sql = 'DELETE FROM ' . TABLE_PREFIX . 'EmailMessage
+ WHERE EmailMessageId = ' . $translation_data['EmailMessageId'];
+ $this->Conn->Query($sql);
+ }
+ }
+ }
+ }
}
\ No newline at end of file
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 13128)
+++ install/upgrades.sql (working copy)
@@ -1620,4 +1620,28 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+DROP TABLE EmailMessage;
+DELETE FROM PersistantSessionData WHERE VariableName = 'emailevents_columns_.';
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId)
+SELECT 'in-portal:configemail.add' AS Permission, GroupId, PermissionValue, Type, CatId
+FROM <%TABLE_PREFIX%>Permissions
+WHERE Permission = 'in-portal:configemail.edit';
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId)
+SELECT 'in-portal:configemail.delete' AS Permission, GroupId, PermissionValue, Type, CatId
+FROM <%TABLE_PREFIX%>Permissions
+WHERE Permission = 'in-portal:configemail.edit';
+
+UPDATE Events e
+SET e.l1_Description = (
+ SELECT p.Translation
+ FROM <%TABLE_PREFIX%>Phrase p
+ WHERE (p.Phrase = e.Description) AND (p.LanguageId = 1)
+);
+
+ALTER TABLE Events DROP Description;
+DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%';
Index: kernel/db/db_event_handler.php
===================================================================
--- kernel/db/db_event_handler.php (revision 13128)
+++ kernel/db/db_event_handler.php (working copy)
@@ -71,6 +71,8 @@
*/
function CheckPermission(&$event)
{
+ $section = $event->getSection();
+
if (!$this->Application->isAdmin) {
$allow_events = Array('OnSearch', 'OnSearchReset', 'OnNew');
if (in_array($event->Name, $allow_events)) {
@@ -78,8 +80,11 @@
return true;
}
}
+ elseif (($event->Name == 'OnPreSaveAndChangeLanguage') && !$this->UseTempTables($event)) {
+ // allow changing language in grids, when not in editing mode
+ return $this->Application->CheckPermission($section . '.view', 1);
+ }
- $section = $event->getSection();
if (!preg_match('/^CATEGORY:(.*)/', $section)) {
// only if not category item events
if ((substr($event->Name, 0, 9) == 'OnPreSave') || ($event->Name == 'OnSave')) {
@@ -2308,17 +2313,17 @@
*/
function OnPreSaveAndChangeLanguage(&$event)
{
- $event->CallSubEvent('OnPreSave');
+ if ($this->UseTempTables($event)) {
+ $event->CallSubEvent('OnPreSave');
+ }
if ($event->status == erSUCCESS) {
$this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
- $pass_vars = Array ('st_id', 'cms_id');
- foreach ($pass_vars as $pass_var) {
- $data = $this->Application->GetVar($pass_var);
- if ($data) {
- $event->SetRedirectParam($pass_var, $data);
- }
+ $data = $this->Application->GetVar('st_id');
+
+ if ($data) {
+ $event->SetRedirectParam('st_id', $data);
}
}
}
Index: units/email_events/email_event_tp.php
===================================================================
--- units/email_events/email_event_tp.php (revision 0)
+++ units/email_events/email_event_tp.php (revision 0)
@@ -0,0 +1,24 @@
+<?php
+
+ class EmailEventTagProcessor extends kDBTagProcessor
+ {
+ /**
+ * Removes "Enabled" column, when not in debug mode
+ *
+ * @param Array $params
+ */
+ function ModifyUnitConfig($params)
+ {
+ if (!$this->Application->isDebugMode()) {
+ $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
+
+ foreach ($grids as $grid_name => $grid_data) {
+ if (array_key_exists('Enabled', $grid_data['Fields'])) {
+ unset($grids[$grid_name]['Fields']['Enabled']);
+ }
+ }
+
+ $this->Application->setUnitOption($this->Prefix, 'Grids', $grids);
+ }
+ }
+ }
\ No newline at end of file
Index: units/email_events/email_events_config.php
===================================================================
--- units/email_events/email_events_config.php (revision 13128)
+++ units/email_events/email_events_config.php (working copy)
@@ -19,7 +19,7 @@
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'EmailEventsEventsHandler', 'file' => 'email_events_event_handler.php', 'build_event' => 'OnBuild'),
- 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'EmailEventTagProcessor', 'file' => 'email_event_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
@@ -36,9 +36,12 @@
'TitlePresets' => Array (
'default' => Array (
+ 'new_status_labels' => Array ('emailevents' => '!la_title_Adding_E-mail!'),
+ 'edit_status_labels' => Array ('emailevents' => '!la_title_Editing_E-mail!'),
'edit_status_labels' => Array ('emailevents' => '!la_title_EditingEmailEvent!'),
),
+ // for editing in Regional section
'email_settings_list' => Array ('prefixes' => Array ('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'),
'email_settings_edit' => Array (
@@ -46,14 +49,39 @@
'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
),
+ // for separate grid with email editing
+ 'email_messages_direct_list' => Array (
+ 'prefixes' => Array ('emailevents_List'), 'format' => "!la_title_EmailMessages!",
+ 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
+ ),
+
+ 'email_messages_edit_direct' => Array (
+ 'prefixes' => Array ('emailevents'),
+ 'format' => '#emailevents_status# - #emailevents_titlefield#',
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit'),
+ ),
+
+ // for mass mailing
'email_send_form' => Array ('prefixes' => Array (), 'format' => '!la_title_SendEmail!'),
'email_prepare' => Array ('prefixes' => Array (), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'),
'email_send' => Array ('prefixes' => Array (), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'),
'email_send_complete' => Array ('prefixes' => Array (), 'format' => '!la_title_SendMailComplete!'),
),
- 'PermSection' => Array ('main' => 'in-portal:configure_lang'),
+ 'PermSection' => Array ('main' => 'in-portal:configemail'),
+ 'Sections' => Array (
+ 'in-portal:configemail' => Array (
+ 'parent' => 'in-portal:site',
+ 'icon' => 'email_templates',
+ 'label' => 'la_tab_E-mails',
+ 'url' => Array ('t' => 'languages/email_message_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+ ),
+
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_enabled', 'show_disabled', 'show_frontonly'), 'type' => WHERE_FILTER),
@@ -81,15 +109,42 @@
),
'ListSortings' => Array (
- '' => Array ('Sorting' => Array ('Module' => 'asc', 'Description' => 'asc')),
- 'module' => Array ('Sorting' => Array ('Description' => 'asc') ),
+ '' => Array (
+ 'ForcedSorting' => Array ('Enabled' => 'desc'),
+ 'Sorting' => Array ('Module' => 'asc', 'Description' => 'asc'),
+ ),
+ 'module' => Array (
+ 'ForcedSorting' => Array ('Enabled' => 'desc'),
+ 'Sorting' => Array ('Description' => 'asc')
+ ),
),
+ 'PopulateMlFields' => true,
+
'Fields' => Array (
'EventId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'Event' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Event' => Array ('type' => 'string', 'not_null' => 1, 'unique' => Array ('Type'), 'required' => 1, 'default' => ''),
+ 'Headers' => Array ('type' => 'string', 'default' => NULL),
'ReplacementTags' => Array ('type' => 'string', 'default' => NULL),
+ 'Subject' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kMultiLanguage', 'db_type' => 'text',
+ 'required' => 1, 'default' => null
+ ),
+
+ 'Body' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kMultiLanguage', 'db_type' => 'longtext',
+ 'required' => 1, 'default' => null
+ ),
+
+ 'MessageType' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array ('text' => 'la_Text', 'html' => 'la_Html'), 'use_phrases' => 1,
+ 'not_null' => 1, 'required' => 1, 'default' => 'text'
+ ),
+
'Enabled' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
@@ -108,12 +163,20 @@
'default' => NULL
),
- 'Module' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
- 'Description' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Module' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (),
+ 'not_null' => 1, 'required' => 1, 'default' => ''
+ ),
+ 'Description' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kMultiLanguage',
+ 'not_null' => 1, 'default' => '', 'db_type' => 'text',
+ ),
'Type' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1,
- 'not_null' => 1, 'required' => 1, 'default' => 0
+ 'not_null' => 1, 'unique' => Array ('Event'), 'required' => 1, 'default' => 0
),
),
@@ -122,6 +185,7 @@
),
'Grids' => Array (
+ // used on "Email Events" tab in language editing in "Regional" section
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
@@ -130,14 +194,33 @@
),
'Fields' => Array (
'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
- 'Description' => Array ( 'title' => 'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+ 'Description' => Array ( 'title' => 'la_col_Description', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'Event' => Array ( 'title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
- 'Module' => Array ( 'title' => 'la_col_Module', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'Module' => Array ( 'title' => 'la_col_Module', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'Type' => Array ( 'title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
'Enabled' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ),
),
),
+ // used on "Email Templates" section
+ 'Emails' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ ),
+ 'Fields' => Array (
+ 'EventId' => Array ( 'title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Event' => Array ( 'title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+ 'Subject' => Array ( 'title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'no_special' => 0, 'width' => 300, ),
+ 'Description' => Array ( 'title' => 'la_col_Description', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+ 'Type' => Array ( 'title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
+ 'Enabled' => Array ( 'title' => 'la_col_Enabled', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'Module' => Array ( 'title' => 'la_col_Module', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ ),
+ ),
+
+ // used on "E-Mail" section in each module
'EmailSettings' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
@@ -146,7 +229,7 @@
),
'Fields' => Array (
'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
- 'Description' => Array ('title' => 'la_col_EventDescription', 'data_block' => 'label_grid_checkbox_td', 'width' => 250, ),
+ 'Description' => Array ('title' => 'la_col_EventDescription', 'width' => 250, ),
'FromUser' => Array ('title' => 'la_col_FromToUser', 'data_block' => 'from_user_td', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'Type' => Array ('title' => 'la_col_RecipientType', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
'FrontEndOnly' => Array ('title' => 'la_col_FrontEndOnly', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
Index: units/email_events/email_events_event_handler.php
===================================================================
--- units/email_events/email_events_event_handler.php (revision 13128)
+++ units/email_events/email_events_event_handler.php (working copy)
@@ -16,7 +16,6 @@
class EmailEventsEventsHandler extends kDBEventHandler
{
-
/**
* Allows to override standart permission mapping
*
@@ -71,14 +70,36 @@
*/
function SetCustomQuery(&$event)
{
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
if ($event->Special == 'module') {
- $object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
+
+ if (!$event->Special && !$this->Application->isDebugMode()) {
+ // no special
+ $object->addFilter('enabled_filter', '%1$s.Enabled <> ' . STATUS_DISABLED);
+ }
}
/**
+ * Sets event id
+ *
+ * @param kEvent $event
+ */
+ function OnPreCreate(&$event)
+ {
+ parent::OnPreCreate($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $object->SetDBField('Headers', $this->Application->ConfigValue('Smtp_DefaultHeaders'));
+ }
+
+ /**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
@@ -147,46 +168,58 @@
}
/**
- * Returns sender & recipients ids plus event_id (as parameter by reference)
+ * Returns email event object based on given kEvent object
*
* @param kEvent $event
- * @param int $event_id id of email event used
- *
- * @return mixed
+ * @return kDBItem
*/
- function GetMessageRecipients(&$event, &$event_id)
+ function &_getEmailEvent(&$event)
{
- $email_event =& $event->getObject( Array('skip_autoload' => true) );
- /* @var $email_event kDBItem */
+ $false = false;
+ $name = $event->getEventParam('EmailEventName');
+ $type = $event->getEventParam('EmailEventType');
- // get event parameters by name & type
- $load_keys = Array (
- 'Event' => $event->getEventParam('EmailEventName'),
- 'Type' => $event->getEventParam('EmailEventType'),
- );
- $email_event->Load($load_keys);
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object kDBItem */
- if (!$email_event->isLoaded()) {
- // event record not found
- return false;
- }
+ if (!$object->isLoaded() || (($object->GetDBField('Event') != $name) && ($object->GetDBField('Type') != $type))) {
+ // get event parameters by name & type
+ $load_keys = Array ('Event' => $name, 'Type' => $type);
+ $object->Load($load_keys);
- if ($email_event->GetDBField('Enabled') == STATUS_DISABLED) {
- return false;
- }
+ if (!$object->isLoaded() || ($object->GetDBField('Enabled') == STATUS_DISABLED)) {
+ // event record not found OR is disabled
+ return $false;
+ }
- if ($email_event->GetDBField('FrontEndOnly') && $this->Application->isAdmin) {
- return false;
+ if ($object->GetDBField('FrontEndOnly') && $this->Application->isAdmin) {
+ return $false;
+ }
}
+ return $object;
+ }
+
+ /**
+ * Returns sender & recipients ids plus event_id (as parameter by reference)
+ *
+ * @param kEvent $event
+ *
+ * @return mixed
+ */
+ function GetMessageRecipients(&$event)
+ {
+ $object =& $this->_getEmailEvent($event);
+ /* @var $object kDBItem */
+
// initial values
$to_user_id = $event->getEventParam('EmailEventToUserId');
if ( !is_numeric($to_user_id) ) {
$to_user_id = -1; // when not specified, then send to "root"
}
- $from_user_id = $email_event->GetDBField('FromUserId');
+ $from_user_id = $object->GetDBField('FromUserId');
- if ($email_event->GetDBField('Type') == EVENT_TYPE_ADMIN) {
+ if ($object->GetDBField('Type') == EVENT_TYPE_ADMIN) {
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
if ($to_user_id == -1) {
$to_user_id = $from_user_id;
@@ -194,8 +227,6 @@
$from_user_id = -1;
}
- $event_id = $email_event->GetDBField('EventId');
-
return Array ($from_user_id, $to_user_id);
}
@@ -245,56 +276,28 @@
/**
* Returns email event message by ID (headers & body in one piece)
*
- * @param int $event_id
- * @param string $message_type contains message type = {text,html}
+ * @param kEvent $event
* @param int $language_id
*/
- function GetMessageBody($event_id, &$message_type, $language_id = null)
+ function GetMessageBody(&$event, $language_id = null)
{
if (!isset($language_id)) {
$language_id = $this->Application->GetVar('m_lang');
}
- $message =& $this->Application->recallObject('emailmessages', null, Array('skip_autoload' => true));
- /* @var $message kDBItem */
+ $object =& $this->_getEmailEvent($event);
- $message->Load( Array('EventId' => $event_id, 'LanguageId' => $language_id) );
- if (!$message->isLoaded()) {
- // event translation on required language not found
- return false;
- }
-
- $message_type = $message->GetDBField('MessageType');
-
// 1. get message body
- $message_body = $message->GetDBField('Template');
+ $message_body = $this->_formMessageBody($object, $language_id, $object->GetDBField('MessageType'));
- // 2. add footer
- $sql = 'SELECT em.Template
- FROM '.$message->TableName.' em
- LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
- WHERE em.LanguageId = '.$language_id.' AND e.Event = "COMMON.FOOTER"';
-
- list (, $footer) = explode("\n\n", $this->Conn->GetOne($sql));
- if ($message_type == 'text') {
- $esender =& $this->Application->recallObject('EmailSender');
- /* @var $esender kEmailSendingHelper */
-
- $footer = $esender->ConvertToText($footer);
- }
-
- if ($footer) {
- $message_body .= "\r\n".$footer;
- }
-
- // 3. replace tags if needed
+ // 2. replace tags if needed
$default_replacement_tags = Array (
'<inp:touser _Field="password"' => '<inp2:u_Field name="Password_plain"',
'<inp:touser _Field="UserName"' => '<inp2:u_Field name="Login"',
'<inp:touser _Field' => '<inp2:u_Field name',
);
- $replacement_tags = $message->GetDBField('ReplacementTags');
+ $replacement_tags = $object->GetDBField('ReplacementTags');
$replacement_tags = $replacement_tags ? unserialize($replacement_tags) : Array ();
$replacement_tags = array_merge_recursive2($default_replacement_tags, $replacement_tags);
@@ -306,6 +309,90 @@
}
/**
+ * Prepare email message body
+ *
+ * @param kDBItem $object
+ * @param int $language_id
+ * @return string
+ */
+ function _formMessageBody(&$object, $language_id)
+ {
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+
+ $fields_hash = Array (
+ 'Headers' => $object->GetDBField('Headers'),
+ );
+
+ // prepare subject
+ $subject = $object->GetDBField('l' . $language_id . '_Subject');
+
+ if (!$subject) {
+ $subject = $object->GetDBField('l' . $default_language_id . '_Subject');
+ }
+
+ $fields_hash['Subject'] = $subject;
+
+ // prepare body
+ $body = $object->GetDBField('l' . $language_id . '_Body');
+
+ if (!$body) {
+ $body = $object->GetDBField('l' . $default_language_id . '_Body');
+ }
+
+ $fields_hash['Body'] = $body;
+
+ $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
+ /* @var $email_message_helper EmailMessageHelper */
+
+ $ret = $email_message_helper->buildTemplate($fields_hash);
+
+ // add footer
+ $footer = $this->_getFooter($language_id, $object->GetDBField('MessageType'));
+
+ if ($ret && $footer) {
+ $ret .= "\r\n" . $footer;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Returns email footer
+ *
+ * @param int $language_id
+ * @param string $message_type
+ * @return string
+ */
+ function _getFooter($language_id, $message_type)
+ {
+ static $footer = null;
+
+ if (!isset($footer)) {
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+
+ $sql = 'SELECT l' . $language_id . '_Body, l' . $default_language_id . '_Body
+ FROM ' . $this->Application->getUnitOption('emailevents', 'TableName') . ' em
+ WHERE Event = "COMMON.FOOTER"';
+ $footer_data = $this->Conn->GetRow($sql);
+
+ $footer = $footer_data['l' . $language_id . '_Body'];
+
+ if (!$footer) {
+ $footer = $footer_data['l' . $default_language_id . '_Body'];
+ }
+
+ if ($message_type == 'text') {
+ $esender =& $this->Application->recallObject('EmailSender');
+ /* @var $esender kEmailSendingHelper */
+
+ $footer = $esender->ConvertToText($footer);
+ }
+ }
+
+ return $footer;
+ }
+
+ /**
* Parse message template and return headers (as array) and message body part
*
* @param string $message
@@ -365,15 +452,18 @@
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event_name.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
+ $object =& $this->_getEmailEvent($event);
+
+ if (!is_object($object)) {
+ // email event not found OR it's won't be send under given circumstances
+ return false;
+ }
+
// additional parameters from kApplication->EmailEvent
$send_params = $event->getEventParam('DirectSendParams');
// 1. get information about message sender and recipient
- $recipients = $this->GetMessageRecipients($event, $event_id);
- if ($recipients === false) {
- // if not valid recipients found, then don't send event
- return false;
- }
+ $recipients = $this->GetMessageRecipients($event);
list ($from_id, $to_id) = $recipients;
list ($from_email, $from_name) = $this->GetRecipientInfo($from_id, 'from', $send_params);
@@ -381,7 +471,7 @@
// 2. prepare message to be sent
$message_language = $this->_getSendLanguage($send_params);
- $message_template = $this->GetMessageBody($event_id, $message_type, $message_language);
+ $message_template = $this->GetMessageBody($event, $message_language);
if (!trim($message_template)) {
trigger_error('Message template is empty', E_USER_WARNING);
return false;
@@ -405,18 +495,18 @@
if ($this->Application->isDebugMode()) {
// set special header with event name, so it will be easier to determite what's actually was received
- $message_headers['X-Event-Name'] = $email_event_name . ' - ' . ($event->getEventParam('EmailEventType') == 1 ? 'ADMIN' : 'USER');
+ $message_headers['X-Event-Name'] = $email_event_name . ' - ' . ($event->getEventParam('EmailEventType') == EVENT_TYPE_ADMIN ? 'ADMIN' : 'USER');
}
foreach ($message_headers as $header_name => $header_value) {
$esender->SetEncodedHeader($header_name, $header_value);
}
- $esender->CreateTextHtmlPart($message_body, $message_type == 'html');
+ $esender->CreateTextHtmlPart($message_body, $object->GetDBField('MessageType') == 'html');
$event->status = $esender->Deliver() ? erSUCCESS : erFAIL;
- if ($event->status == erSUCCESS){
+ if ($event->status == erSUCCESS) {
// all keys, that are not used in email sending are written to log record
$send_keys = Array ('from_email', 'from_name', 'to_email', 'to_name', 'message');
foreach ($send_keys as $send_key) {
@@ -534,4 +624,39 @@
echo ($emails_sent / $total_emails) * 100;
}
}
+
+ /**
+ * Prefills module dropdown
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $options = Array ('Core:Users' => 'Core - Users', 'Core:Category' => 'Core - Categories');
+
+ foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
+ if (($module_name == 'In-Portal') || ($module_name == 'Core')) {
+ continue;
+ }
+
+ $options[$module_name] = $module_name;
+ }
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['Module']['options'] = $options;
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+
+ // make grid on "Email Events" tab in "Regional" section show columns of editable language, not admin language
+ $language_id = $this->Application->GetVar('lang_id');
+
+ if ($language_id) {
+ $grids = $this->Application->getUnitOption($event->Prefix, 'Grids');
+ // used by column picker to track column position
+ $grids['Default']['Fields']['Description']['formatter_renamed'] = true;
+ array_rename_key($grids['Default']['Fields'], 'Description', 'l' . $language_id . '_Description');
+ $this->Application->setUnitOption($event->Prefix, 'Grids', $grids);
+ }
+ }
}
\ No newline at end of file
Index: units/email_messages/email_message_tp.php
===================================================================
--- units/email_messages/email_message_tp.php (revision 13128)
+++ units/email_messages/email_message_tp.php (working copy)
@@ -1,71 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-
- defined('FULL_PATH') or die('restricted access!');
-
- class EmailMessageTagProcessor extends kDBTagProcessor {
-
- function PrintRecipients($params)
- {
- $recipient_type = $this->Application->RecallVar('recipient_type');
-
- $block_params = $this->prepareTagParams($params);
- $block_params['name'] = $params['render_as'];
-
- $recipients = $this->getRecipients($recipient_type);
- $recipient_count = count($recipients);
- $ret = '';
-
- foreach ($recipients as $recipient_index => $recipient_name) {
- $block_params['recipient_name'] = $recipient_name;
- $block_params['not_last'] = $recipient_index < $recipient_count - 1;
-
- $ret .= $this->Application->ParseBlock($block_params);
- }
-
- return $ret;
- }
-
- function getRecipients($prefix)
- {
- $id_field = $this->Application->getUnitOption($prefix, 'IDField');
- $table_name = $this->Application->getUnitOption($prefix, 'TableName');
- $recipient_ids = $this->Application->RecallVar('recipient_ids');
-
- $sql = 'SELECT '.($prefix == 'u' ? 'Email' : 'Name').'
- FROM '.$table_name.'
- WHERE '.$id_field.' IN ('.$recipient_ids.')';
- return $this->Conn->GetCol($sql);
- }
-
- /**
- * Removes "Enabled" column, when not in debug mode
- *
- * @param Array $params
- */
- function ModifyUnitConfig($params)
- {
- if (!$this->Application->isDebugMode()) {
- $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
-
- foreach ($grids as $grid_name => $grid_data) {
- if (array_key_exists('Enabled', $grid_data['Fields'])) {
- unset($grids[$grid_name]['Fields']['Enabled']);
- }
- }
-
- $this->Application->setUnitOption($this->Prefix, 'Grids', $grids);
- }
- }
- }
\ No newline at end of file
Index: units/email_messages/email_messages_config.php
===================================================================
--- units/email_messages/email_messages_config.php (revision 13128)
+++ units/email_messages/email_messages_config.php (working copy)
@@ -1,155 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-defined('FULL_PATH') or die('restricted access!');
-
- $config = Array (
- 'Prefix' => 'emailmessages',
- 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
- 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
- 'EventHandlerClass' => Array('class' => 'EmailMessagesEventHandler', 'file' => 'email_messages_event_handler.php', 'build_event' => 'OnBuild'),
- 'TagProcessorClass' => Array('class' => 'EmailMessageTagProcessor', 'file' => 'email_message_tp.php', 'build_event' => 'OnBuild'),
-
- 'AutoLoad' => true,
-
- 'QueryString' => Array (
- 1 => 'id',
- 2 => 'page',
- 3 => 'event',
- 4 => 'mode',
- ),
-
- 'IDField' => 'EmailMessageId',
- 'TitleField' => 'Subject',
- 'StatusField' => Array ('Enabled'),
-
- 'TitlePresets' => Array (
- 'email_messages_direct_list' => Array (
- 'prefixes' => Array ('emailmessages.st_List'), 'format' => "!la_title_EmailMessages!",
- 'toolbar_buttons' => Array ('edit', 'approve', 'decline', 'view', 'dbl-click'),
- ),
- 'email_messages_edit_direct' => Array (
- 'prefixes' => Array ('emailmessages'),
- 'new_status_labels' => Array ('emailmessages' => '!la_title_Adding_E-mail!'),
- 'edit_status_labels' => Array ('emailmessages' => '!la_title_Editing_E-mail!'),
- 'format' => '#emailmessages_status# - #emailmessages_titlefield#',
- 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit'),
- ),
- ),
-
- 'Sections' => Array (
- 'in-portal:configemail' => Array(
- 'parent' => 'in-portal:site',
- 'icon' => 'email_templates',
- 'label' => 'la_tab_E-mails',
- 'url' => Array('t' => 'languages/email_message_list', 'pass' => 'm'),
- 'permissions' => Array('view', 'edit'),
- 'priority' => 5,
- 'type' => stTREE,
- ),
- ),
-
- 'TableName' => TABLE_PREFIX.'EmailMessage',
-
- 'ListSQLs' => Array (
- '' => ' SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'Events ON '.TABLE_PREFIX.'Events.EventId = %1$s.EventId'
- ),
-
- 'ListSortings' => Array (
- '' => Array (
- 'ForcedSorting' => Array ('Enabled' => 'desc'),
- 'Sorting' => Array ('Description' => 'asc')
- ),
- ),
-
- 'ForeignKey' => 'LanguageId',
- 'ParentTableKey' => 'LanguageId',
- 'ParentPrefix' => 'lang',
- 'AutoDelete' => true,
- 'AutoClone' => true,
-
- 'CalculatedFields' => Array (
- '' => Array (
- 'Description' => TABLE_PREFIX.'Events.Description',
- 'Module' => TABLE_PREFIX.'Events.Module',
- 'Type' => TABLE_PREFIX.'Events.Type',
- 'ReplacementTags' => TABLE_PREFIX.'Events.ReplacementTags',
- 'Enabled' => TABLE_PREFIX.'Events.Enabled',
- ),
- ),
-
- 'Fields' => Array (
- 'EmailMessageId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'Template' => Array('type' => 'string', 'default' => null),
- 'MessageType' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('text'=>'la_Text','html'=>'la_Html'), 'use_phrases' => 1, 'not_null' => '1','default' => 'text'),
- 'LanguageId' => Array(
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Language ORDER BY PackName', 'option_key_field' => 'LanguageId', 'option_title_field' => 'PackName',
- 'not_null' => 1, 'default' => 0
- ),
- 'EventId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'Subject' => Array('type' => 'string', 'default' => null),
- ),
-
- 'VirtualFields' => Array (
- 'Headers' => Array('type' => 'string', 'default' => ''),
- 'Body' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => ''),
- 'ReplacementTags' => Array ('type' => 'string', 'default' => null),
- 'Description' => Array('type'=>'string', 'sql_filter_type'=>'having'),
- 'Module' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Type' => Array('formatter'=>'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1, 'default' => 0, 'not_null' => 1),
-
- 'Enabled' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
- 'not_null' => 1, 'default' => 1
- ),
-
- // for mass mail sending
- 'MassSubject' => Array ('type' => 'string', 'default' => ''),
- 'MassAttachment' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'upload_dir' => ITEM_FILES_PATH, 'max_size' => 50000000, 'default' => ''),
- 'MassHtmlMessage' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => 'Type your Message Here'),
- 'MassTextMessage' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => 'Type your Message Here'),
- ),
-
- 'Grids' => Array(
- 'Default' => Array(
-// 'Icons' => Array('default'=>'icon16_item.png'),
- 'Fields' => Array(
- 'Subject' => Array( 'title'=>'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 60, ),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 60, ),
- 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
- ),
-
- ),
-
- 'Emails' => Array(
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- 0 => 'icon16_disabled.png',
- 1 => 'icon16_item.png',
- ),
- 'Fields' => Array(
- 'EventId' => Array( 'title'=>'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
- 'Subject' => Array( 'title'=>'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 300, ),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
- 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
- 'LanguageId' => Array( 'title'=>'la_col_Language', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
- 'Enabled' => Array( 'title'=>'la_col_Enabled', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
- ),
-
- ),
- ),
- );
\ No newline at end of file
Index: units/email_messages/email_messages_event_handler.php
===================================================================
--- units/email_messages/email_messages_event_handler.php (revision 13128)
+++ units/email_messages/email_messages_event_handler.php (working copy)
@@ -1,412 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-
- defined('FULL_PATH') or die('restricted access!');
-
- class EmailMessagesEventHandler extends kDBEventHandler
- {
-
- /**
- * Replace id passed with id of email message
- *
- * @param kEvent $event
- */
- function getPassedID(&$event)
- {
- $event->setEventParam('raise_warnings', 0);
-
- $parent = parent::getPassedID($event);
- if ($parent) {
- return $parent;
- }
-
- $email_event_id = (int)$this->getEmailEventId();
- $object =& $event->getObject();
-
- $parent_info = $object->getLinkedInfo();
-
- $sql = 'SELECT '.$object->IDField.'
- FROM '.$object->TableName.'
- WHERE ('.$parent_info['ForeignKey'].' = '.$parent_info['ParentId'].') AND (EventId = '.$email_event_id.')';
-
- return (int)$this->Conn->GetOne($sql);
- }
-
- function getEmailEventId()
- {
- return parent::getPassedID( new kEvent('emailevents:OnDummy') );
- }
-
- /**
- * Apply any custom changes to list's sql query
- *
- * @param kEvent $event
- * @access protected
- * @see OnListBuild
- */
- function SetCustomQuery(&$event)
- {
- $object =& $event->getObject();
- /* @var $object kDBList */
-
- if ($event->Special == 'module') {
- $module = $this->Application->GetVar('module');
- $object->addFilter('module_filter', 'Module = ' . $this->Conn->qstr($module));
- }
-
- if (($event->Special == 'st') && !$this->Application->isDebugMode()) {
- $object->addFilter('enabled_filter', TABLE_PREFIX . 'Events.Enabled <> ' . STATUS_DISABLED);
- }
- }
-
- /**
- * If loading empty item, then set parent id
- *
- * @param kEvent $event
- */
- function OnBeforeItemLoad(&$event)
- {
- if (!$event->getEventParam('id')) {
- $this->OnNew($event);
-
- $event->status = erFATAL;
- }
- }
-
- /**
- * Sets event id
- *
- * @param kEvent $event
- */
- function OnNew(&$event)
- {
- parent::OnNew($event);
-
- $object =& $event->getObject();
- /* @var $object kDBItem */
-
- $object->SetDBField('EventId', $this->getEmailEventId());
- $object->SetDBField('Headers', $this->Application->ConfigValue('Smtp_DefaultHeaders') );
- }
-
- /**
- * Parse message template (split into header, subject & body)
- *
- * @param kEvent $event
- */
- function OnAfterItemLoad(&$event)
- {
- $object =& $event->getObject();
- /* @var $object kDBItem */
-
- $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
- /* @var $email_message_helper EmailMessageHelper */
-
- $fields_hash = $email_message_helper->parseTemplate( $object->GetDBField('Template') );
-
- $object->SetDBFieldsFromHash($fields_hash);
- }
-
- /**
- * Merge body+subject+headers into message template
- *
- * @param kEvent $event
- */
- function OnBeforeItemUpdate(&$event)
- {
- $this->parseVirtualFields($event);
- }
-
- /**
- * Merge body+subject+headers into message template
- *
- * @param kEvent $event
- */
- function OnBeforeItemCreate(&$event)
- {
- $this->parseVirtualFields($event);
- }
-
- /**
- * Enabled/disables actual email event
- *
- * @param kEvent $event
- */
- function OnAfterItemUpdate(&$event)
- {
- parent::OnAfterItemUpdate($event);
-
- $object =& $event->getObject();
- /* @var $object kDBItem */
-
- if ($object->GetDBField('Enabled') != $object->GetOriginalField('Enabled')) {
- $email_event =& $this->Application->recallObject('emailevents.-item', null, Array ('skip_autoload' => true));
- /* @var $email_event kDBItem */
-
- $email_event->Load( $object->GetDBField('EventId') );
- if ($email_event->isLoaded()) {
- $email_event->SetDBField('Enabled', $object->GetDBField('Enabled'));
- $email_event->Update();
- }
- }
- }
-
- /**
- * Merge body+subject+headers into message template
- *
- * @param kEvent $event
- */
- function parseVirtualFields(&$event)
- {
- $object =& $event->getObject();
- if( $object->GetDBField('Headers') || $object->GetDBField('Subject') || $object->GetDBField('Body') )
- {
- $ret = $object->GetDBField('Headers');
- if($ret) $ret .= "\n";
-
- $ret = $this->removeTrailingCRLF($ret);
- $ret .= 'Subject: '.$object->GetDBField('Subject')."\n\n";
- $ret .= $object->GetDBField('Body');
- $object->SetDBField('Template', $ret);
- }
- }
-
- /**
- * Remove trailing CR/LF chars from string
- *
- * @param string $string
- * @return string
- */
- function removeTrailingCRLF($string)
- {
- return preg_replace('/(\n|\r)+/',"\\1",$string);
- }
-
- /**
- * Prepares selected user(-s) or group(-s) for message sending
- *
- * @param kEvent $event
- */
- function OnPrepareMassRecipients(&$event)
- {
- $object =& $event->getObject( Array('skip_autoload' => true) );
- /* @var $object kDBItem */
-
- $object->Clear(0);
-
- $event->redirect = false;
-
- $this->Application->RemoveVar('recipient_ids');
- $this->Application->RemoveVar('recipient_type');
-
- $this->saveMassRecipients('u');
- $this->saveMassRecipients('g', 'total');
- }
-
- function saveMassRecipients($prefix, $special = '')
- {
- $recipients = $this->Application->GetVar(rtrim($prefix.'_'.$special, '_'));
- if ($recipients) {
- $this->Application->StoreVar('recipient_ids', implode(',', array_keys($recipients)));
- $this->Application->StoreVar('recipient_type', $prefix);
- }
- }
-
- /**
- * Sends mass mail
- *
- * @param kEvent $event
- */
- function OnMassMail(&$event)
- {
- $object =& $event->getObject( Array('skip_autoload' => true) );
- /* @var $object kDBItem */
-
- $object->setRequired('MassSubject', true);
-
- $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- if ($items_info) {
- list($id, $field_values) = each($items_info);
- $object->SetFieldsFromHash($field_values);
- }
-
- if (!$object->Validate()) {
- $event->redirect = false;
- $event->status = erFAIL;
- $object->setID($id);
- return ;
- }
-
- $fields_hash = $object->GetFieldValues();
- list ($fields_hash['FromEmail'], $fields_hash['FromName']) = $this->getSenderData();
-
- if ($fields_hash['MassAttachment']) {
- $field_options = $object->GetFieldOptions('MassAttachment');
- $fields_hash['MassAttachment'] = $field_options['upload_dir'].$fields_hash['MassAttachment'];
- }
-
- $this->Application->RemoveVar('email_prepare_progress');
- $this->Application->StoreVar('email_prepare_fields', serialize($fields_hash));
-
- $event->redirect = 'emails/prepare_queue';
- }
-
- /**
- * Generates email queue using progress bar
- *
- * @param kEvent $event
- * @todo Move to MailingList
- */
- function OnPrepareEmailQueue(&$event)
- {
- $prepare_count = $this->Application->ConfigValue('MailingListQueuePerStep');
- if ($prepare_count === false) {
- // 10 recipients per script run (if none defined in config)
- $prepare_count = 10;
- }
-
- $email_prepare_progress = $this->Application->RecallVar('email_prepare_progress');
- if ($email_prepare_progress === false) {
- $emails_prepared = 0;
- $total_emails = $this->getRecipientEmails(true);
- $this->Application->StoreVar('email_prepare_progress', $emails_prepared.':'.$total_emails);
- }
- else {
- list ($emails_prepared, $total_emails) = explode(':', $email_prepare_progress);
- }
-
- $recipient_emails = $this->getRecipientEmails(false, $emails_prepared.','.$prepare_count);
- $recipient_email_count = count($recipient_emails);
-
- if (!$recipient_email_count) {
- // no recipients left to prepare
- $this->finalizeQueuePreparing($fields_hash['MassAttachment']);
- }
-
- $fields_hash = unserialize($this->Application->RecallVar('email_prepare_fields'));
-
- $esender =& $this->Application->recallObject('EmailSender');
- /* @var $esender kEmailSendingHelper */
-
- // 1. set headers same for all emails
- $esender->SetFrom($fields_hash['FromEmail'], $fields_hash['FromName']);
- $esender->SetSubject($fields_hash['MassSubject']);
- $esender->SetBody($fields_hash['MassHtmlMessage'], $fields_hash['MassTextMessage']);
-
- // 2. add attachment if any
- if ($fields_hash['MassAttachment']) {
- $esender->AddAttachment(FULL_PATH.$fields_hash['MassAttachment']);
- }
-
- foreach ($recipient_emails as $recipient_email) {
- // 3. set recipient specific fields
- $esender->SetTo($recipient_email, $recipient_email);
- $esender->Deliver(null, false, false);
-
- // 4. write to log
- $log_fields_hash = Array (
- 'fromuser' => $fields_hash['FromName'],
- 'addressto' => $recipient_email,
- 'subject' => $fields_hash['MassSubject'],
- 'timestamp' => adodb_mktime(),
- 'event' => '',
- );
-
- $this->Conn->doInsert($log_fields_hash, TABLE_PREFIX.'EmailLog');
- }
-
- $emails_prepared += $recipient_email_count;
- if ($emails_prepared >= $total_emails) {
- $this->finalizeQueuePreparing($fields_hash['MassAttachment']);
- }
-
- $this->Application->StoreVar('email_prepare_progress', $emails_prepared.':'.$total_emails);
- $event->status = erSTOP;
- echo ($emails_prepared / $total_emails) * 100;
- }
-
- function finalizeQueuePreparing($attachment_file = null)
- {
- // variables from users/groups grid
- $this->Application->RemoveVar('recipient_ids');
- $this->Application->RemoveVar('recipient_type');
-
- if ($attachment_file) {
- unlink(FULL_PATH.$attachment_file);
- }
-
- // variables from email preparing process
-// $this->Application->RemoveVar('email_prepare_progress');
-// $this->Application->RemoveVar('email_prepare_fields');
-
- // variables from email delivering process (not yet executed)
- $this->Application->RemoveVar('email_queue_progress');
-
- $this->Application->Redirect($this->Application->GetVar('finish_template'));
- }
-
- function getRecipientEmails($for_counting = false, $limit = null)
- {
- $recipient_type = $this->Application->RecallVar('recipient_type');
- $recipient_ids = $this->Application->RecallVar('recipient_ids');
-
- if (!$recipient_ids) {
- return $for_counting ? 0 : Array ();
- }
-
- if ($recipient_type == 'u') {
- $sql = 'SELECT '.($for_counting ? 'COUNT(*)' : 'Email').'
- FROM '.TABLE_PREFIX.'PortalUser
- WHERE PortalUserId IN ('.$recipient_ids.')';
- }
- else {
- $sql = 'SELECT '.($for_counting ? 'COUNT(*)' : 'u.Email').'
- FROM '.TABLE_PREFIX.'UserGroup ug
- LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON ug.PortalUserId = u.PortalUserId
- WHERE ug.GroupId IN ('.$recipient_ids.')';
- }
-
- if ($for_counting) {
- return $this->Conn->GetOne($sql);
- }
-
- if (isset($limit)) {
- $sql .= ' LIMIT '.$limit;
- }
-
- return $this->Conn->GetCol($sql);
- }
-
- /**
- * Returns mass mail sender name & email
- *
- * @return Array
- */
- function getSenderData()
- {
- $user =& $this->Application->recallObject('u.current');
- /* @var $user UsersItem */
-
- if ($user->GetID() > 0) {
- $email_address = $user->GetDBField('Email');
- $name = $user->GetDBField('FirstName').' '.$user->GetDBField('LastName');
- }
- else {
- $email_address = $this->Application->ConfigValue('Smtp_AdminMailFrom');
- $name = strip_tags( $this->Application->ConfigValue('Site_Name') );
- }
-
- return Array ($email_address, $name);
- }
- }
\ No newline at end of file
Index: units/helpers/email_message_helper.php
===================================================================
--- units/helpers/email_message_helper.php (revision 13128)
+++ units/helpers/email_message_helper.php (working copy)
@@ -1,7 +1,7 @@
<?php
class EmailMessageHelper extends kHelper {
-
+
/**
* Extracts Subject, Headers, Body fields from email message translation
*
@@ -27,17 +27,51 @@
$headers[] = $line;
}
}
-
+
$ret['Headers'] = implode("\n", $headers);
$message_body = '';
while ((list($line_id,$line) = each($lines))) {
$message_body .= $line;
}
-
+
$ret['Body'] = $message_body;
-
+
return $ret;
}
-
+
+ /**
+ * Prepares email event content for language pack export
+ *
+ * @param Array $fields_hash
+ * @return string
+ */
+ function buildTemplate($fields_hash)
+ {
+ if (!implode('', $fields_hash)) {
+ return '';
+ }
+
+ $ret = array_key_exists('Headers', $fields_hash) ? $fields_hash['Headers'] : '';
+ if ($ret) {
+ $ret .= "\n";
+ }
+
+ $ret = $this->_removeTrailingCRLF($ret);
+ $ret .= 'Subject: ' . $fields_hash['Subject'] . "\n\n";
+ $ret .= $fields_hash['Body'];
+
+ return $ret;
+ }
+
+ /**
+ * Remove trailing CR/LF chars from string
+ *
+ * @param string $string
+ * @return string
+ */
+ function _removeTrailingCRLF($string)
+ {
+ return preg_replace('/(\n|\r)+/',"\\1",$string);
+ }
}
\ No newline at end of file
Index: units/helpers/language_import_helper.php
===================================================================
--- units/helpers/language_import_helper.php (revision 13128)
+++ units/helpers/language_import_helper.php (working copy)
@@ -12,6 +12,20 @@
* See http://www.in-portal.org/license for copyright notices and details.
*/
+/**
+* Language pack format version description
+*
+* v1
+* ==========
+* All language properties are separate nodes inside <LANGUAGE> node. There are
+* two more nodes PHRASES and EVENTS for phrase and email event translations.
+*
+* v2
+* ==========
+* All data, that will end up in Language table is now attributes of LANGUAGE node
+* and is name exactly as field name, that will be used to store that data.
+*/
+
defined('FULL_PATH') or die('restricted access!');
define('LANG_OVERWRITE_EXISTING', 1);
@@ -82,6 +96,13 @@
*/
var $_debugMode = false;
+ /**
+ * Latest version of language pack format. Versions are not backwards compatible!
+ *
+ * @var int
+ */
+ var $_latestVersion = 2;
+
function LanguageImportHelper()
{
parent::kHelper();
@@ -141,7 +162,7 @@
// copy data from temp tables to live
foreach ($this->_languages as $language_id) {
$this->_performUpgrade($language_id, 'phrases', 'PhraseKey');
- $this->_performUpgrade($language_id, 'emailmessages', 'EventId');
+ $this->_performUpgrade_v2($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'l%s_Body'));
}
$this->_initImportTables(true);
@@ -175,22 +196,33 @@
$lang_table = $this->Application->getUnitOption('lang','TableName');
$phrases_table = $this->Application->getUnitOption('phrases','TableName');
- $emailevents_table = $this->Application->getUnitOption('emailmessages','TableName');
- $mainevents_table = $this->Application->getUnitOption('emailevents','TableName');
+ $events_table = $this->Application->getUnitOption('emailevents','TableName');
$phrase_tpl = "\t\t\t".'<PHRASE Label="%s" Module="%s" Type="%s">%s</PHRASE>'."\n";
$event_tpl = "\t\t\t".'<EVENT MessageType="%s" Event="%s" Type="%s">%s</EVENT>'."\n";
$sql = 'SELECT * FROM %s WHERE LanguageId = %s';
- $ret = '<LANGUAGES>'."\n";
+ $ret = '<LANGUAGES Version="' . $this->_latestVersion . '">'."\n";
+
+ $export_fields = $this->_getExportFields();
+
+ $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
+ /* @var $email_message_helper EmailMessageHelper */
+
foreach ($language_ids as $language_id) {
// languages
$row = $this->Conn->GetRow( sprintf($sql, $lang_table, $language_id) );
- $ret .= "\t".'<LANGUAGE PackName="'.$row['PackName'].'" Encoding="'.$this->_exportEncoding.'"><DATEFORMAT>'.$row['DateFormat'].'</DATEFORMAT>';
- $ret .= '<TIMEFORMAT>'.$row['TimeFormat'].'</TIMEFORMAT><INPUTDATEFORMAT>'.$row['InputDateFormat'].'</INPUTDATEFORMAT>';
- $ret .= '<INPUTTIMEFORMAT>'.$row['InputTimeFormat'].'</INPUTTIMEFORMAT><DECIMAL>'.$row['DecimalPoint'].'</DECIMAL>';
- $ret .= '<THOUSANDS>'.$row['ThousandSep'].'</THOUSANDS><CHARSET>'.$row['Charset'].'</CHARSET><DOCS_URL>'.$row['UserDocsUrl'].'</DOCS_URL>';
- $ret .= '<UNITSYSTEM>'.$row['UnitSystem'].'</UNITSYSTEM>'."\n";
+ $ret .= "\t" . '<LANGUAGE Encoding="' . $this->_exportEncoding . '"';
+ foreach ($export_fields as $export_field) {
+ $ret .= ' ' . $export_field . '="' . htmlspecialchars($row[$export_field]) . '"';
+ }
+
+ $ret .= '>'."\n";
+
+ $ret .= '<REPLACEMENTS>';
+ $ret .= $this->_exportEncoding == 'base64' ? base64_encode($row['FilenameReplacements']) : '<![CDATA[' . $row['FilenameReplacements'] . ']]>';
+ $ret .= '</REPLACEMENTS>' . "\n";
+
// phrases
$phrases_sql = 'SELECT * FROM '.$phrases_table.' WHERE LanguageId = %s AND PhraseType IN (%s) AND Module IN (%s) ORDER BY Phrase';
if( in_array('In-Portal',$module_ids) ) array_push($module_ids, ''); // for old language packs
@@ -214,31 +246,29 @@
$module_sql = preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids).',');
$module_sql = substr($module_sql, 0, -4);
- $sql = 'SELECT EventId FROM '.$mainevents_table.' WHERE '.$module_sql;
- $event_ids = $this->Conn->GetCol($sql);
+ $ret .= "\t\t".'<EVENTS>'."\n";
- if($event_ids)
- {
- $ret .= "\t\t".'<EVENTS>'."\n";
- $event_sql = ' SELECT em.*
- FROM '.$emailevents_table.' em
- LEFT JOIN '.$mainevents_table.' e ON e.EventId = em.EventId
- WHERE em.LanguageId = %s AND em.EventId IN (%s)
- ORDER BY e.Event, e.Type';
- $rows = $this->Conn->Query( sprintf($event_sql,$language_id, $event_ids ? implode(',',$event_ids) : '' ) );
- foreach($rows as $row)
- {
- if (!array_key_exists($row['EventId'], $this->events_hash)) {
- // don't export existing translations of missing events
- continue;
- }
+ $event_sql = ' SELECT *
+ FROM ' . $events_table . '
+ WHERE ' . $module_sql . '
+ ORDER BY `Event`, `Type`';
+ $rows = $this->Conn->Query($event_sql);
- list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
- $data = $this->_exportEncoding == 'base64' ? base64_encode($row['Template']) : '<![CDATA['.$row['Template'].']]>';
- $ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, $data );
- }
- $ret .= "\t\t".'</EVENTS>'."\n";
+ foreach ($rows as $row) {
+ $fields_hash = Array (
+ 'Headers' => $row['Headers'],
+ 'Subject' => $row['l' . $language_id . '_Subject'],
+ 'Body' => $row['l' . $language_id . '_Body'],
+ );
+
+ $template = $email_message_helper->buildTemplate($fields_hash);
+
+ list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
+ $data = $this->_exportEncoding == 'base64' ? base64_encode($template) : '<![CDATA[' . $template . ']]>';
+ $ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, $data);
}
+ $ret .= "\t\t".'</EVENTS>'."\n";
+
$ret .= "\t".'</LANGUAGE>'."\n";
}
@@ -268,7 +298,6 @@
*/
function _performUpgrade($language_id, $prefix, $unique_field)
{
- // TODO: find a way to compare (intersect,diff) phrases in non-case sensitive way, but keeping original case in result
$live_records = $this->_getTableData($language_id, $prefix, $unique_field, false);
$temp_records = $this->_getTableData($language_id, $prefix, $unique_field, true);
@@ -308,6 +337,77 @@
}
/**
+ * Performs upgrade of given language pack part
+ *
+ * @param int $language_id
+ * @param string $prefix
+ * @param string $unique_field
+ * @param string $data_fields
+ */
+ function _performUpgrade_v2($language_id, $prefix, $unique_field, $data_fields)
+ {
+ $live_records = $this->_getTableData_v2($language_id, $prefix, $unique_field, $data_fields[0], false);
+ $temp_records = $this->_getTableData_v2($language_id, $prefix, $unique_field, $data_fields[0], true);
+
+ if (!$temp_records) {
+ // no data for given language
+ return ;
+ }
+
+ // perform insert for records, that are missing in live table
+ $to_insert = array_diff($temp_records, $live_records);
+
+ if ($to_insert) {
+ $to_insert = array_map(Array (&$this->Conn, 'qstr'), $to_insert);
+
+ $sql = 'INSERT INTO ' . $this->Application->getUnitOption($prefix, 'TableName') . '
+ SELECT *
+ FROM ' . $this->_tables[$prefix] . '
+ WHERE ' . $unique_field . ' IN (' . implode(',', $to_insert) . ')';
+ $this->Conn->Query($sql);
+ }
+
+ // perform update for records, that are present in live table
+ $to_update = array_diff($temp_records, $to_insert);
+
+ if ($to_update) {
+ $to_update = array_map(Array (&$this->Conn, 'qstr'), $to_update);
+
+ $sql = 'UPDATE ' . $this->Application->getUnitOption($prefix, 'TableName') . ' live
+ SET ';
+
+ foreach ($data_fields as $index => $data_field) {
+ $data_field = sprintf($data_field, $language_id);
+
+ $sql .= ' live.' . $data_field . ' = (
+ SELECT temp' . $index . '.' . $data_field . '
+ FROM ' . $this->_tables[$prefix] . ' temp' . $index . '
+ WHERE temp' . $index . '.' . $unique_field . ' = live.' . $unique_field . '
+ ),';
+ }
+
+ $sql = substr($sql, 0, -1); // cut last comma
+
+ $where_clause = Array (
+ // this won't make any difference, but just in case
+ $unique_field . ' IN (' . implode(',', $to_update) . ')',
+ );
+
+ if ($this->import_mode == LANG_SKIP_EXISTING) {
+ // empty OR not set
+ $data_field = sprintf($data_fields[0], $language_id);
+ $where_clause[] = '(' . $data_field . ' = "") OR (' . $data_field . ' IS NULL)';
+ }
+
+ if ($where_clause) {
+ $sql .= "\n" . 'WHERE (' . implode(') AND (', $where_clause) . ')';
+ }
+
+ $this->Conn->Query($sql);
+ }
+ }
+
+ /**
* Returns data from given table used for language pack upgrade
*
* @param int $language_id
@@ -330,6 +430,35 @@
return $this->Conn->GetCol($sql);
}
+ /**
+ * Returns data from given table used for language pack upgrade
+ *
+ * @param int $language_id
+ * @param string $prefix
+ * @param string $unique_field
+ * @param bool $temp_mode
+ * @return Array
+ */
+ function _getTableData_v2($language_id, $prefix, $unique_field, $data_field, $temp_mode = false)
+ {
+ $data_field = sprintf($data_field, $language_id);
+ $table_name = $this->Application->getUnitOption($prefix, 'TableName');
+
+ if ($temp_mode) {
+ // for temp table get only records, that have contents on given language (not empty and isset)
+ $sql = 'SELECT ' . $unique_field . '
+ FROM ' . $this->Application->GetTempName($table_name, 'prefix:' . $prefix) . '
+ WHERE (' . $data_field . ' <> "") AND (' . $data_field . ' IS NOT NULL)';
+ }
+ else {
+ // for live table get all records, no matter on what language
+ $sql = 'SELECT ' . $unique_field . '
+ FROM ' . $table_name;
+ }
+
+ return $this->Conn->GetCol($sql);
+ }
+
function _parseXML($filename)
{
if ($this->_debugMode) {
@@ -367,7 +496,7 @@
function _initImportTables($drop_only = false)
{
$this->_tables['phrases'] = $this->_prepareTempTable('phrases', $drop_only);
- $this->_tables['emailmessages'] = $this->_prepareTempTable('emailmessages', $drop_only);
+ $this->_tables['emailevents'] = $this->_prepareTempTable('emailevents', $drop_only);
}
/**
@@ -407,24 +536,56 @@
}
/**
+ * Returns language fields to be exported
+ *
+ * @return Array
+ */
+ function _getExportFields()
+ {
+ return Array (
+ 'PackName', 'LocalName', 'DateFormat', 'TimeFormat', 'InputDateFormat', 'InputTimeFormat',
+ 'DecimalPoint', 'ThousandSep', 'Charset', 'UnitSystem', 'Locale', 'UserDocsUrl'
+ );
+ }
+
+ /**
* Processes parsed XML
*
* @param kXMLNode $language_node
*/
function _processLanguages(&$language_node)
{
- $field_mapping = Array (
- 'DATEFORMAT' => 'DateFormat',
- 'TIMEFORMAT' => 'TimeFormat',
- 'INPUTDATEFORMAT' => 'InputDateFormat',
- 'INPUTTIMEFORMAT' => 'InputTimeFormat',
- 'DECIMAL' => 'DecimalPoint',
- 'THOUSANDS' => 'ThousandSep',
- 'CHARSET' => 'Charset',
- 'UNITSYSTEM' => 'UnitSystem',
- 'DOCS_URL' => 'UserDocsUrl',
- );
+ if (array_key_exists('VERSION', $language_node->Parent->Attributes)) {
+ // version present -> use it
+ $version = $language_node->Parent->Attributes['VERSION'];
+ }
+ else {
+ // version missing -> guess it
+ if (is_object($language_node->FindChild('DATEFORMAT'))) {
+ $version = 1;
+ }
+ elseif (array_key_exists('CHARSET', $language_node->Attributes)) {
+ $version = 2;
+ }
+ }
+ if ($version == 1) {
+ $field_mapping = Array (
+ 'DATEFORMAT' => 'DateFormat',
+ 'TIMEFORMAT' => 'TimeFormat',
+ 'INPUTDATEFORMAT' => 'InputDateFormat',
+ 'INPUTTIMEFORMAT' => 'InputTimeFormat',
+ 'DECIMAL' => 'DecimalPoint',
+ 'THOUSANDS' => 'ThousandSep',
+ 'CHARSET' => 'Charset',
+ 'UNITSYSTEM' => 'UnitSystem',
+ 'DOCS_URL' => 'UserDocsUrl',
+ );
+ }
+ else {
+ $export_fields = $this->_getExportFields();
+ }
+
do {
$language_id = false;
@@ -432,9 +593,19 @@
'PackName' => $language_node->Attributes['PACKNAME'],
'LocalName' => $language_node->Attributes['PACKNAME'],
'Encoding' => $language_node->Attributes['ENCODING'],
- 'Charset' => 'iso-8859-1',
+ 'Charset' => 'utf-8',
);
+ if ($version > 1) {
+ foreach ($export_fields as $export_field) {
+ $attribute_name = strtoupper($export_field);
+
+ if (array_key_exists($attribute_name, $language_node->Attributes)) {
+ $fields_hash[$export_field] = $language_node->Attributes[$attribute_name];
+ }
+ }
+ }
+
$sub_node =& $language_node->firstChild;
/* @var $sub_node kXMLNode */
@@ -468,8 +639,21 @@
}
break;
+ case 'REPLACEMENTS':
+ // added since v2
+ $replacements = $sub_node->Data;
+
+ if ($fields_hash['Encoding'] != 'plain') {
+ $replacements = base64_decode($replacements);
+ }
+
+ $fields_hash['FilenameReplacements'] = $replacements;
+ break;
+
default:
- $fields_hash[ $field_mapping[$sub_node->Name] ] = $sub_node->Data;
+ if ($version == 1) {
+ $fields_hash[ $field_mapping[$sub_node->Name] ] = $sub_node->Data;
+ }
break;
}
} while (($sub_node =& $sub_node->NextSibling()));
@@ -518,36 +702,45 @@
*/
function _processEvents(&$event_node, $language_id, $language_encoding)
{
+ static $events_added = Array ();
+
$email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
/* @var $email_message_helper EmailMessageHelper */
do {
$event_id = $this->_getEventId($event_node->Attributes['EVENT'], $event_node->Attributes['TYPE']);
if ($event_id) {
+ if ($language_encoding == 'plain') {
+ $template = rtrim($event_node->Data);
+ }
+ else {
+ $template = base64_decode($event_node->Data);
+ }
+
+ $parsed = $email_message_helper->parseTemplate($template);
+
$fields_hash = Array (
- 'LanguageId' => $language_id,
'EventId' => $event_id,
+ 'Event' => $event_node->Attributes['EVENT'],
+ 'Type' => $event_node->Attributes['TYPE'],
'MessageType' => $event_node->Attributes['MESSAGETYPE'],
+ 'l' . $language_id . '_Subject' => $parsed['Subject'],
+ 'l' . $language_id . '_Body' => $parsed['Body'],
);
- if ($language_encoding == 'plain') {
- $fields_hash['Template'] = rtrim($event_node->Data);
+ if ($parsed['Headers']) {
+ $fields_hash['Headers'] = $parsed['Headers'];
}
+
+ if (!in_array($event_id, $events_added)) {
+ $events_added[] = $event_id;
+ $this->Conn->doInsert($fields_hash, $this->_tables['emailevents']);
+ }
else {
- $fields_hash['Template'] = base64_decode($event_node->Data);
+ $this->Conn->doUpdate($fields_hash, $this->_tables['emailevents'], 'EventId = ' . $event_id);
}
-
- $parsed = $email_message_helper->parseTemplate($fields_hash['Template']);
- $fields_hash['Subject'] = $parsed['Subject'];
-
- $this->Conn->doInsert($fields_hash, $this->_tables['emailmessages'], 'INSERT', false);
}
} while (($event_node =& $event_node->NextSibling()));
-
- if ($fields_hash) {
- // at least one corresponding event declaration found by email event name+type given in translation
- $this->Conn->doInsert($fields_hash, $this->_tables['emailmessages'], 'INSERT');
- }
}
/**
Index: units/languages/languages_config.php
===================================================================
--- units/languages/languages_config.php (revision 13128)
+++ units/languages/languages_config.php (working copy)
@@ -23,51 +23,29 @@
'AutoLoad' => true,
'Hooks' => Array(
- Array(
- 'Mode' => hAFTER,
- 'Conditional' => false,
- 'HookToPrefix' => 'lang',
- 'HookToSpecial' => '',
- 'HookToEvent' => Array('OnSave'),
- 'DoPrefix' => '',
- 'DoSpecial' => '',
- 'DoEvent' => 'OnReflectMultiLingualFields',
- ),
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnUpdatePrimary',
+ ),
- Array(
- 'Mode' => hAFTER,
- 'Conditional' => false,
- 'HookToPrefix' => 'lang',
- 'HookToSpecial' => '',
- 'HookToEvent' => Array('OnPreSave'),
- 'DoPrefix' => '',
- 'DoSpecial' => '',
- 'DoEvent' => 'OnCopyLabels',
- ),
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave','OnMassDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnScheduleTopFrameReload',
+ ),
- Array(
- 'Mode' => hAFTER,
- 'Conditional' => false,
- 'HookToPrefix' => 'lang',
- 'HookToSpecial' => '*',
- 'HookToEvent' => Array('OnSave'),
- 'DoPrefix' => '',
- 'DoSpecial' => '',
- 'DoEvent' => 'OnUpdatePrimary',
- ),
-
- Array(
- 'Mode' => hAFTER,
- 'Conditional' => false,
- 'HookToPrefix' => 'lang',
- 'HookToSpecial' => '*',
- 'HookToEvent' => Array('OnSave','OnMassDelete'),
- 'DoPrefix' => '',
- 'DoSpecial' => '',
- 'DoEvent' => 'OnScheduleTopFrameReload',
- ),
-
- ),
+ ),
'QueryString' => Array(
1 => 'id',
2 => 'page',
@@ -116,9 +94,8 @@
'edit_status_labels' => Array('emailevents' => '!la_title_Editing_EmailEvent!'),
'format' => '#emailevents_status# - #emailevents_titlefield#'),
- 'email_messages_edit' => Array( 'prefixes' => Array('lang','emailmessages'),
- 'new_titlefield' => Array('emailmessages' => ''),
- 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailmessages_titlefield#'"),
+ 'email_messages_edit' => Array( 'prefixes' => Array('lang','emailevents'),
+ 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailevents_titlefield#'"),
// for separate language list
'languages_list_st' => Array ('prefixes' => Array ('lang_List'), 'format' => "!la_title_LanguagesManagement!"),
@@ -159,7 +136,7 @@
),
'TableName' => TABLE_PREFIX.'Language',
- 'SubItems' => Array('phrases','emailmessages'),
+ 'SubItems' => Array('phrases',/*'emailmessages'*/),
'FilterMenu' => Array(
'Groups' => Array(
Index: units/languages/languages_event_handler.php
===================================================================
--- units/languages/languages_event_handler.php (revision 13128)
+++ units/languages/languages_event_handler.php (working copy)
@@ -173,43 +173,38 @@
*
* @param kEvent $event
*/
- function OnCopyLabels(&$event)
+ function OnAfterItemCreate(&$event)
{
+ parent::OnAfterItemCreate($event);
+
$object =& $event->getObject();
- $from_lang_id = $object->GetDBField('CopyFromLanguage');
+ /* @var $object kDBItem */
- if( ($event->MasterEvent->status == erSUCCESS) && $object->GetDBField('CopyLabels') == 1 && ($from_lang_id > 0) )
- {
- $lang_id = $object->GetID();
+ $src_language = $object->GetDBField('CopyFromLanguage');
- // 1. phrases import
- $phrases_live = $this->Application->getUnitOption('phrases','TableName');
- $phrases_temp = $this->Application->GetTempName($phrases_live, 'prefix:phrases');
- $sql = 'INSERT INTO '.$phrases_temp.'
- SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.', '.adodb_mktime().', "", Module
- FROM '.$phrases_live.'
- WHERE LanguageId='.$from_lang_id;
- $this->Conn->Query($sql);
+ if ($object->GetDBField('CopyLabels') && $src_language) {
+ $dst_language = $object->GetID();
- // 2. events import
- $em_table_live = $this->Application->getUnitOption('emailmessages','TableName');
- $em_table_temp = $this->Application->GetTempName($em_table_live, 'prefix:emailmessages');
+ // 1. schedule data copy after OnSave event is executed
+ $var_name = $event->getPrefixSpecial() . '_copy_data' . $this->Application->GetVar('m_wid');
+ $pending_actions = $this->Application->RecallVar($var_name, Array ());
- $sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id;
- $email_messages = $this->Conn->Query($sql);
- if($email_messages)
- {
- $id = $this->Conn->GetOne('SELECT MIN(EmailMessageId) FROM '.$em_table_live);
- if($id > 0) $id = 0;
- $id--;
+ if ($pending_actions) {
+ $pending_actions = unserialize($pending_actions);
+ }
- $sqls = Array();
- foreach($email_messages as $email_message)
- {
- $sqls[] = $id.','.$this->Conn->qstr($email_message['Template']).','.$this->Conn->qstr($email_message['MessageType']).','.$lang_id.','.$email_message['EventId'];
- $id--;
- }
- $sql = 'INSERT INTO '.$em_table_temp.'(EmailMessageId,Template,MessageType,LanguageId,EventId) VALUES ('.implode('),(',$sqls).')';
+ $pending_actions[$src_language] = $dst_language;
+ $this->Application->StoreVar($var_name, serialize($pending_actions));
+
+ if ($object->IsTempTable()) {
+ // 2. phrases import
+ $phrases_live = $this->Application->getUnitOption('phrases','TableName');
+ $phrases_temp = $this->Application->GetTempName($phrases_live, 'prefix:phrases');
+
+ $sql = 'INSERT INTO ' . $phrases_temp . '(Phrase, PhraseKey, Translation, PhraseType, PhraseId, LanguageId, LastChanged, LastChangeIP, Module)
+ SELECT Phrase, PhraseKey, Translation, PhraseType, 0-PhraseId, ' . $dst_language . ', ' . adodb_mktime() . ', "", Module
+ FROM ' . $phrases_live . '
+ WHERE LanguageId = ' . $src_language;
$this->Conn->Query($sql);
}
@@ -218,6 +213,51 @@
}
/**
+ * Saves language from temp table to live
+ *
+ * @param kEvent $event
+ */
+ function OnSave(&$event)
+ {
+ parent::OnSave($event);
+
+ if ($event->status != erSUCCESS) {
+ return ;
+ }
+
+ $var_name = $event->getPrefixSpecial() . '_copy_data' . $this->Application->GetVar('m_wid');
+ $pending_actions = $this->Application->RecallVar($var_name, Array ());
+
+ if ($pending_actions) {
+ $pending_actions = unserialize($pending_actions);
+ }
+
+ // create multilingual columns for phrases & email events table first (actual for 6+ language)
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+// $ml_helper->createFields('phrases');
+ $ml_helper->createFields('emailevents');
+
+ foreach ($pending_actions as $src_language => $dst_language) {
+ // phrases import
+ /*$sql = 'UPDATE ' . $this->Application->getUnitOption('phrases', 'TableName') . '
+ SET l' . $dst_language . '_Translation = l' . $src_language . '_Translation';
+ $this->Conn->Query($sql);*/
+
+ // events import
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('emailevents', 'TableName') . '
+ SET
+ l' . $dst_language . '_Subject = l' . $src_language . '_Subject,
+ l' . $dst_language . '_Body = l' . $src_language . '_Body,
+ l' . $dst_language . '_Description = l' . $src_language . '_Description';
+ $this->Conn->Query($sql);
+ }
+
+ $this->Application->RemoveVar($var_name);
+
+ $event->CallSubEvent('OnReflectMultiLingualFields');
+ }
+
+ /**
* Prepare temp tables for creating new item
* but does not create it. Actual create is
* done in OnPreSaveCreated
@@ -425,6 +465,27 @@
}
/**
+ * Deletes phrases and email events on given language
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $fields_hash = Array (
+ 'l' . $object->GetID() . '_Subject' => NULL,
+ 'l' . $object->GetID() . '_Body' => NULL,
+ 'l' . $object->GetID() . '_Description' => NULL,
+ );
+
+ $this->Conn->doUpdate($fields_hash, $this->Application->getUnitOption('emailevents', 'TableName'), 1);
+ }
+
+ /**
* Copy missing phrases across all system languages (starting from primary)
*
* @param kEvent $event
language_refactoring_phrases_modules.patch [^] (79,649 bytes) 2010-01-30 11:19
[Show Content]
Index: in-auction/install/install_data.sql
===================================================================
--- in-auction/install/install_data.sql (revision 13135)
+++ in-auction/install/install_data.sql (working copy)
@@ -1815,10 +1815,10 @@
INSERT INTO eBayStoreCategories VALUES (1, 0, 'Other');
INSERT INTO eBayListingDetailTemplates VALUES (1, 'Default Details Template', 'Product Name: <inp2:p_Field name="Title"/>\r\nProduct Description: <inp2:p_Field name="Description"/>\r\nProduct Retail Price: <inp2:p_Field name="MSRP"/>\r\nProduct Features: <inp2:p_Field name="cust_Features"/>\r\n');
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYORDER.CREATE', NULL, 1, 0, NULL, 'In-Auction', 'eBay order created', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'EBAYFEEDBACKNOTRECEIVED.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay feedback not received', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'EBAYORDER.CREATE', NULL, 1, 0, NULL, 'In-Auction', 'eBay order created', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'EBAYNOTPAID.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay item not paid', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'EBAYFEEDBACKNOTRECEIVED.NOTIFY', NULL, 1, 0, NULL, 'In-Auction', 'eBay feedback not received', 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:setting_folder.view', 11, 1, 1, 0);
Index: in-bulletin/install/install_data.sql
===================================================================
--- in-bulletin/install/install_data.sql (revision 13136)
+++ in-bulletin/install/install_data.sql (working copy)
@@ -112,19 +112,19 @@
UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif');
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'Approve Topic', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Added', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Modified', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'Post Added', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'New Private Message', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Add Pending Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Modify Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'Topic Modifications Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'Approve Topic', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'Post Modified', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'Post Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'New Private Message', 0);
INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
Index: in-commerce/install/install_data.sql
===================================================================
--- in-commerce/install/install_data.sql (revision 13137)
+++ in-commerce/install/install_data.sql (working copy)
@@ -325,33 +325,33 @@
INSERT INTO CustomField 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 CustomField 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 Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, NULL, 'In-Commerce', 'Order Approved', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, NULL, 'In-Commerce', 'Order Denied', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, NULL, 'In-Commerce', 'Order Shipped', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, NULL, 'In-Commerce', 'Back-order is Fulfilled', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, NULL, 'In-Commerce', 'Backorder Processed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, NULL, 'In-Commerce', 'Suggest product to a friend', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, NULL, 'In-Commerce', 'Suggest product to a friend', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, NULL, 'In-Commerce', 'Order Submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, NULL, 'In-Commerce', 'Order Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, NULL, 'In-Commerce', 'Order Denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, NULL, 'In-Commerce', 'Order Shipped', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, NULL, 'In-Commerce', 'Backorder Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, NULL, 'In-Commerce', 'Back-order is Fulfilled', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, NULL, 'In-Commerce', 'Backorder Processed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, NULL, 'In-Commerce', 'Suggest product to a friend', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, NULL, 'In-Commerce', 'Suggest product to a friend', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, NULL, 'In-Commerce', 'Affiliate registered', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment issued', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration approved', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, NULL, 'In-Commerce', 'Affiliate registration denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, NULL, 'In-Commerce', 'Affiliate payment type changed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Processed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, NULL, 'In-Commerce', 'Recurring Order Denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, NULL, 'In-Commerce', 'Gift Certificate', 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: in-commerce/units/addresses/addresses_config.php
===================================================================
--- in-commerce/units/addresses/addresses_config.php (revision 13128)
+++ in-commerce/units/addresses/addresses_config.php (working copy)
@@ -85,38 +85,40 @@
'ListSortings' => Array('' => Array('Sorting' => Array('IsProfileAddress' => 'desc')) ),
- 'Fields' => Array(
- 'AddressId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'PortalUserId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
- 'To' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
- 'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Phone' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
- 'Fax' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Email' => Array('type' => 'string','formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i','not_null' => '1','default' => ''),
- 'Address1' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
- 'Address2' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'City' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
- 'State' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter',
- 'options' => Array(),
- 'option_key_field'=>'DestAbbr', 'option_title_field'=>'Translation',
- 'not_null' => '1', 'default' => ''),
+ 'Fields' => Array(
+ 'AddressId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PortalUserId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
+ 'To' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Phone' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Fax' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Email' => Array('type' => 'string','formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i','not_null' => '1','default' => ''),
+ 'Address1' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Address2' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'City' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'State' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array(),
+ 'not_null' => '1', 'default' => ''
+ ),
- 'Zip' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
- 'Country' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter',
- 'options_sql' => ' SELECT %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType = 1 AND LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field' => 'DestAbbr', 'option_title_field' => 'Translation',
- 'not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Zip' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Country' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation',
+ 'not_null' => '1', 'required' => 1, 'default' => ''
+ ),
- 'LastUsedAsBilling' => Array('type' => 'int','not_null' => 1, 'default' => 0),
- 'LastUsedAsShipping' => Array('type' => 'int','not_null' => 1, 'default' => 0),
- 'IsProfileAddress' => Array('type' => 'int','not_null' => 1, 'default' => 0),
- ),
+ 'LastUsedAsBilling' => Array('type' => 'int','not_null' => 1, 'default' => 0),
+ 'LastUsedAsShipping' => Array('type' => 'int','not_null' => 1, 'default' => 0),
+ 'IsProfileAddress' => Array('type' => 'int','not_null' => 1, 'default' => 0),
+ ),
'VirtualFields' => Array(
'ShortAddress' => Array('type'=>'string'),
Index: in-commerce/units/currencies/currencies_config.php
===================================================================
--- in-commerce/units/currencies/currencies_config.php (revision 13128)
+++ in-commerce/units/currencies/currencies_config.php (working copy)
@@ -82,19 +82,17 @@
'SubItems' => Array (),
- 'ListSQLs' => Array ( ''=> 'SELECT %1$s.*,
- phr.Translation
- FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'Phrase phr ON
- %1$s.Name = phr.Phrase'),
- // key - special, value - list select sql
- 'ItemSQLs' => Array ( ''=> 'SELECT * FROM %s'),
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase phr ON %1$s.Name = phr.Phrase'
+ ),
- 'CalculatedFields' => Array (
- '' => Array (
- 'Translation' => 'phr.Translation',
- ),
- ),
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Translation' => 'phr.l%4$s_Translation',
+ ),
+ ),
'ListSortings' => Array (
'' => Array (
@@ -116,9 +114,10 @@
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
- 'VirtualFields' => Array (
- 'Translation' => Array ('type' => 'string'),
- ),
+ 'VirtualFields' => Array (
+ 'Translation' => Array ('type' => 'string', 'default' => ''),
+ ),
+
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
Index: in-commerce/units/currencies/currencies_event_handler.php
===================================================================
--- in-commerce/units/currencies/currencies_event_handler.php (revision 13128)
+++ in-commerce/units/currencies/currencies_event_handler.php (working copy)
@@ -87,10 +87,7 @@
{
$object =& $event->getObject();
- $object->addFilter('current_lang', 'phr.LanguageId = '.$this->Application->GetVar('m_lang'));
-
- if($event->Special == 'active')
- {
+ if ($event->Special == 'active') {
$object =& $event->getObject();
$object->addFilter('status_filter', '%1$s.Status = 1');
}
@@ -213,4 +210,24 @@
{
$this->Application->StoreVar('curr_iso', $this->Application->GetVar('curr_iso'));
}
+
+ /**
+ * Changes default module to custom (when available)
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ // make sure, that currency Translation is on current language
+ $language_id = $this->Application->GetVar('m_lang');
+ $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields');
+
+ foreach ($calculated_fields[''] as $field_name => $field_expression) {
+ $calculated_fields[''][$field_name] = str_replace('%4$s', $language_id, $field_expression);
+ }
+
+ $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields);
+ }
}
\ No newline at end of file
Index: in-commerce/units/gift_certificates/gift_certificates_config.php
===================================================================
--- in-commerce/units/gift_certificates/gift_certificates_config.php (revision 13128)
+++ in-commerce/units/gift_certificates/gift_certificates_config.php (working copy)
@@ -107,19 +107,18 @@
'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 %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType=1
- AND
- LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => 'USA', 'required'=>1
+ 'RecipientCountry' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation',
+ 'not_null' => 1, 'required' => 1, 'default' => 'USA'
),
+
'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')),
Index: in-commerce/units/manufacturers/manufacturers_config.php
===================================================================
--- in-commerce/units/manufacturers/manufacturers_config.php (revision 13128)
+++ in-commerce/units/manufacturers/manufacturers_config.php (working copy)
@@ -105,19 +105,22 @@
'Address1' => Array('type' => 'string','default' => null),
'Address2' => Array('type' => 'string', 'default' => null),
'City' => Array('type' => 'string','default' => null),
- 'State' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array(), 'option_key_field' => 'DestAbbr', 'option_title_field' => 'Translation', 'default' => null),
+ 'State' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array(),
+ 'default' => null
+ ),
'Zip' => Array('type' => 'string', 'default' => null),
- 'Country' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options_sql'=>'SELECT %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType=1
- AND
- LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation', 'default' => null),
+ 'Country' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation', 'default' => null
+ ),
),
'Grids' => Array (
Index: in-commerce/units/orders/orders_config.php
===================================================================
--- in-commerce/units/orders/orders_config.php (revision 13128)
+++ in-commerce/units/orders/orders_config.php (working copy)
@@ -323,23 +323,23 @@
'BillingAddress1' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingAddress2' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingCity' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'BillingState' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options' => Array(),
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => ''),
+ 'BillingState' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array(),
+ 'not_null' => 1, 'default' => ''
+ ),
'BillingZip' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'BillingCountry' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options_sql'=>'SELECT %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType=1
- AND
- LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => 'USA'),
+ 'BillingCountry' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation',
+ 'not_null' => 1, 'default' => 'USA'
+ ),
'VAT' => Array('type' => 'float','formatter'=>'kFormatter','not_null'=>1,'default' => '0','format'=>'%01.2f'),
'VATPercent' => Array('type' => 'float','formatter'=>'kFormatter','not_null'=>1,'default' => '0','format'=>'%01.3f'),
'PaymentType' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter','options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PaymentTypes WHERE Status = 1', 'option_key_field'=>'PaymentTypeId','option_title_field'=>'Description', 'not_null' => 1, 'default' => 0),
@@ -356,23 +356,22 @@
'ShippingAddress1' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingAddress2' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingCity' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'ShippingState' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options' => Array(),
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => ''),
+ 'ShippingState' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array(),
+ 'not_null' => 1, 'default' => ''
+ ),
'ShippingZip' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'ShippingCountry' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options_sql'=>'SELECT %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType=1
- AND
- LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => 'USA'),
+ 'ShippingCountry' => Array(
+ 'type' => 'string', 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation',
+ 'not_null' => 1, 'default' => 'USA'
+ ),
'ShippingType' => Array('type' => 'int','formatter'=>'kOptionsFormatter','options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'ShippingType WHERE Status = 1','option_key_field'=>'ShippingID','option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
'ShippingCost' => Array('type' => 'double','formatter'=>'kFormatter','format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'ShippingCustomerAccount' => Array('type' => 'string','not_null' => '1','default' => ''),
Index: in-commerce/units/taxes/taxes_tag_processor.php
===================================================================
--- in-commerce/units/taxes/taxes_tag_processor.php (revision 13128)
+++ in-commerce/units/taxes/taxes_tag_processor.php (working copy)
@@ -269,31 +269,24 @@
switch ($param['show']){
case 'current':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND zd.TaxZoneId='.$zone->GetDBField('TaxZoneId').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND zd.TaxZoneId = '.$zone->GetDBField('TaxZoneId').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'available':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND zd.TaxZoneId IS NULL
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND zd.TaxZoneId IS NULL
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
- case 'all':
+ case 'all':
$selected_country = $this->Application->GetVar('CountrySelector');
if (!$selected_country){
// get 1st available country ID
@@ -304,14 +297,13 @@
}
}
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'has_states':
$has_states = $this->Conn->GetCol('SELECT DISTINCT DestParentId FROM '.TABLE_PREFIX.'StdDestinations sd
WHERE sd.DestType=2');
@@ -338,15 +330,11 @@
}
}
-
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND DestId IN ('.implode(',', $has_states).')
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND DestId IN ('.implode(',', $has_states).')
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
}
@@ -369,8 +357,8 @@
}
- function ShowStates($param){
-
+ function ShowStates($param)
+ {
$param = $this->prepareTagParams($param);
$param['name'] = $param['block'];
@@ -379,41 +367,35 @@
switch ($param['show']){
case 'current':
- $sql = 'SELECT * FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- AND zd.TaxZoneId='.$zone->GetDBField('TaxZoneId').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE
+ sd.DestType=2
+ AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ AND zd.TaxZoneId='.$zone->GetDBField('TaxZoneId').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
- case 'available':
- $sql = 'SELECT * FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND zd.TaxZoneId IS NULL
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- ORDER BY Translation
- ';
+ case 'available':
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE
+ sd.DestType=2
+ AND zd.TaxZoneId IS NULL
+ AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'all':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 2 AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
}
Index: in-commerce/units/zones/zones_tag_processor.php
===================================================================
--- in-commerce/units/zones/zones_tag_processor.php (revision 13128)
+++ in-commerce/units/zones/zones_tag_processor.php (working copy)
@@ -258,31 +258,24 @@
$selected_country = Array(); // this prevents 241 warnings to me raised :D
switch ($param['show']){
case 'current':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND zd.ShippingZoneId='.$zone->GetDBField('ZoneID').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND zd.ShippingZoneId='.$zone->GetDBField('ZoneID').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'available':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND zd.ShippingZoneId IS NULL
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND zd.ShippingZoneId IS NULL
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
- case 'all':
+ case 'all':
$selected_country = $this->Application->GetVar('CountrySelector');
if (!$selected_country){
// get 1st available country ID
@@ -293,14 +286,13 @@
}
}
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'has_states':
$has_states = $this->Conn->GetCol('SELECT DISTINCT DestParentId FROM '.TABLE_PREFIX.'StdDestinations sd
WHERE sd.DestType=2');
@@ -328,14 +320,11 @@
}
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=1
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND DestId IN ('.implode(',', $has_states).')
- ORDER BY Translation
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 1 AND DestId IN ('.implode(',', $has_states).')
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
}
@@ -368,41 +357,35 @@
switch ($param['show']){
case 'current':
- $sql = 'SELECT * FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- AND zd.ShippingZoneId='.$zone->GetDBField('ZoneID').'
- ORDER BY Translation
- ';
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE
+ sd.DestType=2
+ AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ AND zd.ShippingZoneId='.$zone->GetDBField('ZoneID').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
- case 'available':
- $sql = 'SELECT * FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.$destination->TableName.' zd
- ON zd.StdDestId = sd.DestId
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND zd.ShippingZoneId IS NULL
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- ORDER BY Translation
- ';
+ case 'available':
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.$destination->TableName.' zd ON zd.StdDestId = sd.DestId
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE
+ sd.DestType=2
+ AND zd.ShippingZoneId IS NULL
+ AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
+
case 'all':
- $sql = 'SELECT sd.* FROM '.TABLE_PREFIX.'StdDestinations sd
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
- WHERE sd.DestType=2
- AND LanguageId='.$this->Application->GetVar('lang.current_id').'
- AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
- ORDER BY Translations
- ';
+ $sql = 'SELECT sd.*
+ FROM '.TABLE_PREFIX.'StdDestinations sd
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = sd.DestName
+ WHERE sd.DestType = 2 AND sd.DestParentId='.$this->Application->GetVar('CountrySelector').'
+ ORDER BY l' . $this->Application->GetVar('lang.current_id') . '_Translation';
break;
}
Index: in-link/install/install_data.sql
===================================================================
--- in-link/install/install_data.sql (revision 13138)
+++ in-link/install/install_data.sql (working copy)
@@ -118,46 +118,46 @@
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_EnableLinkContactForm', 1, 'In-Link', 'in-link:configuration_output');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ReciprocalLinkChecking', '0', 'In-Link', 'in-link:configuration_output');
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, NULL, 'In-Link', 'Add Link', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, NULL, 'In-Link', 'Add Link', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Add Pending Link', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Add Pending Link', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, NULL, 'In-Link', 'Modify Link', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, NULL, 'In-Link', 'Modify Link', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Modification Pending', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Link Modification Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Link Modification', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, NULL, 'In-Link', 'Decline link modification', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Pending Link', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, NULL, 'In-Link', 'Deny Link', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, NULL, 'In-Link', 'Link Comment Added', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Added', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Approved', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Declined', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement approved', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement approved', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement denied', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement denied', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement extended', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement extended', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Reciprocal Check Failed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, NULL, 'In-Link', 'Link Validation Results', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, NULL, 'In-Link', 'Add Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, NULL, 'In-Link', 'Add Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Add Pending Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Add Pending Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, NULL, 'In-Link', 'Modify Link', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, NULL, 'In-Link', 'Modify Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Modification Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Link', 'Link Modification Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Link Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, NULL, 'In-Link', 'Decline link modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Approve Pending Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, NULL, 'In-Link', 'Deny Link', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, NULL, 'In-Link', 'Link Comment Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link Comment Declined', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement approved', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement denied', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement denied', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement expired', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal submitted', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, NULL, 'In-Link', 'Link enhancement extended', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement extended', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement renewal failed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement cancelled', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'Link enhancement is about to expire', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'Link Contact Form', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, NULL, 'In-Link', 'Reciprocal Check Failed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, NULL, 'In-Link', 'Link Validation Results', 1);
INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkAddress', 'lu_fld_LinkAddress', 0, 'la_section_BusinessLocation', 'la_fld_LinkAddress', 'text', 'size="40"', '', 1, 1, 0, 0);
INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkCity', 'lu_fld_LinkCity', 0, 'la_section_BusinessLocation', 'la_fld_LinkCity', 'text', 'size="40"', '', 2, 1, 0, 0);
Index: in-news/install/install_data.sql
===================================================================
--- in-news/install/install_data.sql (revision 13139)
+++ in-news/install/install_data.sql (working copy)
@@ -91,24 +91,24 @@
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'n_MaxCategories', '3', 'In-News', 'in-news:configuration_output');
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 1, NULL, 'In-News', 'Add Article', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 0, NULL, 'In-News', 'Add Article', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Add Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Add Pending', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 1, NULL, 'In-News', 'Modify Article', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 0, NULL, 'In-News', 'Modify Article', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Modify Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Modify Pending', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article Modification', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article Modification', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 1, NULL, 'In-News', 'Article Comment Added', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 0, NULL, 'In-News', 'Article Comment Added', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Article Comment Approved', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.DENY', NULL, 1, 0, NULL, 'In-News', 'Article Comment Declined', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 1, NULL, 'In-News', 'Add Article', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.ADD', NULL, 1, 0, NULL, 'In-News', 'Add Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Add Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Add Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 1, NULL, 'In-News', 'Modify Article', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY', NULL, 1, 0, NULL, 'In-News', 'Modify Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-News', 'Article Modify Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Modify Pending', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.MODIFY.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article Modification', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Approve Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.DENY', NULL, 1, 0, NULL, 'In-News', 'Decline Article', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 1, NULL, 'In-News', 'Article Comment Added', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD', NULL, 1, 0, NULL, 'In-News', 'Article Comment Added', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-News', 'Article Comment Approved', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.DENY', NULL, 1, 0, NULL, 'In-News', 'Article Comment Declined', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'Article Comment Pending', 0);
INSERT INTO ItemTypes VALUES (2, 'In-News', 'n', 'News', 'Title', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_News', 1, 'in-news/admin/addarticle.php', 'clsNews', 'Article');
language_refactoring_phrases_core.patch [^] (86,402 bytes) 2010-01-30 11:38
[Show Content]
Index: core/admin_templates/languages/email_message_edit.tpl
===================================================================
--- core/admin_templates/languages/email_message_edit.tpl (revision 13140)
+++ core/admin_templates/languages/email_message_edit.tpl (working copy)
@@ -45,8 +45,8 @@
<inp2:m_RenderElement name="subsection" prefix="emailevents" fields="EventId,Event,Subject,Enabled,FrontEndOnly,FromUserId,Module,Description,Type,MessageType,Headers" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_id_label" prefix="emailevents" field="EventId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="emailevents" field="Event" title="la_fld_Event"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="emailevents" field="Subject" title="la_fld_Subject"/>
- <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="Description" title="la_fld_Description" control_options="{max_height: 50}"/>
+ <inp2:m_RenderElement name="inp_edit_box_ml" prefix="emailevents" field="Subject" format="no_default" title="la_fld_Subject"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailevents" field="Description" title="la_fld_Description" control_options="{max_height: 50}"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="emailevents" field="Headers" title="la_fld_ExtraHeaders" control_options="{max_height: 50}"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="emailevents" field="Enabled" title="la_fld_Enabled"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="emailevents" field="FrontEndOnly" title="la_fld_FrontEndOnly"/>
@@ -56,8 +56,8 @@
<inp2:m_RenderElement name="inp_edit_radio" prefix="emailevents" field="MessageType" title="la_fld_MessageType"/>
<inp2:m_RenderElement name="subsection" prefix="emailevents" fields="Body" title="!la_section_Message!"/>
- <inp2:m_RenderElement name="inp_edit_fck" prefix="emailevents" field="Body" title="la_fld_MessageBody" rows="5" cols="60" control_options="{min_height: 200}"/>
- <!-- <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="Body" title="la_fld_MessageBody" control_options="{min_height: 200}"/> -->
+ <inp2:m_RenderElement name="inp_edit_fck" prefix="emailevents" field="Body" format="no_default" title="la_fld_MessageBody" rows="5" cols="60" control_options="{min_height: 200}"/>
+ <!-- <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="emailevents" field="Body" format="no_default" title="la_fld_MessageBody" control_options="{min_height: 200}"/> -->
<inp2:m_RenderElement name="inp_edit_filler" control_options="{max_height: 8}"/>
</table>
</div>
Index: core/admin_templates/languages/phrase_edit.tpl
===================================================================
--- core/admin_templates/languages/phrase_edit.tpl (revision 13128)
+++ core/admin_templates/languages/phrase_edit.tpl (working copy)
@@ -53,6 +53,10 @@
<inp2:m_RenderElement name="edit_navigation" prefix="phrases"/>
</script>
</td>
+
+ <inp2:m_ifnot check="m_Get" name="simple_mode">
+ <inp2:m_RenderElement name="ml_selector" prefix="phrases"/>
+ </inp2:m_ifnot>
</tr>
</tbody>
</table>
@@ -63,29 +67,21 @@
<input type="hidden" name="simple_mode" value="<inp2:m_Get name='simple_mode'/>"/>
<input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_Get name='phrases_label'/>"/>
-<inp2:m_if check="phrases_ShowHiddenLanguage">
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="phrases" field="LanguageId" db="db"/>
-</inp2:m_if>
-
<inp2:m_if check="m_Get" name="simple_mode">
<inp2:m_RenderElement name="inp_edit_hidden" prefix="phrases" field="Phrase"/>
</inp2:m_if>
<inp2:m_DefineElement name="phrase_element">
<inp2:m_if check="m_Get" name="simple_mode">
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_else/>
<tr class="subsectiontitle">
<td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
</tr>
- <inp2:m_if check="m_Get" name="phrases_label">
- <inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="LanguageId" title="la_fld_LanguageId" has_empty="1"/>
- </inp2:m_if>
-
<inp2:m_RenderElement name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
Index: core/admin_templates/languages/phrase_list.tpl
===================================================================
--- core/admin_templates/languages/phrase_list.tpl (revision 13128)
+++ core/admin_templates/languages/phrase_list.tpl (working copy)
@@ -1,5 +1,5 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:phrases" pagination="1" grid="Phrases" prefix="phrases.st" title_preset="phrases_list_st"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:phrases" pagination="1" grid="Phrases" prefix="phrases" title_preset="phrases_list_st" additional_blue_bar_render_as="grid_ml_selector"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -10,20 +10,14 @@
//do not rename - this function is used in default grid for double click!
function edit()
{
- set_hidden_field('remove_specials[phrases.st]', 1);
- std_edit_item('phrases.st', 'languages/phrase_edit');
+ Application.SetVar('m_lang', '<inp2:m_Get name="m_lang"/>');
+ std_edit_item('phrases', 'languages/phrase_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewPhrase" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
- var $phrase = prompt('Enter Phrase name:', '');
- if (!$phrase) {
- return ;
- }
-
- $url_mask = '<inp2:m_Link template="regional/phrases_edit" m_opener="d" phrases_label="#PHRASE_NAME#" phrases_event="OnNew" pass="all,phrases" js_escape="1" no_amp="1"/>';
- direct_edit('phrases', $url_mask.replace('#PHRASE_NAME#', $phrase));
+ std_precreate_item('phrases', 'languages/phrase_edit');
}
)
);
@@ -31,7 +25,7 @@
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
- std_delete_items('phrases.st')
+ std_delete_items('phrases')
} ) );
@@ -45,14 +39,14 @@
a_toolbar.Render();
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="phrases.st" grid="Phrases"/>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="phrases" grid="Phrases"/>
</tr>
</tbody>
</table>
-<inp2:m_RenderElement name="grid" PrefixSpecial="phrases.st" IdField="PhraseId" grid="Phrases" menu_filters="yes"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="phrases" IdField="PhraseId" grid="Phrases" menu_filters="yes"/>
<script type="text/javascript">
- Grids['phrases.st'].SetDependantToolbarButtons( new Array('edit','delete','primary_language','export_language') );
+ Grids['phrases'].SetDependantToolbarButtons( new Array('edit','delete','primary_language','export_language') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/admin_templates/regional/email_messages_edit.tpl
===================================================================
--- core/admin_templates/regional/email_messages_edit.tpl (revision 13140)
+++ core/admin_templates/regional/email_messages_edit.tpl (working copy)
@@ -30,6 +30,7 @@
<inp2:emailevents_SaveWarning name="grid_save_warning"/>
<inp2:emailevents_ErrorWarning name="form_error_warning"/>
+<input type="hidden" name="regional" value="<inp2:m_Get name='regional'/>"/>
<div id="scroll_container">
<table class="edit-form">
Index: core/admin_templates/regional/languages_edit_email_events.tpl
===================================================================
--- core/admin_templates/regional/languages_edit_email_events.tpl (revision 13128)
+++ core/admin_templates/regional/languages_edit_email_events.tpl (working copy)
@@ -12,6 +12,7 @@
function edit()
{
+ Application.SetVar('regional', 1);
std_edit_temp_item('emailevents', 'regional/email_messages_edit');
}
Index: core/admin_templates/regional/languages_edit_phrases.tpl
===================================================================
--- core/admin_templates/regional/languages_edit_phrases.tpl (revision 13128)
+++ core/admin_templates/regional/languages_edit_phrases.tpl (working copy)
@@ -12,6 +12,7 @@
function edit()
{
+ Application.SetVar('regional', 1);
std_edit_temp_item('phrases', 'regional/phrases_edit');
}
@@ -40,6 +41,7 @@
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewLabel" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
+ Application.SetVar('regional', 1);
std_new_item('phrases', 'regional/phrases_edit')
} ) );
Index: core/admin_templates/regional/phrases_edit.tpl
===================================================================
--- core/admin_templates/regional/phrases_edit.tpl (revision 13128)
+++ core/admin_templates/regional/phrases_edit.tpl (working copy)
@@ -62,30 +62,25 @@
<input type="hidden" name="simple_mode" value="<inp2:m_Get name='simple_mode'/>"/>
<input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_Get name='phrases_label'/>"/>
+<input type="hidden" name="regional" value="<inp2:m_Get name='regional'/>"/>
-<inp2:m_if check="phrases_ShowHiddenLanguage">
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="phrases" field="LanguageId" db="db"/>
-</inp2:m_if>
-
<inp2:m_if check="m_Get" name="simple_mode">
<inp2:m_RenderElement name="inp_edit_hidden" prefix="phrases" field="Phrase"/>
</inp2:m_if>
<inp2:m_DefineElement name="phrase_element">
+ <inp2:lang_Field name="LanguageId" result_to_var="language_id"/>
+
<inp2:m_if check="m_Get" name="simple_mode">
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="phrases" field="l{$language_id}_Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_else/>
<tr class="subsectiontitle">
<td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
</tr>
- <inp2:m_if check="m_Get" name="phrases_label">
- <inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="LanguageId" title="la_fld_LanguageId" has_empty="1"/>
- </inp2:m_if>
-
<inp2:m_RenderElement name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="phrases" field="l{$language_id}_Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 13140)
+++ core/install/install_data.sql (working copy)
@@ -239,38 +239,38 @@
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 0, NULL, 'Core:Users', 'Add User', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 1, NULL, 'Core:Users', 'Add User', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 0, NULL, 'Core:Users', 'Approve User', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 1, NULL, 'Core:Users', 'Approve User', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 0, NULL, 'Core:Users', 'Validate User', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 1, NULL, 'Core:Users', 'Validate User', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 0, NULL, 'Core:Users', 'Deny User', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 1, NULL, 'Core:Users', 'Deny User', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 1, NULL, 'Core:Users', 'Forgot Password', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 0, NULL, 'Core:Users', 'Forgot Password', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Users', 'Add Pending User', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Users', 'Add Pending User', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 0, NULL, 'Core:Category', 'Add Category', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Category', 'Add Pending Category', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Category', 'Add Pending Category', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 1, NULL, 'Core:Category', 'Add Category', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.APPROVE', NULL, 1, 0, NULL, 'Core:Category', 'Approve Category', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'CATEGORY.DENY', NULL, 1, 0, NULL, 'Core:Category', 'Deny Category', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User subscribed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User subscribed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User unsubscribed', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User unsubscribed', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 0, NULL, 'Core:Users', 'Suggest to a friend', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 1, NULL, 'Core:Users', 'Suggest to a friend', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.PSWDC', NULL, 1, 0, NULL, 'Core:Users', 'Password Confirmation', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 0);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'COMMON.FOOTER', NULL, 1, 0, NULL, 'Core', 'Common Footer Template', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 1);
-INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, l1_Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 0, NULL, 'Core:Users', 'Add User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.ADD', NULL, 1, 1, NULL, 'Core:Users', 'Add User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 0, NULL, 'Core:Users', 'Approve User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.APPROVE', NULL, 1, 1, NULL, 'Core:Users', 'Approve User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 0, NULL, 'Core:Users', 'Validate User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.VALIDATE', NULL, 1, 1, NULL, 'Core:Users', 'Validate User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 0, NULL, 'Core:Users', 'Deny User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.DENY', NULL, 1, 1, NULL, 'Core:Users', 'Deny User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 1, NULL, 'Core:Users', 'Forgot Password', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.PSWD', NULL, 1, 0, NULL, 'Core:Users', 'Forgot Password', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Users', 'Add Pending User', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Users', 'Add Pending User', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 0, NULL, 'Core:Category', 'Add Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 0, NULL, 'Core:Category', 'Add Pending Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD.PENDING', NULL, 1, 1, NULL, 'Core:Category', 'Add Pending Category', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.ADD', NULL, 1, 1, NULL, 'Core:Category', 'Add Category', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.APPROVE', NULL, 1, 0, NULL, 'Core:Category', 'Approve Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'CATEGORY.DENY', NULL, 1, 0, NULL, 'Core:Category', 'Deny Category', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User subscribed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.SUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User subscribed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 0, NULL, 'Core:Users', 'User unsubscribed', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.UNSUBSCRIBE', NULL, 1, 1, NULL, 'Core:Users', 'User unsubscribed', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 0, NULL, 'Core:Users', 'Suggest to a friend', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.SUGGEST', NULL, 1, 1, NULL, 'Core:Users', 'Suggest to a friend', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.PSWDC', NULL, 1, 0, NULL, 'Core:Users', 'Password Confirmation', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRED', NULL, 1, 0, NULL, 'Core:Users', 'Membership expired', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 0);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'USER.MEMBERSHIP.EXPIRATION.NOTICE', NULL, 1, 0, NULL, 'Core:Users', 'Membership expiration notice', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'COMMON.FOOTER', NULL, 1, 0, NULL, 'Core', 'Common Footer Template', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 1);
+INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'FORM.SUBMITTED', NULL, 1, 0, NULL, 'Core:Category', 'This e-mail is sent to a user after filling in the Contact Us form', 0);
INSERT INTO IdGenerator VALUES ('100');
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 13140)
+++ core/install/install_schema.sql (working copy)
@@ -112,11 +112,7 @@
FrontEndOnly tinyint(3) unsigned NOT NULL DEFAULT '0',
FromUserId int(11) DEFAULT NULL,
Module varchar(40) NOT NULL DEFAULT '',
- l1_Description text,
- l2_Description text,
- l3_Description text,
- l4_Description text,
- l5_Description text,
+ Description text,
`Type` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (EventId),
KEY `Type` (`Type`),
@@ -185,18 +181,20 @@
CREATE TABLE Phrase (
Phrase varchar(255) NOT NULL DEFAULT '',
PhraseKey varchar(255) NOT NULL DEFAULT '',
- Translation text,
+ l1_Translation text,
+ l2_Translation text,
+ l3_Translation text,
+ l4_Translation text,
+ l5_Translation text,
PhraseType int(11) NOT NULL DEFAULT '0',
PhraseId int(11) NOT NULL AUTO_INCREMENT,
- LanguageId int(11) NOT NULL DEFAULT '0',
LastChanged int(10) unsigned DEFAULT NULL,
LastChangeIP varchar(15) NOT NULL DEFAULT '',
Module varchar(30) NOT NULL DEFAULT 'In-Portal',
PRIMARY KEY (PhraseId),
- UNIQUE KEY LanguageId_2 (LanguageId,Phrase),
- KEY LanguageId (LanguageId),
KEY Phrase_Index (Phrase),
- KEY PhraseKey (PhraseKey)
+ KEY PhraseKey (PhraseKey),
+ KEY l1_Translation (l1_Translation(5))
);
CREATE TABLE PhraseCache (
Index: core/install/upgrades.php
===================================================================
--- core/install/upgrades.php (revision 13140)
+++ core/install/upgrades.php (working copy)
@@ -1327,6 +1327,12 @@
function Upgrade_5_1_0_B1($mode)
{
if ($mode == 'before') {
+ // create multilingual fields for phrases and email events
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ $ml_helper->createFields('phrases');
+ $ml_helper->createFields('emailevents');
+
+ // migrate email events
$table_structure = $this->Conn->Query('DESCRIBE ' . TABLE_PREFIX . 'Events', 'Field');
if (!array_key_exists('Headers', $table_structure)) {
@@ -1336,42 +1342,91 @@
$this->Conn->Query($sql);
}
- // create multilingual Subject and Template fields
- $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
- $ml_helper->createFields('emailevents');
+ if ($this->Conn->TableFound(TABLE_PREFIX . 'EmailMessage')) {
+ $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
+ /* @var $email_message_helper EmailMessageHelper */
- $email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
- /* @var $email_message_helper EmailMessageHelper */
+ for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) {
+ if (!$ml_helper->LanguageFound($language_id)) {
+ continue;
+ }
+ $sql = 'SELECT EmailMessageId, Template, EventId
+ FROM ' . TABLE_PREFIX . 'EmailMessage
+ WHERE LanguageId = ' . $language_id;
+ $translations = $this->Conn->Query($sql, 'EventId');
+
+ foreach ($translations as $event_id => $translation_data) {
+ $parsed = $email_message_helper->parseTemplate($translation_data['Template']);
+
+ $fields_hash = Array (
+ 'l' . $language_id . '_Subject' => $parsed['Subject'],
+ 'l' . $language_id . '_Body' => $parsed['Body'],
+ );
+
+ if ($parsed['Headers']) {
+ $fields_hash['Headers'] = $parsed['Headers'];
+ }
+
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Events', 'EventId = ' . $event_id);
+
+ $sql = 'DELETE FROM ' . TABLE_PREFIX . 'EmailMessage
+ WHERE EmailMessageId = ' . $translation_data['EmailMessageId'];
+ $this->Conn->Query($sql);
+ }
+ }
+ }
+
+ // migrate phrases
+ $temp_table = $this->Application->GetTempName(TABLE_PREFIX . 'Phrase');
+
+ $sqls = Array (
+ 'DROP TABLE IF EXISTS ' . $temp_table,
+ 'CREATE TABLE ' . $temp_table . ' LIKE ' . TABLE_PREFIX . 'Phrase',
+ 'ALTER TABLE ' . $temp_table . ' DROP LanguageId, DROP Translation',
+ 'ALTER IGNORE TABLE ' . $temp_table . ' DROP INDEX LanguageId_2',
+ 'ALTER TABLE ' . $temp_table . ' DROP PhraseId',
+ 'ALTER TABLE ' . $temp_table . ' ADD PhraseId INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST',
+ );
+
+ foreach ($sqls as $sql) {
+ $this->Conn->Query($sql);
+ }
+
+ $already_added = Array ();
+ $primary_language_id = $this->Application->GetDefaultLanguageId();
+
for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) {
if (!$ml_helper->LanguageFound($language_id)) {
continue;
}
- $sql = 'SELECT EmailMessageId, Template, EventId
- FROM ' . TABLE_PREFIX . 'EmailMessage
+ $sql = 'SELECT Phrase, PhraseKey, Translation AS l' . $language_id . '_Translation, PhraseType, LastChanged, LastChangeIP, Module
+ FROM ' . TABLE_PREFIX . 'Phrase
WHERE LanguageId = ' . $language_id;
- $translations = $this->Conn->Query($sql, 'EventId');
+ $phrases = $this->Conn->Query($sql, 'Phrase');
- foreach ($translations as $event_id => $translation_data) {
- $parsed = $email_message_helper->parseTemplate($translation_data['Template']);
-
- $fields_hash = Array (
- 'l' . $language_id . '_Subject' => $parsed['Subject'],
- 'l' . $language_id . '_Body' => $parsed['Body'],
- );
-
- if ($parsed['Headers']) {
- $fields_hash['Headers'] = $parsed['Headers'];
+ foreach ($phrases as $phrase => $fields_hash) {
+ if (array_key_exists($phrase, $already_added)) {
+ $this->Conn->doUpdate($fields_hash, $temp_table, 'PhraseId = ' . $already_added[$phrase]);
}
+ else {
+ $this->Conn->doInsert($fields_hash, $temp_table);
+ $already_added[$phrase] = $this->Conn->getInsertID();
+ }
+ }
- $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Events', 'EventId = ' . $event_id);
-
- $sql = 'DELETE FROM ' . TABLE_PREFIX . 'EmailMessage
- WHERE EmailMessageId = ' . $translation_data['EmailMessageId'];
+ // in case some phrases were found in this language, but not in primary language -> copy them
+ if ($language_id != $primary_language_id) {
+ $sql = 'UPDATE ' . $temp_table . '
+ SET l' . $primary_language_id . '_Translation = l' . $language_id . '_Translation
+ WHERE l' . $primary_language_id . '_Translation IS NULL';
$this->Conn->Query($sql);
}
}
+
+ $this->Conn->Query('DROP TABLE IF EXISTS ' . TABLE_PREFIX . 'Phrase');
+ $this->Conn->Query('RENAME TABLE ' . $temp_table . ' TO ' . TABLE_PREFIX . 'Phrase');
}
}
}
\ No newline at end of file
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 13140)
+++ core/install/upgrades.sql (working copy)
@@ -1636,6 +1636,8 @@
FROM <%TABLE_PREFIX%>Permissions
WHERE Permission = 'in-portal:configemail.edit';
+ALTER TABLE Events ADD l1_Description text;
+
UPDATE Events e
SET e.l1_Description = (
SELECT p.Translation
@@ -1643,5 +1645,8 @@
WHERE (p.Phrase = e.Description) AND (p.LanguageId = 1)
);
-ALTER TABLE Events DROP Description;
+UPDATE Events SET Description = l1_Description;
+ALTER TABLE Events DROP l1_Description;
+
DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%';
+DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.';
Index: core/kernel/languages/phrases_cache.php
===================================================================
--- core/kernel/languages/phrases_cache.php (revision 13128)
+++ core/kernel/languages/phrases_cache.php (working copy)
@@ -92,7 +92,7 @@
}
// now we use admin phrase editing template even on front-end
- $this->_phraseEditTemplate = 'regional/phrases_edit';
+ $this->_phraseEditTemplate = 'languages/phrase_edit';
}
/**
@@ -158,9 +158,9 @@
return;
}
- $sql = 'SELECT Translation, PhraseKey
+ $sql = 'SELECT l' . $this->LanguageId . '_Translation, PhraseKey
FROM ' . TABLE_PREFIX . 'Phrase
- WHERE (LanguageId = ' . $this->LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')';
+ WHERE PhraseId IN (' . implode(',', $ids) . ')';
$this->Phrases = $this->Conn->GetCol($sql, 'PhraseKey');
/*foreach($phrases as $phrase => $tanslation)
@@ -233,7 +233,7 @@
if ($this->_editExisting && $allow_editing && !array_key_exists($label, $this->_missingPhrases)) {
// option to change translation for Labels
- $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
+ $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPreparePhrase\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
$translated_label = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Edit translation">' . $translated_label . '</' . $this->_translateHtmlTag . '>';
if ($this->fromTag) {
@@ -260,16 +260,16 @@
$language_id = $use_admin ? $this->AdminLanguageId : $this->LanguageId;
- $sql = 'SELECT PhraseId, Translation
+ $sql = 'SELECT PhraseId, l' . $language_id . '_Translation
FROM ' . TABLE_PREFIX . 'Phrase
- WHERE (LanguageId = ' . $language_id . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')';
+ WHERE (PhraseKey = ' . $this->Conn->qstr($label) . ') AND (l' . $language_id . '_Translation IS NOT NULL)';
$res = $this->Conn->GetRow($sql);
if ($res === false || count($res) == 0) {
$translation = '!' . $label . '!';
if ($this->_editMissing && $allow_editing) {
- $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
+ $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPreparePhrase\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
$translation = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Translate">!' . $label . '!</' . $this->_translateHtmlTag . '>';
if ($this->fromTag) {
@@ -286,7 +286,7 @@
}
$cache_key = ($allow_editing ? '' : 'NE:') . $label;
- $this->Phrases[$cache_key] = $res['Translation'];
+ $this->Phrases[$cache_key] = $res['l' . $language_id . '_Translation'];
array_push($this->Ids, $res['PhraseId']);
$this->Ids = array_unique($this->Ids); // just to make sure
Index: core/units/email_events/email_events_config.php
===================================================================
--- core/units/email_events/email_events_config.php (revision 13140)
+++ core/units/email_events/email_events_config.php (working copy)
@@ -119,8 +119,6 @@
),
),
- 'PopulateMlFields' => true,
-
'Fields' => Array (
'EventId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Event' => Array ('type' => 'string', 'not_null' => 1, 'unique' => Array ('Type'), 'required' => 1, 'default' => ''),
@@ -168,11 +166,7 @@
'formatter' => 'kOptionsFormatter', 'options' => Array (),
'not_null' => 1, 'required' => 1, 'default' => ''
),
- 'Description' => Array (
- 'type' => 'string',
- 'formatter' => 'kMultiLanguage',
- 'not_null' => 1, 'default' => '', 'db_type' => 'text',
- ),
+ 'Description' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'Type' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1,
Index: core/units/email_events/email_events_event_handler.php
===================================================================
--- core/units/email_events/email_events_event_handler.php (revision 13140)
+++ core/units/email_events/email_events_event_handler.php (working copy)
@@ -648,15 +648,22 @@
$fields['Module']['options'] = $options;
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
- // make grid on "Email Events" tab in "Regional" section show columns of editable language, not admin language
- $language_id = $this->Application->GetVar('lang_id');
-
- if ($language_id) {
- $grids = $this->Application->getUnitOption($event->Prefix, 'Grids');
- // used by column picker to track column position
- $grids['Default']['Fields']['Description']['formatter_renamed'] = true;
- array_rename_key($grids['Default']['Fields'], 'Description', 'l' . $language_id . '_Description');
- $this->Application->setUnitOption($event->Prefix, 'Grids', $grids);
+ if ($this->Application->GetVar('regional')) {
+ $this->Application->setUnitOption($event->Prefix, 'PopulateMlFields', true);
}
}
+
+ /**
+ * Prepare temp tables and populate it
+ * with items selected in the grid
+ *
+ * @param kEvent $event
+ */
+ function OnEdit(&$event)
+ {
+ parent::OnEdit($event);
+
+ // use language from grid, instead of primary language used by default
+ $event->SetRedirectParam('m_lang', $this->Application->GetVar('m_lang'));
+ }
}
\ No newline at end of file
Index: core/units/helpers/country_states_helper.php
===================================================================
--- core/units/helpers/country_states_helper.php (revision 13128)
+++ core/units/helpers/country_states_helper.php (working copy)
@@ -50,12 +50,13 @@
return ;
}
- $sql = 'SELECT p.Translation as DestName, sd.DestAbbr
+ $language_id = $this->Application->GetVar('m_lang');
+
+ $sql = 'SELECT p.l' . $language_id . '_Translation as DestName, sd.DestAbbr
FROM ' . TABLE_PREFIX . 'StdDestinations AS sd
LEFT JOIN ' . TABLE_PREFIX . 'Phrase AS p ON p.Phrase = sd.DestName
- WHERE DestType = 2 AND DestParentId = ' . $country_id . ' AND LanguageId = ' . $this->Application->GetVar('m_lang') . '
- ORDER BY Translation';
-
+ WHERE DestType = 2 AND DestParentId = ' . $country_id . '
+ ORDER BY l' . $language_id . '_Translation';
$country_states[$country_abbr] = $this->Conn->GetCol($sql, 'DestAbbr');
}
@@ -72,7 +73,9 @@
*/
function CheckState($state_name, $country_code)
{
- if( !$this->CountryHasStates($country_code) ) return $state_name;
+ if (!$this->CountryHasStates($country_code)) {
+ return $state_name;
+ }
$sql = 'SELECT sdStates.DestAbbr
FROM '.TABLE_PREFIX.'StdDestinations AS sdStates
@@ -80,10 +83,9 @@
LEFT JOIN '.TABLE_PREFIX.'StdDestinations AS sdCountries ON sdStates.DestParentId = sdCountries.DestId
WHERE (sdStates.DestType = 2) AND
(sdStates.DestParentId = sdCountries.DestId) AND
- (p.LanguageId = %1$s) AND
(sdCountries.DestAbbr = %2$s) AND
(
- (LOWER(sdStates.DestAbbr) = %3$s) OR (LOWER(sdStates.DestAbbr2) = %3$s) OR (LOWER(sdStates.DestName) = %3$s) OR (LOWER(p.Translation) = %3$s)
+ (LOWER(sdStates.DestAbbr) = %3$s) OR (LOWER(sdStates.DestAbbr2) = %3$s) OR (LOWER(sdStates.DestName) = %3$s) OR (LOWER(p.l%1$s_Translation) = %3$s)
)';
$state_name = trim( mb_strtolower($state_name) );
Index: core/units/helpers/email_message_helper.php
===================================================================
--- core/units/helpers/email_message_helper.php (revision 13140)
+++ core/units/helpers/email_message_helper.php (working copy)
@@ -10,7 +10,7 @@
*/
function parseTemplate($text)
{
- $ret = Array ();
+ $ret = Array ('Subject' => '', 'Headers' => '', 'Body' => '');
$headers = Array();
$lines = explode("\n", $text);
@@ -31,7 +31,7 @@
$ret['Headers'] = implode("\n", $headers);
$message_body = '';
- while ((list($line_id,$line) = each($lines))) {
+ while ((list($line_id, $line) = each($lines))) {
$message_body .= $line;
}
Index: core/units/helpers/language_import_helper.php
===================================================================
--- core/units/helpers/language_import_helper.php (revision 13140)
+++ core/units/helpers/language_import_helper.php (working copy)
@@ -161,8 +161,8 @@
// copy data from temp tables to live
foreach ($this->_languages as $language_id) {
- $this->_performUpgrade($language_id, 'phrases', 'PhraseKey');
- $this->_performUpgrade_v2($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'l%s_Body'));
+ $this->_performUpgrade($language_id, 'phrases', 'PhraseKey', Array ('l%s_Translation'));
+ $this->_performUpgrade($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'l%s_Body'));
}
$this->_initImportTables(true);
@@ -192,15 +192,8 @@
$phrase_types = explode('|', substr($phrase_types, 1, -1) );
$module_ids = explode('|', substr($module_ids, 1, -1) );
- $this->events_hash = array_flip($this->events_hash);
-
- $lang_table = $this->Application->getUnitOption('lang','TableName');
- $phrases_table = $this->Application->getUnitOption('phrases','TableName');
- $events_table = $this->Application->getUnitOption('emailevents','TableName');
-
$phrase_tpl = "\t\t\t".'<PHRASE Label="%s" Module="%s" Type="%s">%s</PHRASE>'."\n";
$event_tpl = "\t\t\t".'<EVENT MessageType="%s" Event="%s" Type="%s">%s</EVENT>'."\n";
- $sql = 'SELECT * FROM %s WHERE LanguageId = %s';
$ret = '<LANGUAGES Version="' . $this->_latestVersion . '">'."\n";
$export_fields = $this->_getExportFields();
@@ -208,68 +201,88 @@
$email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
/* @var $email_message_helper EmailMessageHelper */
- foreach ($language_ids as $language_id) {
- // languages
- $row = $this->Conn->GetRow( sprintf($sql, $lang_table, $language_id) );
+ // get languages
+ $sql = 'SELECT *
+ FROM ' . $this->Application->getUnitOption('lang','TableName') . '
+ WHERE LanguageId IN (' . implode(',', $language_ids) . ')';
+ $languages = $this->Conn->Query($sql, 'LanguageId');
+
+ // get phrases
+ $phrase_modules = $module_ids;
+ array_push($phrase_modules, ''); // for old language packs without module
+
+ $phrase_modules = array_map(Array (&$this->Conn, 'qstr'), $phrase_modules);
+
+ $sql = 'SELECT *
+ FROM ' . $this->Application->getUnitOption('phrases','TableName') . '
+ WHERE PhraseType IN (' . implode(',', $phrase_types) . ') AND Module IN (' . implode(',', $phrase_modules) . ')
+ ORDER BY Phrase';
+ $phrases = $this->Conn->Query($sql, 'PhraseId');
+
+ // email events
+ $module_sql = preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids) . ',');
+
+ $sql = 'SELECT *
+ FROM ' . $this->Application->getUnitOption('emailevents','TableName') . '
+ WHERE ' . substr($module_sql, 0, -4) . '
+ ORDER BY `Event`, `Type`';
+ $events = $this->Conn->Query($sql, 'EventId');
+
+ foreach ($languages as $language_id => $language_info) {
+ // language
$ret .= "\t" . '<LANGUAGE Encoding="' . $this->_exportEncoding . '"';
foreach ($export_fields as $export_field) {
- $ret .= ' ' . $export_field . '="' . htmlspecialchars($row[$export_field]) . '"';
+ $ret .= ' ' . $export_field . '="' . htmlspecialchars($language_info[$export_field]) . '"';
}
- $ret .= '>'."\n";
+ $ret .= '>' . "\n";
- $ret .= '<REPLACEMENTS>';
- $ret .= $this->_exportEncoding == 'base64' ? base64_encode($row['FilenameReplacements']) : '<![CDATA[' . $row['FilenameReplacements'] . ']]>';
+ // filename replacements
+ $ret .= "\t\t" . '<REPLACEMENTS>';
+ $replacements = $language_info['FilenameReplacements'];
+ $ret .= $this->_exportEncoding == 'base64' ? base64_encode($replacements) : '<![CDATA[' . $replacements . ']]>';
$ret .= '</REPLACEMENTS>' . "\n";
// phrases
- $phrases_sql = 'SELECT * FROM '.$phrases_table.' WHERE LanguageId = %s AND PhraseType IN (%s) AND Module IN (%s) ORDER BY Phrase';
- if( in_array('In-Portal',$module_ids) ) array_push($module_ids, ''); // for old language packs
- $rows = $this->Conn->Query( sprintf($phrases_sql,$language_id, implode(',',$phrase_types), '\''.implode('\',\'',$module_ids).'\'' ) );
- if($rows)
- {
- $ret .= "\t\t".'<PHRASES>'."\n";
- foreach($rows as $row)
- {
- $data = $this->_exportEncoding == 'base64' ? base64_encode($row['Translation']) : '<![CDATA['.$row['Translation'].']]>';
- $ret .= sprintf($phrase_tpl, $row['Phrase'], $row['Module'], $row['PhraseType'], $data );
+ if ($phrases) {
+ $ret .= "\t\t" . '<PHRASES>' . "\n";
+ foreach ($phrases as $phrase_id => $phrase) {
+ $translation = $phrase['l' . $language_id . '_Translation'];
+
+ if (!$translation) {
+ // phrase is not translated on given language
+ continue;
+ }
+
+ $data = $this->_exportEncoding == 'base64' ? base64_encode($translation) : '<![CDATA[' . $translation . ']]>';
+ $ret .= sprintf($phrase_tpl, $phrase['Phrase'], $phrase['Module'], $phrase['PhraseType'], $data);
}
- $ret .= "\t\t".'</PHRASES>'."\n";
+ $ret .= "\t\t" . '</PHRASES>' . "\n";
}
// email events
- if ( in_array('In-Portal',$module_ids) ) {
- unset( $module_ids[array_search('',$module_ids)] ); // for old language packs
- }
+ $ret .= "\t\t" . '<EVENTS>' . "\n";
- $module_sql = preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids).',');
- $module_sql = substr($module_sql, 0, -4);
-
- $ret .= "\t\t".'<EVENTS>'."\n";
-
- $event_sql = ' SELECT *
- FROM ' . $events_table . '
- WHERE ' . $module_sql . '
- ORDER BY `Event`, `Type`';
- $rows = $this->Conn->Query($event_sql);
-
- foreach ($rows as $row) {
+ foreach ($events as $event_id => $event) {
$fields_hash = Array (
- 'Headers' => $row['Headers'],
- 'Subject' => $row['l' . $language_id . '_Subject'],
- 'Body' => $row['l' . $language_id . '_Body'],
+ 'Headers' => $event['Headers'],
+ 'Subject' => $event['l' . $language_id . '_Subject'],
+ 'Body' => $event['l' . $language_id . '_Body'],
);
$template = $email_message_helper->buildTemplate($fields_hash);
- list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
+ if (!$template) {
+ // email event is not translated on given language
+ continue;
+ }
+
$data = $this->_exportEncoding == 'base64' ? base64_encode($template) : '<![CDATA[' . $template . ']]>';
- $ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, $data);
+ $ret .= sprintf($event_tpl, $event['MessageType'], $event['Event'], $event['Type'], $data);
}
- $ret .= "\t\t".'</EVENTS>'."\n";
-
- $ret .= "\t".'</LANGUAGE>'."\n";
+ $ret .= "\t\t" . '</EVENTS>' . "\n";
+ $ret .= "\t" . '</LANGUAGE>' . "\n";
}
$ret .= '</LANGUAGES>';
@@ -295,59 +308,12 @@
* @param int $language_id
* @param string $prefix
* @param string $unique_field
- */
- function _performUpgrade($language_id, $prefix, $unique_field)
- {
- $live_records = $this->_getTableData($language_id, $prefix, $unique_field, false);
- $temp_records = $this->_getTableData($language_id, $prefix, $unique_field, true);
-
- if ($this->import_mode == LANG_OVERWRITE_EXISTING) {
- // remove existing records before copy
- $common_records = array_intersect($temp_records, $live_records);
- if ($common_records) {
- $live_records = array_diff($live_records, $common_records); // remove overlaping records
- $common_records = array_map(Array(&$this->Conn, 'qstr'), $common_records);
-
- $sql = 'DELETE FROM ' . $this->Application->getUnitOption($prefix, 'TableName') . '
- WHERE (LanguageId = ' . $language_id . ') AND (' . $unique_field . ' IN (' . implode(',', $common_records) . '))';
- $this->Conn->Query($sql);
- }
- }
-
- $temp_records = array_diff($temp_records, $live_records);
-
- if (!$temp_records) {
- // no new records found in temp table while comparing it to live table
- return ;
- }
-
- $temp_records = array_map(Array(&$this->Conn, 'qstr'), $temp_records);
-
- $sql = 'INSERT INTO ' . $this->Application->getUnitOption($prefix, 'TableName') . '
- SELECT *
- FROM ' . $this->_tables[$prefix] . '
- WHERE (LanguageId = ' . $language_id . ')';
-
- if ($live_records) {
- // subsctract live records from temp table during coping
- $sql .= ' AND (' . $unique_field . ' IN (' . implode(',', $temp_records) . '))';
- }
-
- $this->Conn->Query($sql);
- }
-
- /**
- * Performs upgrade of given language pack part
- *
- * @param int $language_id
- * @param string $prefix
- * @param string $unique_field
* @param string $data_fields
*/
- function _performUpgrade_v2($language_id, $prefix, $unique_field, $data_fields)
+ function _performUpgrade($language_id, $prefix, $unique_field, $data_fields)
{
- $live_records = $this->_getTableData_v2($language_id, $prefix, $unique_field, $data_fields[0], false);
- $temp_records = $this->_getTableData_v2($language_id, $prefix, $unique_field, $data_fields[0], true);
+ $live_records = $this->_getTableData($language_id, $prefix, $unique_field, $data_fields[0], false);
+ $temp_records = $this->_getTableData($language_id, $prefix, $unique_field, $data_fields[0], true);
if (!$temp_records) {
// no data for given language
@@ -416,31 +382,8 @@
* @param bool $temp_mode
* @return Array
*/
- function _getTableData($language_id, $prefix, $unique_field, $temp_mode = false)
+ function _getTableData($language_id, $prefix, $unique_field, $data_field, $temp_mode = false)
{
- $table_name = $this->Application->getUnitOption($prefix, 'TableName');
-
- if ($temp_mode) {
- $table_name = $this->Application->GetTempName($table_name, 'prefix:' . $prefix);
- }
-
- $sql = 'SELECT ' . $unique_field . '
- FROM ' . $table_name . '
- WHERE LanguageId = ' . $language_id;
- return $this->Conn->GetCol($sql);
- }
-
- /**
- * Returns data from given table used for language pack upgrade
- *
- * @param int $language_id
- * @param string $prefix
- * @param string $unique_field
- * @param bool $temp_mode
- * @return Array
- */
- function _getTableData_v2($language_id, $prefix, $unique_field, $data_field, $temp_mode = false)
- {
$data_field = sprintf($data_field, $language_id);
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
@@ -514,11 +457,15 @@
$this->Conn->Query( sprintf($sql, $temp_table) );
if (!$drop_only) {
- $sql = 'CREATE TABLE %s SELECT * FROM %s WHERE 0';
- $this->Conn->Query( sprintf($sql, $temp_table, $table) );
+ $sql = 'CREATE TABLE ' . $temp_table . ' SELECT * FROM ' . $table . ' WHERE 0';
+ $this->Conn->Query($sql);
$sql = 'ALTER TABLE %1$s CHANGE %2$s %2$s INT(11) NOT NULL DEFAULT "0"';
$this->Conn->Query( sprintf($sql, $temp_table, $idfield) );
+
+ $unique_field = $prefix == 'phrases' ? 'PhraseKey' : 'EventId';
+ $sql = 'ALTER TABLE ' . $temp_table . ' ADD UNIQUE (' . $unique_field . ')';
+ $this->Conn->Query($sql);
}
return $temp_table;
@@ -669,28 +616,50 @@
*/
function _processPhrases(&$phrase_node, $language_id, $language_encoding)
{
+ static $other_translations = Array ();
+
+ if ($this->Application->isDebugMode()) {
+ $this->Application->Debugger->profileStart('L[' . $language_id . ']P', 'Language: ' . $language_id . '; Phrases Import');
+ }
+
do {
+ $phrase_key = mb_strtoupper($phrase_node->Attributes['LABEL']);
+
$fields_hash = Array (
- 'LanguageId' => $language_id,
'Phrase' => $phrase_node->Attributes['LABEL'],
- 'PhraseKey' => mb_strtoupper($phrase_node->Attributes['LABEL']),
+ 'PhraseKey' => $phrase_key,
'PhraseType' => $phrase_node->Attributes['TYPE'],
'Module' => array_key_exists('MODULE', $phrase_node->Attributes) ? $phrase_node->Attributes['MODULE'] : 'Core',
'LastChanged' => adodb_mktime(),
'LastChangeIP' => $this->ip_address,
- 'Translation' => $phrase_node->Data,
);
+ $translation = $phrase_node->Data;
+
if (array_key_exists($fields_hash['PhraseType'], $this->phrase_types_allowed)) {
if ($language_encoding != 'plain') {
- $fields_hash['Translation'] = base64_decode($fields_hash['Translation']);
+ $translation = base64_decode($translation);
}
- $this->Conn->doInsert($fields_hash, $this->_tables['phrases'], 'INSERT', false);
+ if (array_key_exists($phrase_key, $other_translations)) {
+ $other_translations[$phrase_key]['l' . $language_id . '_Translation'] = $translation;
+ }
+ else {
+ $other_translations[$phrase_key] = Array (
+ 'l' . $language_id . '_Translation' => $translation
+ );
+ }
+
+ $fields_hash = array_merge($fields_hash, $other_translations[$phrase_key]);
+ $this->Conn->doInsert($fields_hash, $this->_tables['phrases'], 'REPLACE', false);
}
} while (($phrase_node =& $phrase_node->NextSibling()));
- $this->Conn->doInsert($fields_hash, $this->_tables['phrases'], 'INSERT');
+ if ($this->Application->isDebugMode()) {
+ $this->Application->Debugger->profileFinish('L[' . $language_id . ']P', 'Language: ' . $language_id . '; Phrases Import');
+ }
+
+ $this->Conn->doInsert($fields_hash, $this->_tables['phrases'], 'REPLACE');
}
/**
@@ -702,8 +671,12 @@
*/
function _processEvents(&$event_node, $language_id, $language_encoding)
{
- static $events_added = Array ();
+ static $other_translations = Array ();
+ if ($this->Application->isDebugMode()) {
+ $this->Application->Debugger->profileStart('L[' . $language_id . ']E', 'Language: ' . $language_id . '; Events Import');
+ }
+
$email_message_helper =& $this->Application->recallObject('EmailMessageHelper');
/* @var $email_message_helper EmailMessageHelper */
@@ -724,23 +697,36 @@
'Event' => $event_node->Attributes['EVENT'],
'Type' => $event_node->Attributes['TYPE'],
'MessageType' => $event_node->Attributes['MESSAGETYPE'],
- 'l' . $language_id . '_Subject' => $parsed['Subject'],
- 'l' . $language_id . '_Body' => $parsed['Body'],
);
- if ($parsed['Headers']) {
- $fields_hash['Headers'] = $parsed['Headers'];
+ if (array_key_exists($event_id, $other_translations)) {
+ $other_translations[$event_id]['l' . $language_id . '_Subject'] = $parsed['Subject'];
+ $other_translations[$event_id]['l' . $language_id . '_Body'] = $parsed['Body'];
}
+ else {
+ $other_translations[$event_id] = Array (
+ 'l' . $language_id . '_Subject' => $parsed['Subject'],
+ 'l' . $language_id . '_Body' => $parsed['Body'],
+ );
+ }
- if (!in_array($event_id, $events_added)) {
- $events_added[] = $event_id;
- $this->Conn->doInsert($fields_hash, $this->_tables['emailevents']);
+ if ($parsed['Headers']) {
+ $other_translations[$event_id]['Headers'] = $parsed['Headers'];
}
- else {
- $this->Conn->doUpdate($fields_hash, $this->_tables['emailevents'], 'EventId = ' . $event_id);
+ elseif (!$parsed['Headers'] && !array_key_exists('Headers', $other_translations[$event_id])) {
+ $other_translations[$event_id]['Headers'] = $parsed['Headers'];
}
+
+ $fields_hash = array_merge($fields_hash, $other_translations[$event_id]);
+ $this->Conn->doInsert($fields_hash, $this->_tables['emailevents'], 'REPLACE', false);
}
} while (($event_node =& $event_node->NextSibling()));
+
+ if ($this->Application->isDebugMode()) {
+ $this->Application->Debugger->profileFinish('L[' . $language_id . ']E', 'Language: ' . $language_id . '; Events Import');
+ }
+
+ $this->Conn->doInsert($fields_hash, $this->_tables['emailevents'], 'REPLACE');
}
/**
Index: core/units/languages/languages_config.php
===================================================================
--- core/units/languages/languages_config.php (revision 13140)
+++ core/units/languages/languages_config.php (working copy)
@@ -136,7 +136,6 @@
),
'TableName' => TABLE_PREFIX.'Language',
- 'SubItems' => Array('phrases',/*'emailmessages'*/),
'FilterMenu' => Array(
'Groups' => Array(
Index: core/units/languages/languages_event_handler.php
===================================================================
--- core/units/languages/languages_event_handler.php (revision 13140)
+++ core/units/languages/languages_event_handler.php (working copy)
@@ -195,19 +195,6 @@
$pending_actions[$src_language] = $dst_language;
$this->Application->StoreVar($var_name, serialize($pending_actions));
-
- if ($object->IsTempTable()) {
- // 2. phrases import
- $phrases_live = $this->Application->getUnitOption('phrases','TableName');
- $phrases_temp = $this->Application->GetTempName($phrases_live, 'prefix:phrases');
-
- $sql = 'INSERT INTO ' . $phrases_temp . '(Phrase, PhraseKey, Translation, PhraseType, PhraseId, LanguageId, LastChanged, LastChangeIP, Module)
- SELECT Phrase, PhraseKey, Translation, PhraseType, 0-PhraseId, ' . $dst_language . ', ' . adodb_mktime() . ', "", Module
- FROM ' . $phrases_live . '
- WHERE LanguageId = ' . $src_language;
- $this->Conn->Query($sql);
- }
-
$object->SetDBField('CopyLabels', 0);
}
}
@@ -234,14 +221,14 @@
// create multilingual columns for phrases & email events table first (actual for 6+ language)
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
-// $ml_helper->createFields('phrases');
+ $ml_helper->createFields('phrases');
$ml_helper->createFields('emailevents');
foreach ($pending_actions as $src_language => $dst_language) {
// phrases import
- /*$sql = 'UPDATE ' . $this->Application->getUnitOption('phrases', 'TableName') . '
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('phrases', 'TableName') . '
SET l' . $dst_language . '_Translation = l' . $src_language . '_Translation';
- $this->Conn->Query($sql);*/
+ $this->Conn->Query($sql);
// events import
$sql = 'UPDATE ' . $this->Application->getUnitOption('emailevents', 'TableName') . '
@@ -511,38 +498,11 @@
continue;
}
- $this->_addMissingPhrase($source_id, $target_id);
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'Phrase
+ SET l' . $target_id . '_Translation = l' . $source_id . '_Translation
+ WHERE (l' . $target_id . '_Translation IS NULL) OR (l' . $target_id . '_Translation = "")';
+ $this->Conn->Query($sql);
}
}
}
-
- /**
- * Copy missing phrases from $from_lang to $to_lang
- *
- * @param int $from_lang
- * @param int $to_lang
- */
- function _addMissingPhrase($from_lang, $to_lang)
- {
- $tmp_name = TABLE_PREFIX . 'PhraseCopy_' . $this->Application->GetSID();
- $q = 'CREATE TABLE ' . $tmp_name . '
- SELECT
- source.Phrase,
- source.PhraseKey,
- source.Translation,
- source.PhraseType,
- NULL As PhraseId,
- ' . $to_lang . ' AS LanguageId,
- source.LastChanged,
- source.LastChangeIP,
- source.Module
- FROM ' . TABLE_PREFIX . 'Phrase source
- WHERE source.LanguageId = ' . $from_lang . '
- AND source.Phrase NOT IN (SELECT Phrase FROM ' . TABLE_PREFIX . 'Phrase target WHERE target.LanguageId = ' . $to_lang . ')';
- $this->Conn->Query($q);
-
- $this->Conn->Query('INSERT INTO ' . TABLE_PREFIX . 'Phrase SELECT * FROM ' . $tmp_name);
- $this->Conn->Query('DROP TABLE ' . $tmp_name);
- }
-
}
\ No newline at end of file
Index: core/units/phrases/phrase_tp.php
===================================================================
--- core/units/phrases/phrase_tp.php (revision 13128)
+++ core/units/phrases/phrase_tp.php (working copy)
@@ -15,20 +15,6 @@
class PhraseTagProcessor extends kDBTagProcessor {
/**
- * Determines, that hidden field with language id should be shown
- *
- * @param Array $params
- * @return bool
- */
- function ShowHiddenLanguage($params)
- {
- $simple_mode = $this->Application->GetVar('simple_mode');
- $phrases_label = $this->Application->GetVar('phrases_label');
-
- return $simple_mode || !$phrases_label;
- }
-
- /**
* Determines, that we can close phrase editing form without parent window refreshing
*
* @param Array $params
Index: core/units/phrases/phrases_config.php
===================================================================
--- core/units/phrases/phrases_config.php (revision 13128)
+++ core/units/phrases/phrases_config.php (working copy)
@@ -17,29 +17,6 @@
$config = Array (
'Prefix' => 'phrases',
- 'Clones' => Array (
- 'phrases-single' => Array (
- 'ForeignKey' => false,
- 'ParentTableKey' => false,
- 'ParentPrefix' => false,
-
- 'Sections' => Array (
- // "Phrases"
- 'in-portal:phrases' => Array (
- 'parent' => 'in-portal:site',
- 'icon' => 'phrases_labels',
- 'label' => 'la_title_Phrases',
- 'url' => Array ('t' => 'languages/phrase_list', 'pass' => 'm'),
- 'permissions' => Array ('view', 'add', 'edit', 'delete'),
-// 'perm_prefix' => 'lang',
- 'priority' => 4,
-// 'show_mode' => smSUPER_ADMIN,
- 'type' => stTREE,
- ),
- ),
- )
- ),
-
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'PhrasesEventHandler', 'file' => 'phrases_event_handler.php', 'build_event' => 'OnBuild'),
@@ -67,32 +44,47 @@
'phrase_edit' => Array (
'prefixes' => Array ('phrases'), 'format' => '#phrases_status# #phrases_titlefield#',
'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
- ),
+ ),
// for separate phrases list
'phrases_list_st' => Array (
- 'prefixes' => Array ('phrases.st_List'), 'format' => "!la_title_Phrases!",
+ 'prefixes' => Array ('phrases_List'), 'format' => "!la_title_Phrases!",
'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
- ),
+ ),
'phrase_edit_single' => Array (
'prefixes' => Array ('phrases'), 'format' => '#phrases_status# #phrases_titlefield#',
'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
- ),
+ ),
),
+ 'Sections' => Array (
+ // "Phrases"
+ 'in-portal:phrases' => Array (
+ 'parent' => 'in-portal:site',
+ 'icon' => 'phrases_labels',
+ 'label' => 'la_title_Phrases',
+ 'url' => Array ('t' => 'languages/phrase_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+// 'perm_prefix' => 'lang',
+ 'priority' => 4,
+// 'show_mode' => smSUPER_ADMIN,
+ 'type' => stTREE,
+ ),
+ ),
+
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_front', 'show_admin', 'show_both'), 'type' => WHERE_FILTER),
- Array ('mode' => 'AND', 'filters' => Array ('translated', 'not_translated'), 'type' => WHERE_FILTER),
+ Array ('mode' => 'AND', 'filters' => Array ('translated', 'not_translated'), 'type' => HAVING_FILTER),
),
'Filters' => Array (
'show_front' => Array ('label' =>'la_PhraseType_Front', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 0'),
'show_admin' => Array ('label' => 'la_PhraseType_Admin', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 1'),
'show_both' => Array ('label' => 'la_PhraseType_Both', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 2'),
's1' => Array (),
- 'translated' => Array ('label' => 'la_PhraseTranslated', 'on_sql' => '', 'off_sql' => '%1$s.Translation = pri.Translation'),
- 'not_translated' => Array ('label' => 'la_PhraseNotTranslated', 'on_sql' => '', 'off_sql' => '%1$s.Translation != pri.Translation'),
+ 'translated' => Array ('label' => 'la_PhraseTranslated', 'on_sql' => '', 'off_sql' => 'CurrentTranslation IS NULL'),
+ 'not_translated' => Array ('label' => 'la_PhraseNotTranslated', 'on_sql' => '', 'off_sql' => 'CurrentTranslation IS NOT NULL'),
)
),
@@ -100,21 +92,13 @@
'CalculatedFields' => Array (
'' => Array (
- 'PrimaryTranslation' => 'pri.Translation',
+ 'PrimaryTranslation' => 'l%4$s_Translation',
+ 'CurrentTranslation' => 'l%5$s_Translation',
),
-
- 'st' => Array (
- 'PackName' => 'lang.PackName',
- ),
),
'ListSQLs' => Array(
- '' => ' SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN ' . TABLE_PREFIX . 'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)',
- 'st' => 'SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN ' . TABLE_PREFIX . 'Language lang ON (%1$s.LanguageId = lang.LanguageId)',
+ '' => 'SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
@@ -123,60 +107,54 @@
)
),
- 'ForeignKey' => 'LanguageId',
- 'ParentTableKey' => 'LanguageId',
- 'ParentPrefix' => 'lang',
- 'AutoDelete' => true,
- 'AutoClone' => true,
-
'Fields' => Array (
+ 'PhraseId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Phrase' => Array (
'type' => 'string',
- 'required' => 1, 'unique' => Array ('LanguageId'),
+ 'required' => 1, 'unique' => Array (),
'not_null' => 1, 'default' => ''
),
'PhraseKey' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
- 'Translation' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'required' => 1, 'using_fck' => 1, 'default' => NULL),
+ 'Translation' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'required' => 1, 'using_fck' => 1, 'default' => NULL, 'db_type' => 'text'),
'PhraseType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_PhraseType_Front', 1 => 'la_PhraseType_Admin', 2 => 'la_PhraseType_Both'), 'use_phrases' => 1,
'not_null' => 1, 'required' => 1, 'default' => 0
),
- 'PhraseId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
-
- 'LanguageId' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Language ORDER BY LocalName', 'option_key_field' => 'LanguageId', 'option_title_field' => 'LocalName',
- 'not_null' => 1, 'default' => 0
- ),
-
'LastChanged' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
'LastChangeIP' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'Module' => Array (
'type' => 'string',
'formatter' => 'kOptionsFormatter', 'options' => Array ('' => ''), 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Modules WHERE (Loaded = 1) AND (Name <> "In-Portal") ORDER BY LoadOrder', 'option_key_field' => 'Name', 'option_title_field' => 'Name',
- 'not_null' => 1, 'default' => 'Core'
+ 'not_null' => 1, 'required' => 1, 'default' => 'Core'
),
),
'VirtualFields' => Array (
'PrimaryTranslation' => Array ('type' => 'string', 'default' => ''),
+ 'CurrentTranslation' => Array ('type' => 'string', 'default' => ''),
+
+ // for language pack import/export
'LangFile' => Array (
'type' => 'string',
'formatter' => 'kUploadFormatter',
'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => WRITEBALE_BASE . '/',
'max_len' => 255, 'default' => ''
),
- 'ImportOverwrite' => Array ('type' => 'int', 'default' => 0),
- 'DoNotEncode' => Array (),
- 'PackName' => Array (
- 'type' => 'string',
- 'formatter' => 'kOptionsFormatter',
- 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Language ORDER BY PackName', 'option_title_field' => 'PackName', 'option_key_field' => 'PackName',
+ 'ImportOverwrite' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'default' => 0
),
+ 'DoNotEncode' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'default' => 0
+ ),
),
'Grids' => Array (
+ // used on "Phrases" tab in language editing in "Regional" section
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
@@ -186,7 +164,7 @@
'Fields' => Array (
'PhraseId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
'Phrase' => Array ('title' => 'la_col_Label', 'data_block' => 'grid_checkbox_td', 'width' => 200),
- 'Translation' => Array ('title' => 'la_col_Phrase', 'width' => 200),
+ 'CurrentTranslation' => Array ('title' => 'la_col_Phrase', 'width' => 200),
'PrimaryTranslation' => Array ('title' => 'la_col_PrimaryValue', 'width' => 200),
'PhraseType' => Array ('title' => 'la_col_PhraseType', 'filter_block' => 'grid_options_filter', 'width' => 60),
'LastChanged' => Array ('title' => 'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 150),
@@ -194,6 +172,7 @@
),
),
+ // used on "Labels & Phrases" section
'Phrases' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
@@ -203,8 +182,7 @@
'Fields' => Array (
'PhraseId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
'Phrase' => Array ('title' => 'la_col_Label', 'filter_block' => 'grid_like_filter', 'width' => 170),
- 'Translation' => Array ('title' => 'la_col_Phrase', 'filter_block' => 'grid_like_filter', 'width' => 180),
- 'PackName' => Array ('title' => 'la_col_Language', 'filter_block' => 'grid_options_filter', 'width' => 95),
+ 'CurrentTranslation' => Array ('title' => 'la_col_Phrase', 'filter_block' => 'grid_like_filter', 'width' => 180),
'PhraseType' => Array ('title' => 'la_col_Location', 'filter_block' => 'grid_options_filter', 'width' => 80),
'LastChanged' => Array ('title' => 'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 145),
'Module' => Array ('title' => 'la_col_Module', 'filter_block' => 'grid_options_filter', 'width' => 100),
Index: core/units/phrases/phrases_event_handler.php
===================================================================
--- core/units/phrases/phrases_event_handler.php (revision 13128)
+++ core/units/phrases/phrases_event_handler.php (working copy)
@@ -32,7 +32,7 @@
if ($event->Special == 'import') {
$object->setRequired('LangFile', true);
$object->setRequired('Phrase', false);
- $object->setRequired('Translation', false);
+ $object->setRequired('l' . $this->Application->GetVar('m_lang') . '_Translation', false);
// allow multiple phrase types to be selected during import
$field_options = $object->GetFieldOptions('PhraseType');
@@ -65,14 +65,51 @@
$permissions = Array (
'OnItemBuild' => Array('self' => true, 'subitem' => true),
- 'OnNew' => Array('self' => true, 'subitem' => true),
- 'OnPrepareUpdate' => Array('self' => true, 'subitem' => true),
+ 'OnPreparePhrase' => Array('self' => true, 'subitem' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
+ * Prepares phrase for translation
+ *
+ * @param kEvent $event
+ */
+ function OnPreparePhrase(&$event)
+ {
+ $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label');
+
+ if (!$label) {
+ return ;
+ }
+
+ // we got label, try to get it's ID then if any
+ $phrase_id = $this->_getPhraseId($label);
+
+ if ($phrase_id) {
+ $event->SetRedirectParam($event->getPrefixSpecial(true) . '_id', $phrase_id);
+ $event->SetRedirectParam('pass', 'm,' . $event->getPrefixSpecial());
+ }
+ else {
+ $event->CallSubEvent('OnNew');
+ }
+
+ if ($this->Application->GetVar('simple_mode')) {
+ $event->SetRedirectParam('simple_mode', 1);
+ }
+ }
+
+ function _getPhraseId($phrase)
+ {
+ $sql = 'SELECT ' . $this->Application->getUnitOption($this->Prefix, 'IDField') . '
+ FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . '
+ WHERE PhraseKey = ' . $this->Conn->qstr( mb_strtoupper($phrase) );
+
+ return $this->Conn->GetOne($sql);
+ }
+
+ /**
* Forces new label in case if issued from get link
*
* @param kEvent $event
@@ -80,53 +117,45 @@
function OnNew(&$event)
{
parent::OnNew($event);
- $label = $this->Application->GetVar('phrases_label');
- $object =& $event->getObject( $label ? Array('live_table' => true, 'skip_autoload' => true) : Array('skip_autoload' => true) );
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label');
+
if ($label) {
+ // phrase is created in language, used to display phrases
$object->SetDBField('Phrase', $label);
- // phrase is created in language, used to display phrases
- $object->SetDBField('LanguageId', $this->Application->GetVar('m_lang'));
- $object->SetDBField('PhraseType', 1);
-
- $primary_language = $this->Application->GetDefaultLanguageId();
- $live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
- $sql = 'SELECT Translation FROM %s WHERE Phrase = %s';
- $primary_value = $this->Conn->GetOne( sprintf($sql, $live_table, $this->Conn->qstr($label) ) );
- $object->SetDBField('PrimaryTranslation', $primary_value);
+ $object->SetDBField('PhraseType', 1); // admin
+ $object->SetDBField('PrimaryTranslation', $this->_getPrimaryTranslation($label));
}
+ // set module from cookie
$last_module = $this->Application->GetVar('last_module');
+
if ($last_module) {
$object->SetDBField('Module', $last_module);
}
- if ($event->Special == 'export' || $event->Special == 'import') {
+ if (($event->Special == 'export') || ($event->Special == 'import')) {
$object->SetDBField('PhraseType', '|0|1|2|');
- $modules = $this->Conn->GetCol('SELECT Name FROM '.TABLE_PREFIX.'Modules');
- $object->SetDBField('Module', '|'.implode('|', $modules).'|' );
+ $object->SetDBField('Module', '|' . implode('|', array_keys($this->Application->ModuleInfo)) . '|' );
}
}
/**
- * Prepares existing phrase editing
+ * Returns given phrase translation on primary language
*
- * @param kEvent $event
+ * @param string $phrase
+ * @return string
*/
- function OnPrepareUpdate(&$event)
+ function _getPrimaryTranslation($phrase)
{
- $language_id = $this->Application->GetVar('m_lang');
- $label = $this->Application->GetVar('phrases_label');
+ $sql = 'SELECT l' . $this->Application->GetDefaultLanguageId() . '_Translation
+ FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . '
+ WHERE PhraseKey = ' . $this->Conn->qstr( mb_strtoupper($phrase) );
- $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
- $label_idfield = $this->Application->getUnitOption($event->Prefix, 'IDField');
-
- $sql = 'SELECT ' . $label_idfield . '
- FROM ' . $table_name . '
- WHERE Phrase = '.$this->Conn->qstr($label).' AND LanguageId = '.(int)$language_id;
- $this->Application->SetVar($event->getPrefixSpecial() . '_id', $this->Conn->GetOne($sql));
-
- $event->redirect = false;
+ return $this->Conn->GetOne($sql);
}
/**
@@ -156,8 +185,27 @@
{
parent::OnBeforeItemCreate($event);
- $this->_setPhraseKey($event);
- $this->_setLastUpdated($event);
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $primary_language_id = $this->Application->GetDefaultLanguageId();
+
+ if (!$object->GetDBField('l' . $primary_language_id . '_Translation')) {
+ // no translation on primary language -> try to copy from other language
+ $src_languages = Array ('lang_id', 'm_lang'); // editable language, theme language
+
+ foreach ($src_languages as $src_language) {
+ $src_language = $this->Application->GetVar($src_language);
+ $src_value = $src_language ? $object->GetDBField('l' . $src_language . '_Translation') : false;
+
+ if ($src_value) {
+ $object->SetDBField('l' . $primary_language_id . '_Translation', $src_value);
+ break;
+ }
+ }
+ }
+
+ $this->_phraseChanged($event);
}
/**
@@ -169,33 +217,21 @@
{
parent::OnBeforeItemUpdate($event);
- $this->_setPhraseKey($event);
- $this->_setLastUpdated($event);
+ $this->_phraseChanged($event);
}
/**
- * Set's phrase key, used for phrase updating and loading
+ * Set's phrase key and last change info, used for phrase updating and loading
*
* @param kEvent $event
*/
- function _setPhraseKey(&$event)
+ function _phraseChanged(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$object->SetDBField('PhraseKey', mb_strtoupper($object->GetDBField('Phrase')));
- }
- /**
- * Save phrase change date & ip translation was made from
- *
- * @param kEvent $event
- */
- function _setLastUpdated(&$event)
- {
- $object =& $event->getObject();
- /* @var $object kDBItem */
-
if ($object->GetOriginalField('Translation') != $object->GetDBField('Translation')) {
$object->SetDBField('LastChanged_date', adodb_mktime() );
$object->SetDBField('LastChanged_time', adodb_mktime() );
@@ -219,6 +255,78 @@
$fields['Module']['default'] = 'Custom';
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
}
+
+ // make sure, that PrimaryTranslation column always refrers to primary language column
+ $language_id = $this->Application->GetVar('lang_id');
+
+ if (!$language_id) {
+ $language_id = $this->Application->GetVar('m_lang');
+ }
+
+ $primary_language_id = $this->Application->GetDefaultLanguageId();
+ $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields');
+
+ foreach ($calculated_fields[''] as $field_name => $field_expression) {
+ $field_expression = str_replace('%5$s', $language_id, $field_expression);
+ $field_expression = str_replace('%4$s', $primary_language_id, $field_expression);
+
+ $calculated_fields[''][$field_name] = $field_expression;
+ }
+
+ $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields);
+
+ if ($this->Application->GetVar('regional')) {
+ $this->Application->setUnitOption($event->Prefix, 'PopulateMlFields', true);
+ }
}
+ /**
+ * Saves changes & changes language
+ *
+ * @param kEvent $event
+ */
+ function OnPreSaveAndChangeLanguage(&$event)
+ {
+ $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label');
+
+ if ($label && !$this->UseTempTables($event)) {
+ $phrase_id = $this->_getPhraseId($label);
+
+ if ($phrase_id) {
+ $event->CallSubEvent('OnUpdate');
+ $event->SetRedirectParam('opener', 's');
+ }
+ else {
+ $event->CallSubEvent('OnCreate');
+ $event->SetRedirectParam('opener', 's');
+ }
+
+ if ($event->status != erSUCCESS) {
+ return ;
+ }
+
+ $event->SetRedirectParam($event->getPrefixSpecial() . '_event', 'OnPreparePhrase');
+ $event->SetRedirectParam('pass_events', true);
+ }
+
+ if ($this->Application->GetVar('simple_mode')) {
+ $event->SetRedirectParam('simple_mode', 1);
+ }
+
+ parent::OnPreSaveAndChangeLanguage($event);
+ }
+
+ /**
+ * Prepare temp tables and populate it
+ * with items selected in the grid
+ *
+ * @param kEvent $event
+ */
+ function OnEdit(&$event)
+ {
+ parent::OnEdit($event);
+
+ // use language from grid, instead of primary language used by default
+ $event->SetRedirectParam('m_lang', $this->Application->GetVar('m_lang'));
+ }
}
\ No newline at end of file
Index: core/units/users/users_config.php
===================================================================
--- core/units/users/users_config.php (revision 13128)
+++ core/units/users/users_config.php (working copy)
@@ -362,23 +362,24 @@
'Street' => Array('type' => 'string', 'default' => null),
'Street2' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'City' => Array('type' => 'string','default' => null),
- 'State' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options' => Array(),
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => ''),
+ 'State' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array(),
+ 'not_null' => 1,
+ 'default' => ''
+ ),
'Zip' => Array('type' => 'string','default' => null),
- 'Country' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
- 'options_sql'=>'SELECT %1$s
- FROM '.TABLE_PREFIX.'StdDestinations
- LEFT JOIN '.TABLE_PREFIX.'Phrase
- ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
- WHERE
- DestType=1
- AND
- LanguageId = %2$s
- ORDER BY Translation',
- 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
- 'not_null' => '1','default' => ''),
+ 'Country' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options_sql' => ' SELECT %1$s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE DestType = 1
+ ORDER BY l%2$s_Translation',
+ 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation',
+ 'not_null' => 1, 'default' => ''
+ ),
'ResourceId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 1),
'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
missing_perm_section_for_phrases.patch [^] (348 bytes) 2010-02-03 03:44
[Show Content]
Index: phrases_config.php
===================================================================
--- phrases_config.php (revision 13151)
+++ phrases_config.php (working copy)
@@ -58,6 +58,8 @@
),
),
+ 'PermSection' => Array ('main' => 'in-portal:phrases'),
+
'Sections' => Array (
// "Phrases"
'in-portal:phrases' => Array (
language_refactoring_email_event_broken_fix.patch [^] (1,627 bytes) 2010-03-21 16:40
[Show Content]
Index: email_message_helper.php
===================================================================
--- email_message_helper.php (revision 13268)
+++ email_message_helper.php (working copy)
@@ -12,9 +12,9 @@
{
$ret = Array ('Subject' => '', 'Headers' => '', 'Body' => '');
$headers = Array();
- $lines = explode("\n", $text);
+ $lines = explode("\n", $text); // "\n" is lost in process
- foreach ($lines as $line) {
+ foreach ($lines as $line_id => $line) {
if (strlen(trim($line)) == 0 || ($line == '.')) {
break;
}
@@ -30,12 +30,10 @@
$ret['Headers'] = implode("\n", $headers);
- $message_body = '';
- while ((list($line_id, $line) = each($lines))) {
- $message_body .= $line;
- }
+ $lines = array_slice($lines, $line_id + 1);
- $ret['Body'] = $message_body;
+ // add "\n", that was lost before
+ $ret['Body'] = implode("\n", $lines);
return $ret;
}
Index: language_import_helper.php
===================================================================
--- language_import_helper.php (revision 13268)
+++ language_import_helper.php (working copy)
@@ -169,7 +169,7 @@
// copy data from temp tables to live
foreach ($this->_languages as $language_id) {
$this->_performUpgrade($language_id, 'phrases', 'PhraseKey', Array ('l%s_Translation'));
- $this->_performUpgrade($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'l%s_Body'));
+ $this->_performUpgrade($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'MessageType', 'l%s_Body'));
}
$this->_initImportTables(true);
fatal_sql_on_510_upgrade.patch [^] (472 bytes) 2010-04-10 12:07
[Show Content]
Index: upgrades.sql
===================================================================
--- upgrades.sql (revision 13329)
+++ upgrades.sql (working copy)
@@ -1640,9 +1640,9 @@
UPDATE Events e
SET e.l1_Description = (
- SELECT p.Translation
+ SELECT p.l<%PRIMARY_LANGUAGE%>_Translation
FROM <%TABLE_PREFIX%>Phrase p
- WHERE (p.Phrase = e.Description) AND (p.LanguageId = 1)
+ WHERE p.Phrase = e.Description
);
UPDATE Events SET Description = l1_Description;
fatal_sql_on_510_install.patch [^] (940 bytes) 2010-04-11 08:06
[Show Content]
Index: install/install_toolkit.php
===================================================================
--- install/install_toolkit.php (revision 13367)
+++ install/install_toolkit.php (working copy)
@@ -310,8 +310,10 @@
$sqls = str_replace('CREATE TABLE ', 'CREATE TABLE IF NOT EXISTS ' . $table_prefix, $sqls);
$sqls = str_replace('DROP TABLE ', 'DROP TABLE IF EXISTS ' . $table_prefix, $sqls);
$sqls = str_replace('<%TABLE_PREFIX%>', $table_prefix, $sqls);
- $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $this->Application->GetDefaultLanguageId(), $sqls);
+ $primary_language = is_object($this->Application) ? $this->Application->GetDefaultLanguageId() : 1;
+ $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $primary_language, $sqls);
+
if (isset($replace_from) && isset($replace_to)) {
// replace something additionally, e.g. module root category
$sqls = str_replace($replace_from, $replace_to, $sqls);
minor_fixes_for_refactored_translating_system-Dmitry-20100425.patch [^] (1,369 bytes) 2010-04-25 22:08
[Show Content]
Index: core/units/languages/languages_event_handler.php
===================================================================
--- core/units/languages/languages_event_handler.php (revision 13402)
+++ core/units/languages/languages_event_handler.php (working copy)
@@ -248,8 +248,7 @@
$sql = 'UPDATE ' . $this->Application->getUnitOption('emailevents', 'TableName') . '
SET
l' . $dst_language . '_Subject = l' . $src_language . '_Subject,
- l' . $dst_language . '_Body = l' . $src_language . '_Body,
- l' . $dst_language . '_Description = l' . $src_language . '_Description';
+ l' . $dst_language . '_Body = l' . $src_language . '_Body';
$this->Conn->Query($sql);
}
@@ -477,13 +476,18 @@
$object =& $event->getObject();
/* @var $object kDBItem */
+ // clean Events table
$fields_hash = Array (
'l' . $object->GetID() . '_Subject' => NULL,
'l' . $object->GetID() . '_Body' => NULL,
- 'l' . $object->GetID() . '_Description' => NULL,
);
-
$this->Conn->doUpdate($fields_hash, $this->Application->getUnitOption('emailevents', 'TableName'), 1);
+
+ // clean Phrases table
+ $fields_hash = Array (
+ 'l' . $object->GetID() . '_Translation' => NULL,
+ );
+ $this->Conn->doUpdate($fields_hash, $this->Application->getUnitOption('phrases', 'TableName'), 1);
}
/**
missing_label_translate_links.png [^] (9,673 bytes) 2010-04-28 04:49
missing_label_translation_links.patch [^] (575 bytes) 2010-04-28 04:50
[Show Content]
Index: phrases_cache.php
===================================================================
--- phrases_cache.php (revision 13400)
+++ phrases_cache.php (working copy)
@@ -160,7 +160,7 @@
$sql = 'SELECT l' . $this->LanguageId . '_Translation, PhraseKey
FROM ' . TABLE_PREFIX . 'Phrase
- WHERE PhraseId IN (' . implode(',', $ids) . ')';
+ WHERE PhraseId IN (' . implode(',', $ids) . ') AND l' . $this->LanguageId . '_Translation IS NOT NULL';
$this->Phrases = $this->Conn->GetCol($sql, 'PhraseKey');
/*foreach($phrases as $phrase => $tanslation)
|