* @author unknown, the initial survey that did not make it in 1.8 because of bad code
* @author unknown, the initial survey that did not make it in 1.8 because of bad code
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
@ -12,8 +14,6 @@
* @todo add rules: title and text cannot be empty
* @todo add rules: title and text cannot be empty
*/
*/
use Chamilo\CoreBundle\Framework\Container;
require_once __DIR__.'/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$this_section = SECTION_COURSES;
@ -77,10 +77,15 @@ $(function() {
// Checking if there is another survey with this code.
// Checking if there is another survey with this code.
// If this is the case there will be a language choice
// If this is the case there will be a language choice
$sql = "SELECT * FROM $table_survey
$sql = "SELECT * FROM $table_survey
WHERE c_id = $course_id AND code='".Database::escape_string($survey_data['code'])."'";
WHERE code='".Database::escape_string($survey_data['code'])."'";
$result = Database::query($sql);
$result = Database::query($sql);
if (Database::num_rows($result) > 1) {
if (Database::num_rows($result) > 1) {
echo Display::return_message(get_lang('This survey code already exists. That probably means the survey exists in other languages. Invited people will choose between different languages.'), 'warning');
echo Display::return_message(
get_lang(
'This survey code already exists. That probably means the survey exists in other languages. Invited people will choose between different languages.'
[get_lang('E-mail message'), get_lang('The selected users will receive an email with the text above and a unique link that they have to click to fill the survey. If you want to put the link somewhere in your text you have to put the following text wherever you want in your text: **link** (star star link star star). This will then automatically be replaced by the unique link. If you do not add **link** to your text then the email link will be added to the end of the mail')],
[
get_lang('E-mail message'),
get_lang(
'The selected users will receive an email with the text above and a unique link that they have to click to fill the survey. If you want to put the link somewhere in your text you have to put the following text wherever you want in your text: **link** (star star link star star). This will then automatically be replaced by the unique link. If you do not add **link** to your text then the email link will be added to the end of the mail'
),
],
false,
false,
['ToolbarSet' => 'Survey', 'Height' => '150']
['ToolbarSet' => 'Survey', 'Height' => '150']
);
);
@ -136,7 +146,13 @@ if (1 != $survey_data['anonymous'] || api_get_configuration_value('survey_anonym
$form->addElement('checkbox', 'remindUnAnswered', '', get_lang('Remind only users who didn\'t answer'));
$form->addElement('checkbox', 'remindUnAnswered', '', get_lang('Remind only users who didn\'t answer'));
}
}
// Allow resending to all selected users
// Allow resending to all selected users
$form->addElement('checkbox', 'resend_to_all', '', get_lang('Remind all users of the survey. If you do not check this checkbox only the newly-added users will receive an e-mail.'));
$form->addCheckBox(
'resend_to_all',
'',
get_lang(
'Remind all users of the survey. If you do not check this checkbox only the newly-added users will receive an e-mail.'