/**
  * Given a ZurmoConfigurationForm, save the configuration global values.
  */
 public static function setConfigurationFromForm(ZurmoConfigurationForm $form)
 {
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'applicationName', $form->applicationName);
     Yii::app()->timeZoneHelper->setGlobalValue((string) $form->timeZone);
     Yii::app()->pagination->setGlobalValueByType('listPageSize', (int) $form->listPageSize);
     Yii::app()->pagination->setGlobalValueByType('subListPageSize', (int) $form->subListPageSize);
     Yii::app()->pagination->setGlobalValueByType('modalListPageSize', (int) $form->modalListPageSize);
     Yii::app()->pagination->setGlobalValueByType('dashboardListPageSize', (int) $form->dashboardListPageSize);
     EmailHelper::setDefaultFromAddress($form->defaultFromEmailAddress);
     EmailHelper::setDefaultTestToAddress($form->defaultTestToEmailAddress);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'gamificationModalNotificationsEnabled', (bool) $form->gamificationModalNotificationsEnabled);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'gamificationModalCollectionsEnabled', (bool) $form->gamificationModalCollectionsEnabled);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'gamificationModalCoinsEnabled', (bool) $form->gamificationModalCoinsEnabled);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'realtimeUpdatesEnabled', (bool) $form->realtimeUpdatesEnabled);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'reCaptchaPrivateKey', $form->reCaptchaPrivateKey);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'reCaptchaPublicKey', $form->reCaptchaPublicKey);
 }
Ejemplo n.º 2
0
 public function testSetDefaultFromAddress()
 {
     $content = Yii::app()->emailHelper->resolveAndGetDefaultFromAddress();
     $this->assertEquals('*****@*****.**', $content);
     EmailHelper::setDefaultFromAddress($content);
     $metadata = ZurmoModule::getMetadata();
     $this->assertEquals('*****@*****.**', $metadata['global']['defaultFromAddress']);
 }