Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 6, 2021
2 parents 9c6411c + 7f22568 commit 2cf312e
Show file tree
Hide file tree
Showing 95 changed files with 1,011 additions and 720 deletions.
4 changes: 2 additions & 2 deletions application/config/config-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@
$config['userthemerootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR."themes".DIRECTORY_SEPARATOR."survey"; // The directory path of the user themes
$config['usertwigextensionrootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR."twig".DIRECTORY_SEPARATOR."extensions"; // The directory path of the user custom twig extensions
$config['userquestionthemedir'] = "themes".DIRECTORY_SEPARATOR."question"; // The directory containing the user's question themes.
$config['userquestionthemerootdir'] = "upload".DIRECTORY_SEPARATOR.$config['userquestionthemedir']; // The directory containing the user's question themes.
$config['userfontsrootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR.'fonts'; // The directory containing the user's fonts.
$config['userquestionthemerootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR.$config['userquestionthemedir']; // The directory containing the user's question themes.
$config['userfontsrootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR.'fonts'; // The directory containing the user's fonts.

$config['lsadminmodulesrootdir'] = $config['rootdir'].DIRECTORY_SEPARATOR."modules".DIRECTORY_SEPARATOR."admin";
//Overwrite files with the same name on upload?
Expand Down
4 changes: 2 additions & 2 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* See COPYRIGHT.php for copyright notices and details.
*/

$config['versionnumber'] = '4.4.14';
$config['versionnumber'] = '4.4.16';
$config['dbversionnumber'] = 443;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
$config['assetsversionnumber'] = '30197';
$config['assetsversionnumber'] = '30199';
return $config;
4 changes: 2 additions & 2 deletions application/controllers/LimereplacementfieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ private function getReplacementFields($fieldtype, $surveyid)
) {
// these 2 fields are supported by email-inv and email-rem
// but not email-reg for the moment
$replFields['EMAIL'] = gT("Participant Email address");
$replFields['TOKEN'] = gT("Participant Access code");
$replFields['EMAIL'] = gT("Participant - Email address");
$replFields['TOKEN'] = gT("Participant - Access code");
$replFields['OPTOUTURL'] = gT("Participant - Opt-out URL");
$replFields['OPTINURL'] = gT("Participant - Opt-in URL");
$replFields['FIRSTNAME'] = gT("Participant - First name");
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/QuestionAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ public function actionImportView($surveyid, $groupid = null)
$aData['sidemenu']['questiongroups'] = true;
$aData['surveybar']['closebutton']['url'] = '/questionGroupsAdministration/listquestiongroups/surveyid/' . $iSurveyID; // Close button
$aData['surveybar']['savebutton']['form'] = true;
$aData['surveybar']['savebutton']['text'] = gt('Import');
$aData['surveybar']['savebutton']['text'] = gT('Import');
$aData['sid'] = $iSurveyID;
$aData['surveyid'] = $iSurveyID; // todo duplication needed for survey_common_action
$aData['gid'] = $groupid;
Expand Down Expand Up @@ -2541,14 +2541,14 @@ private function unparseAndSetGeneralOptions($oQuestion, $dataSet)
$attributeValue
)
) {
throw new CHttpException(500, gT("Could not store general options"));
throw new CHttpException(500, gT("Could not save question attributes"));
}
}

if (!$oQuestion->save()) {
throw new CHttpException(
500,
gT("Could not store question after general options") . PHP_EOL
gT("Could not save question") . PHP_EOL
. print_r($oQuestion->getErrors(), true)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public function actionImportView($surveyid, $landOnSideMenuTab = 'structure')

/*$aData['surveybar']['closebutton']['url'] = 'questionGroupsAdministration/listquestiongroups/surveyid/'.$surveyid; // Close button
$aData['surveybar']['savebutton']['form'] = true;
$aData['surveybar']['savebutton']['text'] = gt('Import');*/
$aData['surveybar']['savebutton']['text'] = gT('Import');*/
$aData['surveyid'] = $surveyid;
/*$aData['sid'] = $surveyid;
$aData['topBar']['sid'] = $iSurveyID;
Expand Down
16 changes: 8 additions & 8 deletions application/controllers/SurveyAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public function actionRegenerateQuestionCodes()

//check subaction
if (!($sSubAction === 'straight' || $sSubAction === 'bygroup')) {
Yii::app()->setFlashMessage(gT("Wrong parameter for subaction (straight or bygroup.)"), 'error');
Yii::app()->setFlashMessage(gT("Invalid parameters."), 'error');
$this->redirect(array('surveyAdministration/view', 'surveyid' => $iSurveyID));
}

Expand Down Expand Up @@ -417,7 +417,7 @@ public function actionInsert($iSurveyID = null)
{
if (Permission::model()->hasGlobalPermission('surveys', 'create')) {
$user = Yii::app()->user;

// CHECK IF USER OWNS PREVIOUS SURVEYS BEGIN
if ($user !== null) {
$userid = (int) $user->getId();
Expand Down Expand Up @@ -506,10 +506,10 @@ public function actionInsert($iSurveyID = null)
} elseif (!$ownsPreviousSurveys) {
// SET create question and create question group as default view.
$redirecturl = $this->createUrl(
'questionGroupsAdministration/add/',
['surveyid' => $iNewSurveyid]
'questionGroupsAdministration/add/',
['surveyid' => $iNewSurveyid]
);
} else {
} else {
$redirecturl = $this->createUrl(
'surveyAdministration/view/',
['iSurveyID' => $iNewSurveyid]
Expand Down Expand Up @@ -2615,7 +2615,7 @@ private function createSampleGroup($iSurveyID)
$oGroup->save();
$oGroupL10ns = new QuestionGroupL10n();
$oGroupL10ns->gid = $oGroup->gid;
$oGroupL10ns->group_name = gt('My first question group', 'html', $sLanguage);
$oGroupL10ns->group_name = gT('My first question group', 'html', $sLanguage);
$oGroupL10ns->language = $sLanguage;
$oGroupL10ns->save();
LimeExpressionManager::SetEMLanguage($sLanguage);
Expand Down Expand Up @@ -2644,8 +2644,8 @@ private function createSampleQuestion($iSurveyID, $iGroupID)
$oQuestion->question_order = 1;
$oQuestion->save();
$oQuestionLS = new QuestionL10n();
$oQuestionLS->question = gt('A first example question. Please answer this question:', 'html', $sLanguage);
$oQuestionLS->help = gt('This is a question help text.', 'html', $sLanguage);
$oQuestionLS->question = gT('A first example question. Please answer this question:', 'html', $sLanguage);
$oQuestionLS->help = gT('This is a question help text.', 'html', $sLanguage);
$oQuestionLS->language = $sLanguage;
$oQuestionLS->qid = $oQuestion->qid;
$oQuestionLS->save();
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/SurveysGroupsPermissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function actionViewUser($id, $to)
throw new CHttpException(403, gT("You do not have permission to this user."));
}
if ($to == App()->user->getId()) {
throw new CHttpException(403, gT("You do not set your own permission."));
throw new CHttpException(403, gT("You cannot modify your own permissions."));
}
$this->viewUserOrUserGroup($id, $to, 'user');
}
Expand Down Expand Up @@ -391,7 +391,7 @@ public function actionDeleteUser($id, $uid)
throw new CHttpException(403, gT("You do not have permission to access this user."));
}
if ($uid == App()->user->getId()) {
throw new CHttpException(403, gT("You cannot delete your own permissions."));
throw new CHttpException(403, gT("You cannot delete your own user."));
}
Permission::model()->deleteAll("uid = :uid AND entity_id = :sid AND entity = :entity", array(
':uid' => $uid,
Expand Down
10 changes: 5 additions & 5 deletions application/controllers/ThemeOptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function actionCreate()
);
} else {
App()->setFlashMessage(
gt("We are sorry but you don't have permissions to do this."),
gT("We are sorry but you don't have permissions to do this."),
'error'
);
$this->redirect(array("themeOptions"));
Expand Down Expand Up @@ -142,7 +142,7 @@ public function actionResetMultiple()
}

//set Modal table labels
$tableLabels = array(gT('Template id'),gT('Template name') ,gT('Status'));
$tableLabels = array(gT('Theme ID'),gT('Theme name') ,gT('Status'));

$this->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -201,7 +201,7 @@ public function actionUninstallMultiple()
}
}
//set Modal table labels
$tableLabels = array(gT('Template id'),gT('Template name') ,gT('Status'));
$tableLabels = array(gT('Theme ID'),gT('Theme name') ,gT('Status'));

$this->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -243,7 +243,7 @@ public function actionSelectedItems()
$aResults[$template]['result'] = gT('Selected');
}
//set Modal table labels
$tableLabels = array(gT('Template id'),gT('Template name') ,gT('Status'));
$tableLabels = array(gT('Theme ID'),gT('Theme name') ,gT('Status'));

$this->renderPartial(
'ext.admin.grid.MassiveActionsWidget.views._selected_items',
Expand Down Expand Up @@ -610,7 +610,7 @@ public function actionReset(int $gsid)
array(":gsid" => $gsid, ":templatename" => $templatename)
);
if (empty($oTemplateConfiguration)) {
throw new CHttpException(401, gT("Invalid template configuration for this group."));
throw new CHttpException(401, gT("Invalid theme configuration for this group."));
}
$oTemplateConfiguration->setToInherit();
if ($oTemplateConfiguration->save()) {
Expand Down
20 changes: 10 additions & 10 deletions application/controllers/UserGroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ public function actionAddUserToGroup($ugid)
$newEntryUserInGroup->uid = $uid;
$newEntryUserInGroup->ugid = $ugid;
if ($newEntryUserInGroup->save()) {
Yii::app()->user->setFlash('success', gt('User added.'));
Yii::app()->user->setFlash('success', gT('User added.'));
} else {
Yii::app()->user->setFlash('error', gt('User could not be added.'));
Yii::app()->user->setFlash('error', gT('User could not be added.'));
}
$this->redirect(array('userGroup/viewGroup/ugid/' . $ugid));
}
Expand All @@ -364,7 +364,7 @@ private function checkBeforeAddDeleteUser($uid, $userGroupId)
$aRet = [];

if (!Permission::model()->hasGlobalPermission('usergroups', 'read')) {
$aRet['errorMsg'] = gt('Access denied');
$aRet['errorMsg'] = gT('Access denied');
$aRet['redirectPath'] = 'userGroup/viewGroup/ugid/' . $userGroupId;
return $aRet;
}
Expand All @@ -378,20 +378,20 @@ private function checkBeforeAddDeleteUser($uid, $userGroupId)
}

if (empty($group)) {
$aRet['errorMsg'] = gt('Group not found.');
$aRet['errorMsg'] = gT('Group not found.');
$aRet['redirectPath'] = 'userGroup/index';
return $aRet;
}

if ($group->owner_id == $uid) {
$aRet['errorMsg'] = gt('You can not add or remove the group owner from the group.');
$aRet['errorMsg'] = gT('You can not add or remove the group owner from the group.');
$aRet['redirectPath'] = 'userGroup/viewGroup/ugid/' . $userGroupId;
return $aRet;
}

$userToAdd = User::model()->findByPk($uid);
if ($userToAdd === null) {
$aRet['errorMsg'] = gt('Unknown user. You have to select a user.');
$aRet['errorMsg'] = gT('Unknown user. You have to select a user.');
$aRet['redirectPath'] = 'userGroup/viewGroup/ugid/' . $userGroupId;
}

Expand All @@ -417,9 +417,9 @@ public function actionDeleteUserFromGroup($ugid)
$deleteUser = UserInGroup::model()->findByAttributes(['uid' => $uid, 'ugid' => $ugid]);

if ($deleteUser->delete()) {
Yii::app()->user->setFlash('success', gt('User removed.'));
Yii::app()->user->setFlash('success', gT('User removed.'));
} else {
Yii::app()->user->setFlash('error', gt('Failed to remove user.'));
Yii::app()->user->setFlash('error', gT('Failed to remove user.'));
}
$this->redirect(array('userGroup/viewGroup/ugid/' . $ugid));
}
Expand Down Expand Up @@ -455,11 +455,11 @@ public function actionMailToAllUsersInGroup($ugid)
$this->redirect(array('userGroup/viewGroup/ugid/' . $ugid));
} catch (Exception $e) {
// TODO: Show error message?
Yii::app()->user->setFlash('error', gt("Error: no email has been send."));
Yii::app()->user->setFlash('error', gT("Error: no email has been send."));
$this->redirect(array('userGroup/viewGroup/ugid/' . $ugid));
}
} else {
Yii::app()->user->setFlash('error', gt("You do not have permission to send emails to all users. "));
Yii::app()->user->setFlash('error', gT("You do not have permission to send emails to all users. "));
$this->redirect(array('userGroup/viewGroup/ugid/' . $ugid));
}
} else {
Expand Down
17 changes: 9 additions & 8 deletions application/controllers/UserManagementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function actionDeleteUser()
return App()->getController()->renderPartial('/admin/super/_renderJson', [
'data' => [
'success' => false,
'message' => gT("you cannot delete yourself.")
'message' => gT("You cannot delete yourself.")
]
]);
}
Expand Down Expand Up @@ -785,7 +785,7 @@ public function actionDeleteMultiple()
}
}

$tableLabels = array(gT('User id'), gT('Username'), gT('Status'));
$tableLabels = array(gT('User ID'), gT('Username'), gT('Status'));

Yii::app()->getController()->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -821,13 +821,13 @@ public function actionRenderSelectedItems()
$aResults[$user]['result'] = gT('Selected');
}
//set Modal table labels
$tableLabels = array(gT('User id'), gT('Username'), gT('Status'));
$tableLabels = array(gT('User ID'), gT('Username'), gT('Status'));

App()->getController()->renderPartial(
'ext.admin.grid.MassiveActionsWidget.views._selected_items',
array(
'aResults' => $aResults,
'successLabel' => gT('Seleted'),
'successLabel' => gT('Selected'),
'tableLabels' => $tableLabels,
)
);
Expand Down Expand Up @@ -920,7 +920,7 @@ public function actionBatchPermissions()
}
}

$tableLabels = array(gT('User id'), gT('Username'), gT('Status'));
$tableLabels = array(gT('User ID'), gT('Username'), gT('Status'));

Yii::app()->getController()->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -975,7 +975,7 @@ public function actionBatchAddGroup()
}
}

$tableLabels = array(gT('User id'), gT('Username'), gT('Status'));
$tableLabels = array(gT('User ID'), gT('Username'), gT('Status'));

Yii::app()->getController()->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -1021,7 +1021,7 @@ public function actionBatchApplyRoles()
}
}

$tableLabels = array(gT('User id'), gT('Username'), gT('Status'));
$tableLabels = array(gT('User ID'), gT('Username'), gT('Status'));

Yii::app()->getController()->renderPartial(
'ext.admin.survey.ListSurveysWidget.views.massive_actions._action_results',
Expand Down Expand Up @@ -1184,7 +1184,8 @@ private function createAdminUser($aUser)
if ($success) {
$data = [
'success' => $success,
'message' => $sReturnMessage
'message' => $sReturnMessage,
'href' => Yii::app()->getController()->createUrl('userManagement/userPermissions', ['userid' => $newUser['uid']]),
];
} else {
$data = [
Expand Down
Loading

0 comments on commit 2cf312e

Please sign in to comment.