application/Espo/Services/AdminNotifications.php
public function jobCheckNewVersion($data)
    {
        $config = $this->getConfig();

        if (!$config->get('adminNotifications') || !$config->get('adminNotificationsNewVersion')) {
            return true;
        }

        $latestRelease = $this->getLatestRelease();
        if (empty($latestRelease['version'])) {
            $config->set('latestVersion', $latestRelease['version']);
            $config->save();
            return true;
        }

        if ($config->get('latestVersion') != $latestRelease['version']) {
            $config->set('latestVersion', $latestRelease['version']);

            if (!empty($latestRelease['notes'])) {
                //todo: create notification
            }

            $config->save();
            return true;
        }

        if (!empty($latestRelease['notes'])) {
            //todo: find and modify notification
        }

        return true;
    }
public function jobCheckNewVersion($data)
    {
        $config = $this->getConfig();

        if (!$config->get('adminNotifications') || !$config->get('adminNotificationsNewVersion')) {
            return true;
        }

        $latestRelease = $this->getLatestRelease();
        if (empty($latestRelease['version'])) {
            $config->set('latestVersion', $latestRelease['version']);
            $config->save();
            return true;
        }

        if ($config->get('latestVersion') != $latestRelease['version']) {
            $config->set('latestVersion', $latestRelease['version']);

            if (!empty($latestRelease['notes'])) {
                //todo: create notification
            }

            $config->save();
            return true;
        }

        if (!empty($latestRelease['notes'])) {
            //todo: find and modify notification
        }

        return true;
    }
public function jobCheckNewVersion ( $ data ) { $ config = $ this -> getConfig ( ) ; if ( ! $ config -> get ( 'adminNotifications' ) || ! $ config -> get ( 'adminNotificationsNewVersion' ) ) { return true ; } $ latestRelease = $ this -> getLatestRelease ( ) ; if ( empty ( $ latestRelease [ 'version' ] ) ) { $ config -> set ( 'latestVersion' , $ latestRelease [ 'version' ] ) ; $ config -> save ( ) ; return true ; } if ( $ config -> get ( 'latestVersion' ) != $ latestRelease [ 'version' ] ) { $ config -> set ( 'latestVersion' , $ latestRelease [ 'version' ] ) ; if ( ! empty ( $ latestRelease [ 'notes' ] ) ) { //todo: create notification } $ config -> save ( ) ; return true ; } if ( ! empty ( $ latestRelease [ 'notes' ] ) ) { //todo: find and modify notification } return true ; }
Job for checking a new version of EspoCRM

@param  object $data

@return boolean
Job for checking a new version of EspoCRM