/**
  * Test if we can dynamically extend the R-facade.
  * 
  * @return void
  */
 public function testDynamicPlugins()
 {
     testpack('Test dynamic plugins');
     //basic behaviour
     R::ext('makeTea', function () {
         return 'sorry cant do that!';
     });
     asrt(R::makeTea(), 'sorry cant do that!');
     //with parameters
     R::ext('multiply', function ($a, $b) {
         return $a * $b;
     });
     asrt(R::multiply(3, 4), 12);
     //can we call R inside?
     R::ext('singVersion', function () {
         return R::getVersion() . ' lalala !';
     });
     asrt(R::singVersion(), R::getVersion() . ' lalala !');
     //should also work with RedBean_Facade
     asrt(RedBean_Facade::singVersion(), R::getVersion() . ' lalala !');
     //test error handling
     try {
         R::ext('---', function () {
         });
         fail();
     } catch (RedBean_Exception $e) {
         asrt($e->getMessage(), 'Plugin name may only contain alphanumeric characters.');
     }
     try {
         R::__callStatic('---', function () {
         });
         fail();
     } catch (RedBean_Exception $e) {
         asrt($e->getMessage(), 'Plugin name may only contain alphanumeric characters.');
     }
     try {
         R::invalidMethod();
         fail();
     } catch (RedBean_Exception $e) {
         asrt($e->getMessage(), 'Plugin \'invalidMethod\' does not exist, add this plugin using: R::ext(\'invalidMethod\')');
     }
 }
 public function handleLibraryCompatibilityCheck($event)
 {
     $basePath = Yii::app()->getBasePath();
     require_once "{$basePath}/../../redbean/rb.php";
     $redBeanVersion = R::getVersion();
     $yiiVersion = YiiBase::getVersion();
     if ($redBeanVersion != Yii::app()->params['redBeanVersion']) {
         echo Zurmo::t('ZurmoModule', 'Your RedBean version is currentVersion and it should be acceptableVersion.', array('currentVersion' => $redBeanVersion, 'acceptableVersion' => Yii::app()->params['redBeanVersion']));
         Yii::app()->end(0, false);
     }
     if ($yiiVersion != Yii::app()->params['yiiVersion']) {
         echo Zurmo::t('ZurmoModule', 'Your Yii version is currentVersion and it should be acceptableVersion.', array('currentVersion' => $yiiVersion, 'acceptableVersion' => Yii::app()->params['yiiVersion']));
         Yii::app()->end(0, false);
     }
 }
Example #3
0
 public static function checkRedBean($minimumRequiredVersion, &$actualVersion)
 {
     $actualVersion = R::getVersion();
     if ($actualVersion !== null) {
         return self::checkVersion($minimumRequiredVersion, $actualVersion);
     }
     return false;
 }
 /**
  * Test version info.
  * 
  * @return void
  */
 public function testVersion()
 {
     $version = R::getVersion();
     asrt(is_string($version), TRUE);
 }
