Sfoglia il codice sorgente

#73 - Modules autoupdate, email templates.

AntonLV 12 anni fa
parent
commit
4eb3a69ec8

+ 3 - 1
inc/classes/BxDolCronUpgradeModulesCheck.php

@@ -17,12 +17,14 @@ class BxDolCronUpgradeModulesCheck extends BxDolCron
             return;
 
         $o = bx_instance('BxDolUpgraderModules');
-        if (!$o->prepare()) {            
+        if(!$o->prepare()) {
             sendMailTemplateSystem('t_UpgradeFailed', array (
                 'error_msg' => $o->getError(),
             ));
             setParam('sys_autoupdate_modules', ''); // disable auto-update if it is failed
         }
+        else
+        	sendMailTemplateSystem('t_UpgradeModulesSuccess');
     }
 }
 

+ 7 - 6
install/sql/system.sql

@@ -148,8 +148,9 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 ('system', '_sys_et_txt_name_profile_change_status_active', 't_ChangeStatusActive', '_sys_et_txt_subject_profile_change_status_active', '_sys_et_txt_body_profile_change_status_active'),
 ('system', '_sys_et_txt_name_profile_change_status_suspended', 't_ChangeStatusSuspended', '_sys_et_txt_subject_profile_change_status_suspended', '_sys_et_txt_body_profile_change_status_suspended'),
 ('system', '_sys_et_txt_name_profile_change_status_pending', 't_ChangeStatusPending', '_sys_et_txt_subject_profile_change_status_pending', '_sys_et_txt_body_profile_change_status_pending'),
-('system', '_sys_et_txt_upgrade_failed', 't_UpgradeFailed', '_sys_et_txt_subject_upgrade_failed', '_sys_et_txt_body_upgrade_failed'),
-('system', '_sys_et_txt_upgrade_success', 't_UpgradeSuccess', '_sys_et_txt_subject_upgrade_success', '_sys_et_txt_body_upgrade_success');
+('system', '_sys_et_txt_name_upgrade_failed', 't_UpgradeFailed', '_sys_et_txt_subject_upgrade_failed', '_sys_et_txt_body_upgrade_failed'),
+('system', '_sys_et_txt_name_upgrade_success', 't_UpgradeSuccess', '_sys_et_txt_subject_upgrade_success', '_sys_et_txt_body_upgrade_success'),
+('system', '_sys_et_txt_name_upgrade_modules_success', 't_UpgradeModulesSuccess', '_sys_et_txt_subject_upgrade_modules_success', '_sys_et_txt_body_upgrade_modules_success');
 
 -- --------------------------------------------------------
 
@@ -217,6 +218,10 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 (@iCategoryId, 'sys_install_time', '', '0', 'digit', '', '', '', 3),
 (@iCategoryId, 'sys_oauth_user', '', '0', 'digit', '', '', '', 4),
 
+(@iCategoryId, 'sys_ftp_login', '_adm_stg_cpt_option_sys_ftp_login', '', 'digit', '', '', '', 10),
+(@iCategoryId, 'sys_ftp_password', '_adm_stg_cpt_option_sys_ftp_password', '', 'digit', '', '', '', 11),
+(@iCategoryId, 'sys_ftp_dir', '_adm_stg_cpt_option_sys_ftp_dir', '', 'digit', '', '', '', 12),
+
 (@iCategoryId, 'sys_site_logo', '', '0', 'digit', '', '', '', 20),
 (@iCategoryId, 'sys_site_logo_alt', '_adm_dsg_txt_alt_text', '0', 'text', '', '', '', 21),
 (@iCategoryId, 'sys_site_icon', '', '0', 'digit', '', '', '', 22),
@@ -295,10 +300,6 @@ INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `or
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'sys_ftp_login', '_adm_stg_cpt_option_sys_ftp_login', '', 'digit', '', '', '', 10),
-(@iCategoryId, 'sys_ftp_password', '_adm_stg_cpt_option_sys_ftp_password', '', 'digit', '', '', '', 11),
-(@iCategoryId, 'sys_ftp_dir', '_adm_stg_cpt_option_sys_ftp_dir', '', 'digit', '', '', '', 12),
-
 (@iCategoryId, 'sys_oauth_key', '_adm_stg_cpt_option_sys_oauth_key', '', 'digit', '', '', '', 20),
 (@iCategoryId, 'sys_oauth_secret', '_adm_stg_cpt_option_sys_oauth_secret', '', 'digit', '', '', '', 21),
 

+ 8 - 1
modules/boonex/english/data/langs/system.xml

@@ -1485,12 +1485,15 @@ If it is not enabled then please consider implement this optimization, since it
 <p>{pruning_output}</p>
 <bx_include_auto:_email_footer.html />]]></string>
 	<string name="_sys_et_txt_body_upgrade_failed"><![CDATA[<bx_include_auto:_email_header.html />
-<p>Site upgrade failed due to the following error:</p>
+<p>Upgrade failed due to the following error:</p>
 <p>{error_msg}</p>
 <bx_include_auto:_email_footer.html />]]></string>
 	<string name="_sys_et_txt_body_upgrade_success"><![CDATA[<bx_include_auto:_email_header.html />
 <p>Site was successfully upgraded to {new_version}.</p>
 {conclusion}
+<bx_include_auto:_email_footer.html />]]></string>
+	<string name="_sys_et_txt_body_upgrade_modules_success"><![CDATA[<bx_include_auto:_email_header.html />
+<p>Modules were successfully upgraded.</p>
 <bx_include_auto:_email_footer.html />]]></string>
 	<string name="_sys_et_txt_name_system_admin_email"><![CDATA[Message sending from the Admin Panel]]></string>
 	<string name="_sys_et_txt_name_system_comment_replied"><![CDATA[The letter is sent to members whose comment was replied]]></string>
@@ -1504,6 +1507,9 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_et_txt_name_profile_change_status_pending"><![CDATA[Profile status changed to pending]]></string>
 	<string name="_sys_et_txt_name_profile_change_status_suspended"><![CDATA[Profile status changed to suspended]]></string>
 	<string name="_sys_et_txt_name_system_pruning"><![CDATA[Pruning result]]></string>
+	<string name="_sys_et_txt_name_upgrade_failed"><![CDATA[Upgrade failed]]></string>
+	<string name="_sys_et_txt_name_upgrade_success"><![CDATA[Site upgrade success]]></string>
+	<string name="_sys_et_txt_name_upgrade_modules_success"><![CDATA[Modules upgrade success]]></string>
 	<string name="_sys_et_txt_subject_admin_email"><![CDATA[Message from <SiteName> Admin: <MessageSubject>]]></string>
 	<string name="_sys_et_txt_subject_comment_replied"><![CDATA[Your comment was replied]]></string>
 	<string name="_sys_et_txt_subject_confirmation"><![CDATA[Confirm Your Email (ACTION REQUIRED)]]></string>
@@ -1518,6 +1524,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_et_txt_subject_pruning"><![CDATA[{site_name} pruning result]]></string>
 	<string name="_sys_et_txt_subject_upgrade_failed"><![CDATA[{site_name} upgrade failed]]></string>
 	<string name="_sys_et_txt_subject_upgrade_success"><![CDATA[{site_name} upgrade success]]></string>
+	<string name="_sys_et_txt_subject_upgrade_modules_success"><![CDATA[Modules upgrade success]]></string>
 	<string name="_sys_et_txt_unsubscribe"><![CDATA[Unsubscribe]]></string>
 	<string name="_sys_form_account"><![CDATA[Account]]></string>
 	<string name="_sys_form_account_input_captcha"><![CDATA[Security Image]]></string>