diff --git a/application/config/version.php b/application/config/version.php index 6b02becf49a..7ca7ac0fe5f 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -11,10 +11,10 @@ * See COPYRIGHT.php for copyright notices and details. */ -$config['versionnumber'] = '4.4.0-RC2'; +$config['versionnumber'] = '4.4.0-RC3'; $config['dbversionnumber'] = 436; $config['buildnumber'] = ''; $config['updatable'] = true; $config['templateapiversion'] = 3; -$config['assetsversionnumber'] = '30179'; +$config['assetsversionnumber'] = '30180'; return $config; diff --git a/application/controllers/admin/globalsettings.php b/application/controllers/admin/globalsettings.php index ffcb5835b0c..52a70e2e146 100644 --- a/application/controllers/admin/globalsettings.php +++ b/application/controllers/admin/globalsettings.php @@ -279,7 +279,7 @@ private function _saveSettings() SettingGlobal::setSetting('emailmethod', strip_tags(Yii::app()->getRequest()->getPost('emailmethod'))); SettingGlobal::setSetting('emailsmtphost', strip_tags(returnGlobal('emailsmtphost'))); if (returnGlobal('emailsmtppassword') != 'somepassword') { - SettingGlobal::setSetting('emailsmtppassword', LSActiveRecord::encryptSingle(strip_tags(returnGlobal('emailsmtppassword')))); + SettingGlobal::setSetting('emailsmtppassword', LSActiveRecord::encryptSingle(returnGlobal('emailsmtppassword'))); } SettingGlobal::setSetting('bounceaccounthost', strip_tags(returnGlobal('bounceaccounthost'))); SettingGlobal::setSetting('bounceaccounttype', Yii::app()->request->getPost('bounceaccounttype', 'off')); @@ -287,7 +287,7 @@ private function _saveSettings() SettingGlobal::setSetting('bounceaccountuser', strip_tags(returnGlobal('bounceaccountuser'))); if (returnGlobal('bounceaccountpass') != 'enteredpassword') { - SettingGlobal::setSetting('bounceaccountpass', LSActiveRecord::encryptSingle(strip_tags(returnGlobal('bounceaccountpass')))); + SettingGlobal::setSetting('bounceaccountpass', LSActiveRecord::encryptSingle(returnGlobal('bounceaccountpass'))); } SettingGlobal::setSetting('emailsmtpssl', sanitize_paranoid_string(Yii::app()->request->getPost('emailsmtpssl', ''))); diff --git a/application/controllers/admin/tokens.php b/application/controllers/admin/tokens.php index b95a7537ff3..234d80ed015 100644 --- a/application/controllers/admin/tokens.php +++ b/application/controllers/admin/tokens.php @@ -2437,7 +2437,9 @@ public function bouncesettings($iSurveyId) if (Yii::app()->request->getPost('bounceprocessing') == 'L') { $fieldvalue['bounceaccountencryption'] = Yii::app()->request->getPost('bounceaccountencryption'); $fieldvalue['bounceaccountuser'] = Yii::app()->request->getPost('bounceaccountuser'); - $fieldvalue['bounceaccountpass'] = LSActiveRecord::encryptSingle(Yii::app()->request->getPost('bounceaccountpass')); + if (Yii::app()->request->getPost('bounceaccountpass')!='somepassword'){ + $fieldvalue['bounceaccountpass'] = LSActiveRecord::encryptSingle(Yii::app()->request->getPost('bounceaccountpass')); + } $fieldvalue['bounceaccounttype'] = Yii::app()->request->getPost('bounceaccounttype'); $fieldvalue['bounceaccounthost'] = Yii::app()->request->getPost('bounceaccounthost'); } diff --git a/application/extensions/TopbarWidget/views/includes/listquestionsTopbarLeft_view.php b/application/extensions/TopbarWidget/views/includes/listquestionsTopbarLeft_view.php index aab3d0519aa..905690305b1 100644 --- a/application/extensions/TopbarWidget/views/includes/listquestionsTopbarLeft_view.php +++ b/application/extensions/TopbarWidget/views/includes/listquestionsTopbarLeft_view.php @@ -22,7 +22,7 @@ - createUrl("questionAdministration/create/surveyid/".$oSurvey->sid); ?>' role="button"> diff --git a/application/helpers/questionHelper.php b/application/helpers/questionHelper.php index b9704c816e5..99fe37248d9 100644 --- a/application/helpers/questionHelper.php +++ b/application/helpers/questionHelper.php @@ -1043,7 +1043,7 @@ public static function getAttributesDefinitions() 'options'=>array(0=>gT('No'), 1=>gT('Yes')), 'default'=>0, "help"=>gT('Add a button to reset the slider. If you choose an start value, it reset at start value, else empty the answer.'), - "caption"=>gT('Allow reset the slider') + "caption"=>gT('Allow slider reset') ); self::$attributes["slider_showminmax"] = array( diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index d8325f0c9d0..cdce058703a 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -2854,8 +2854,10 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false) if($iOldDBVersion < 412) { $oTransaction = $oDB->beginTransaction(); - $aGroups = array_keys(SurveysGroups::model()->findAll(array('index'=>'gsid'))); - $aGroupSettings = array_keys(SurveysGroupsettings::model()->findAll(array('index'=>'gsid'))); + $sSurveyGroupQuery = "SELECT gsid from {{surveys_groups}} order by gsid"; + $aGroups = $oDB->createCommand($sSurveyGroupQuery)->queryColumn(); + $sSurveyGroupSettingsQuery = "SELECT gsid from {{surveys_groupsettings}} order by gsid"; + $aGroupSettings = $oDB->createCommand($sSurveyGroupSettingsQuery)->queryColumn(); foreach ($aGroups as $group){ if (!array_key_exists($group, $aGroupSettings)){ $settings = new SurveysGroupsettings; @@ -2909,11 +2911,11 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false) // encrypt bounceaccountpass value in db alterColumn('{{surveys}}','bounceaccountpass',"text",true,'NULL'); - $aSurveys = Survey::model()->findAll(); - foreach($aSurveys as $oSurvey){ - if (!empty($oSurvey->bounceaccountpass)){ - $oSurvey->bounceaccountpass = LSActiveRecord::encryptSingle($oSurvey->bounceaccountpass); - $oSurvey->save(); + $sSurveyQuery = "SELECT * from {{surveys}} order by sid"; + $aSurveys = $oDB->createCommand($sSurveyQuery)->queryAll(); + foreach ( $aSurveys as $aSurvey ) { + if (!empty($aSurvey['bounceaccountpass'])){ + $oDB->createCommand()->update('{{surveys}}',['bounceaccountpass'=>LSActiveRecord::encryptSingle($aSurvey->bounceaccountpass)],"sid=".$aSurvey[sid]); } } @@ -3459,6 +3461,15 @@ function ($v) { $oDB->createCommand()->update('{{settings_global}}', array('stg_value' => 435), "stg_name='DBVersion'"); $oTransaction->commit(); } + + if ($iOldDBVersion < 436) { + $oTransaction = $oDB->beginTransaction(); + $oDB->createCommand()->update('{{boxes}}', array('url' => 'themeOptions'), "url='admin/themeoptions'"); + $oDB->createCommand()->update('{{settings_global}}', array('stg_value' => 436), "stg_name='DBVersion'"); + $oTransaction->commit(); + } + + if($iOldDBVersion < 436){ $oTransaction = $oDB->beginTransaction(); //refactore controller assessment (surveymenu_entry link changes to new controller rout) diff --git a/application/models/Permission.php b/application/models/Permission.php index 4b6fabd9bf2..abdd7cf908a 100644 --- a/application/models/Permission.php +++ b/application/models/Permission.php @@ -487,7 +487,7 @@ public function copySurveyPermissions($iSurveyIDSource, $iSurveyIDTarget) * @param string $sEntityName string The entity name * @param $sPermission string Name of the permission * @param $sCRUD string The permission detail you want to check on: 'create','read','update','delete','import' or 'export' - * @param $iUserID integer User ID - if not given the one of the current user is used + * @param $iUserID integer User ID - if not given the one of the current user is used, 0 is used for role permission (not related to user) * @return bool True if user has the permission */ public function hasPermission($iEntityID, $sEntityName, $sPermission, $sCRUD = 'read', $iUserID = null, $iPermissionRoleId = null) @@ -539,7 +539,7 @@ public function hasPermission($iEntityID, $sEntityName, $sPermission, $sCRUD = ' /* Always return true if you are the owner : this can be done in core plugin ? */ // TODO: give the rights to owner adding line in permissions table, so it will return true with the normal way - if ($iUserID == $this->getEntityOwnerId($iEntityID, $sEntityName) && $sEntityName != 'role') { + if ($iUserID === $this->getEntityOwnerId($iEntityID, $sEntityName)) { return true; } @@ -701,6 +701,7 @@ public function hasSurveysInGroupPermission($iSurveyGroupId, $sPermission, $sCRU */ public function hasRolePermission($iRoleId, $sPermission, $sCRUD = 'read') { + /* Get permission foor user id = 0 */ return $this->hasPermission($iRoleId, 'role', $sPermission, $sCRUD, 0); } @@ -764,7 +765,7 @@ public static function getUserRole($iUserID) protected function getEntityOwnerId($iEntityID, $sEntityName) { /* know invalid entity */ - if (in_array($sEntityName, array('global','template'))) { + if (in_array($sEntityName, array('global','template','role',))) { return null; } /* allow to get it dynamically from any model */ diff --git a/application/models/SurveysGroups.php b/application/models/SurveysGroups.php index 006ecdf2f75..25e705a507e 100644 --- a/application/models/SurveysGroups.php +++ b/application/models/SurveysGroups.php @@ -11,7 +11,7 @@ * @property integer $sortorder * @property integer $owner_id * @property integer $parent_id - * @property boolean $alwaysavailable + * @property boolean|integer $alwaysavailable * @property string $created * @property string $modified * @property integer $created_by @@ -20,6 +20,10 @@ */ class SurveysGroups extends LSActiveRecord { + + /* @var boolean|integer alwaysavailable : set default, and set for old DB , usage of integer for DB compatibility */ + public $alwaysavailable = 0; + /** * @return string the associated database table name */ diff --git a/application/models/Token.php b/application/models/Token.php index 204367c15d6..bb181c56ff5 100644 --- a/application/models/Token.php +++ b/application/models/Token.php @@ -405,8 +405,8 @@ public function rules() array('usesleft', 'numerical', 'integerOnly'=>true, 'allowEmpty'=>true, 'min'=>-2147483647, 'max'=>2147483647), array('mpid', 'numerical', 'integerOnly'=>true, 'allowEmpty'=>true), array('blacklisted', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), - array('validfrom', 'date','format'=>['yyyy-M-d H:m:s','yyyy-M-d H:m'],'allowEmpty'=>true), - array('validuntil','date','format'=>['yyyy-M-d H:m:s','yyyy-M-d H:m'],'allowEmpty'=>true), + array('validfrom', 'date','format'=>['yyyy-M-d H:m:s.???','yyyy-M-d H:m:s','yyyy-M-d H:m'],'allowEmpty'=>true), + array('validuntil','date','format'=>['yyyy-M-d H:m:s.???','yyyy-M-d H:m:s','yyyy-M-d H:m'],'allowEmpty'=>true), array('emailstatus', 'default', 'value' => 'OK'), ); foreach (decodeTokenAttributes($this->survey->attributedescriptions) as $key => $info) { diff --git a/application/views/admin/token/bounce.php b/application/views/admin/token/bounce.php index 109baf00493..818162fb628 100644 --- a/application/views/admin/token/bounce.php +++ b/application/views/admin/token/bounce.php @@ -84,7 +84,7 @@
- +
diff --git a/application/views/survey/questions/answer/multiplenumeric/config.xml b/application/views/survey/questions/answer/multiplenumeric/config.xml index 664139a4e9c..56b33a5f1ce 100644 --- a/application/views/survey/questions/answer/multiplenumeric/config.xml +++ b/application/views/survey/questions/answer/multiplenumeric/config.xml @@ -736,7 +736,7 @@ 0 Add a button to reset the slider. If you choose an start value, it reset at start value, else empty the answer. - Allow reset the slider + Allow slider reset diff --git a/docs/release_notes.txt b/docs/release_notes.txt index c3334bbd242..2be0c62fb94 100644 --- a/docs/release_notes.txt +++ b/docs/release_notes.txt @@ -34,6 +34,15 @@ Thank you to everyone who helped with this new release! CHANGE LOG ------------------------------------------------------ +Changes from 4.4.0-RC2 (build 210104) to 4.4.0-RC3 (build 210112) January 11, 2021 +-Fixed issue: Database error when username or user full name too long (Carsten Schmitz) +-Fixed issue: Database error when survey title too long (Carsten Schmitz) +-Fixed issue #15611: No HTML wrapper in public stats (#1696) (Gabriel Jenik) +#Updated translation: Romanian by c_schmitz, filipguttman, enedelcu, cdorin +#Updated translation: Portuguese (Portugal) by samarta +#Updated translation: Japanese by nomoto + + Changes from 4.4.0-RC1 (build 201223) to 4.4.0-RC2 (build 210104) January 4, 2021 +New feature #16779: Keep graph on same statistics PDF page if possible (GabrielJenik) -Fixed issue #16932: When creating a survey with the default demo contents, the process halts (GabrielJenik)