Example #5
0
    protected function renderContent()
    {
        $zurmoVersion = self::getZurmoVersionDisplayContent();
        $yiiVersion = YiiBase::getVersion();
        if (method_exists('R', 'getVersion')) {
            $redBeanVersion = R::getVersion();
        } else {
            $redBeanVersion = '< 1.2.9.1';
        }
        // Begin Not Coding Standard
        $content = '<div>
                            <h1>Zurmo Open Source CRM</h1>';
        $content .= '<div id="aboutText" class="clearfix">
                            <div id="leftCol">
                                <div id="ZurmoLogo" class="zurmo-logo"></div>
                                <div><p>';
        $content .= Zurmo::t('ZurmoModule', '<strong>Zurmo</strong> is a <strong>Customer Relationship Management</strong> system by <strong>Zurmo Inc.</strong>');
        $content .= '</p><p>';
        $content .= Zurmo::t('ZurmoModule', 'Visit the <strong>Zurmo Open Source Project</strong> at {url}.', array('{url}' => '<a href="http://www.zurmo.org">http://www.zurmo.org</a>'));
        $content .= '<br/>';
        $content .= '</p>';
        $content .= '<p>';
        $content .= Zurmo::t('ZurmoModule', 'Visit <strong>Zurmo Inc.</strong> at {url}.', array('{url}' => '<a href="http://www.zurmo.com">http://www.zurmo.com</a>'));
        $content .= '<br/>';
        $content .= '</p>';
        $content .= '<p>';
        $content .= Zurmo::t('ZurmoModule', '<strong>Zurmo</strong> is licensed under the AGPLv3.  You can read the license <a href="http://www.zurmo.org/license">here</a>.');
        $content .= '</p></div>
                            <div>
                                <h3>Core Team</h3>
                                <ul>
                                    <li>Amit Ashckenazi</li>
                                    <li>Laura Engel</li>
                                    <li>Jason Green</li>
                                    <li>Stafford McKay</li>
                                    <li>Ivica Nedeljkovic</li>
                                    <li>Nilesh Patkar</li>
                                    <li>Ross Peetoom</li>
                                    <li>Ray Stoeckicht</li>
                                </ul>
                            </div>
                            <div>
                                <h3>Special Thanks</h3>
                                <ul>
                                    <li>Richard Baldwin  - CRM Processes</li>
                                    <li>Nev Delap        - Infrastructure</li>
                                    <li>Sergey Fayngold  - Language Infrastructure</li>
                                    <li>Theresa Neil     - User Interface Design</li>
                                    <li>Sérgio Peixoto   - Portuguese Translation and Development</li>
                                    <li>Mandy Robinson   - Icons</li>
                                    <li>Sacha Telgenhof  - Language Infrastructure</li>
                                    <li>Subtle Patterns  - Background Textures</li>
                                </ul>
                            </div>
                        </div>';
        $content .= '<div id="rightCol">';
        $content .= static::renderSocialLinksContent();
        $content .= '<div><h3>Application Info</h3><p>';
        $content .= Zurmo::t('ZurmoModule', 'This is <strong>version {zurmoVersion}</strong> of <strong>Zurmo</strong>.', array('{zurmoVersion}' => $zurmoVersion));
        $content .= '</p>';
        $content .= '<p>';
        $content .= Zurmo::t('ZurmoModule', '<strong>Zurmo</strong> uses the following great Open Source tools and frameworks:');
        $content .= '<ul>';
        $content .= '<li>';
        $content .= Zurmo::t('ZurmoModule', '{url} (version {version} is installed)', array('{url}' => '<a href="http://www.yiiframework.com">Yii Framework</a>', '{version}' => $yiiVersion));
        $content .= '</li>';
        $content .= '<li>';
        $content .= Zurmo::t('ZurmoModule', '{url} (version {version} is installed)', array('{url}' => '<a href="http://www.redbeanphp.com">RedBeanPHP ORM</a>', '{version}' => $redBeanVersion));
        $content .= '</li>';
        $content .= '<li>';
        $content .= '<a href="http://www.jquery.com">jQuery JavaScript Framework</a> (with Yii)';
        $content .= '</li>';
        $content .= '</ul></p></div>
                <div>
                    <script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
                    <script>
                    new TWTR.Widget(
                    {
                      version: 2,
                      type: "profile",
                      rpp: 4,
                      interval: 30000,
                      width: "auto",
                      height: 300,
                      theme:
                      {
                        shell:
                        {
                          background: "#f4f4f4",
                          color: "#262777"
                        }
                        ,
                        tweets:
                        {
                          background: "#f4f4f4",
                          color: "#545454",
                          links: "#262777"
                        }
                      }
                      ,
                      features:
                      {
                        scrollbar: false,
                        loop: false,
                        live: false,
                        behavior: "all"
                      }
                    }).render().setUser("ZurmoCRM").start();
                    </script>
                </div>
            </div>

            <div id="aboutContactDetails">
                <p>
                    Zurmo Inc. <span>|</span>
                    <strong>Phone: </strong> (888) 435.2221 <span>|</span>
                    <strong>Address: </strong> 27 North Wacker Drive Suite 370, Chicago, IL 60606
                </p>
            </div>';
        $content .= '</div></div>';
        // End Not Coding Standard
        return $content;
    }