AntonLV 12 лет назад
Родитель
Сommit
3507b9c8f8

+ 0 - 2
inc/classes/BxDolCronUpgradeModulesCheck.php

@@ -23,8 +23,6 @@ class BxDolCronUpgradeModulesCheck extends BxDolCron
             ));
             setParam('sys_autoupdate_modules', ''); // disable auto-update if it is failed
         }
-        else
-        	sendMailTemplateSystem('t_UpgradeModulesSuccess');
     }
 }
 

+ 19 - 0
inc/classes/BxDolUpgraderModules.php

@@ -19,6 +19,7 @@ class BxDolUpgraderModules extends BxDolUpgrader
         bx_import('BxDolStudioInstallerUtils');
         $oInstallerUtils = BxDolStudioInstallerUtils::getInstance();
 
+        $aUpdated = array();
         while(true) {
         	$aUpdates = $oInstallerUtils->checkUpdates();
 	        foreach($aUpdates as $aUpdate) {
@@ -39,6 +40,8 @@ class BxDolUpgraderModules extends BxDolUpgrader
         			$this->setError($aResult['message']);
         			break;
         		}
+        		else 
+        			$aUpdated[$aUpdate['module_name']] = $aUpdate['version_to'];
         	}
 
         	break;
@@ -46,6 +49,22 @@ class BxDolUpgraderModules extends BxDolUpgrader
 
         umask($iUmaskSave);
 
+        if(!empty($aUpdated)) {
+        	bx_import('BxDolModuleQuery');
+			$oModuleQuery = BxDolModuleQuery::getInstance();
+
+        	$sUpdated = '';
+        	foreach($aUpdated as $sModule => $sVersion) {
+        		$aModule = $oModuleQuery->getModuleByName($sModule);
+
+        		$sUpdated .= _t('_sys_et_txt_body_upgraded_module', $aModule['title'], $sVersion);
+        	}
+
+        	sendMailTemplateSystem('t_UpgradeModulesSuccess', array (
+                'conclusion' => $sUpdated,
+            ));
+        }
+
         return $this->getError() ? false : true;
     }
 }

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

@@ -1494,8 +1494,10 @@ If it is not enabled then please consider implement this optimization, since it
 {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>
+<p>The following modules were successfully upgraded.</p>
+{conclusion}
 <bx_include_auto:_email_footer.html />]]></string>
+	<string name="_sys_et_txt_body_upgraded_module"><![CDATA[<b>{0}</b> module: up to {1} version.<br />]]></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>
 	<string name="_sys_et_txt_name_system_confirmation"><![CDATA[Profile e-mail confirmation message]]></string>