Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'develop' for Release 3.0.5
  • Loading branch information
bgreiner committed Nov 27, 2017
2 parents 18bf8ab + 354445e commit 3d70bbc
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 24 deletions.
20 changes: 16 additions & 4 deletions admin/faq_edit.php
Expand Up @@ -15,9 +15,11 @@
if ($proceed) {
// load faq question and answer from lang table
if ($faq_id) {
$faq=orsee_db_load_array("faqs",$faq_id,"faq_id");
$question=faq__load_question($faq_id);
$answer=faq__load_answer($faq_id);
} else {
$faq=array('evaluation'=>0);
$question=array();
$answer=array();
}
Expand Down Expand Up @@ -49,13 +51,16 @@
}

if ($continue) {
if (isset($_REQUEST['evaluation']) && $_REQUEST['evaluation']) {
$faq['evaluation']=$_REQUEST['evaluation'];
} else {
$faq['evaluation']=0;
}
if (!$faq_id) {
$new_faq_id=time();

$faq['faq_id']=$new_faq_id;
$faq['evaluation']=0;

$done=orsee_db_save_array($faq,"faqs",$faq['faq_id'],"faq_id");

$question['content_name']=$new_faq_id;
$question['content_type']="faq_question";
$done=lang__insert_to_lang($question);
Expand All @@ -66,6 +71,8 @@

log__admin("faq_create","faq_id:".$new_faq_id);
} else {
$faq['faq_id']=$faq_id;
$done=orsee_db_save_array($faq,"faqs",$faq['faq_id'],"faq_id");
$done=orsee_db_save_array($question,"lang",$question['lang_id'],"lang_id");
$done=orsee_db_save_array($answer,"lang",$answer['lang_id'],"lang_id");
log__admin("faq_edit","faq_id:".$faq_id);
Expand Down Expand Up @@ -96,7 +103,12 @@
<TR>
<TD>'.lang('id').'</TD>
<TD>'.$faq_id.'</TD>
</TR>';
</TR>
<TR>
<TD>'.lang('this_faq_answered_questions_of_xxx').'</TD>
<TD><INPUT name="evaluation" type="text" size=5 maxlength=5 value="'.$faq['evaluation'].'"> '.lang('persons').'</TD>
</TR>
';
$shade=true;
foreach ($languages as $language) {
if (!isset($question[$language])) $question[$language]="";
Expand Down
2 changes: 1 addition & 1 deletion admin/options_participant_profile_edit.php
Expand Up @@ -169,7 +169,7 @@ function toggle_form_fields() {
</TD></TR>';


echo '<TR class="condfield select_lang tooltip" title="Whether or not to include a &quot;none&quot; option (represented by value 0 and &quot;-&quot; in the select list) in addition to the options defined in &quot;Options/Items for profile fields of type select_lang&quot;. Potentially useful in conjunction with &quot;compulsory=yes&quot; in order to not have a 0-value field pre-selected when one must be chosen."><TD>Include a &quot;none&quot; option</TD>
echo '<TR class="condfield select_lang select_numbers tooltip" title="Whether or not to include a &quot;none&quot; option (represented by value 0 and &quot;-&quot; in the select list) in addition to the options defined in &quot;Options/Items for profile fields of type select_lang&quot;. Potentially useful in conjunction with &quot;compulsory=yes&quot; in order to not have a 0-value field pre-selected when one must be chosen."><TD>Include a &quot;none&quot; option</TD>
<TD>'.pform_options_yesnoradio('include_none_option',$field).'</TD></TR>';

echo '<TR class="condfield select_lang tooltip" title="Whether to sort values of this field by the order predetermined in &quot;Options/Items for profile fields of type select_lang&quot; or alphabetically in the respective language.">
Expand Down
22 changes: 20 additions & 2 deletions config/system.php
@@ -1,7 +1,7 @@
<?php
// part of orsee. see orsee.org
// THIS FILE WILL CHANGE FROM VERSION TO VERSION. BETTER NOT EDIT.
$system__version="3.0.4";
$system__version="3.0.5";

// implemented experiment types
$system__experiment_types=array('laboratory','online-survey','internet');
Expand Down Expand Up @@ -192,6 +192,11 @@
/////////////////////////////////
$system__options_general=array();

$system__options_general[]=array('type'=>'comment',
'text'=>'ORSEE version: '.$system__version);

$system__options_general[]=array('type'=>'line');

$system__options_general[]=array('type'=>'comment',
'text'=>'Languages');

Expand Down Expand Up @@ -350,6 +355,13 @@
'default_value'=>'n'
);

$system__options_general[]=array(
'option_name'=>'hide_planned_sessions_in_public_calendar',
'option_text'=>'Participant calendar: Hide "planned" sessions?',
'type'=>'select_yesno_switchy',
'default_value'=>'n'
);

$system__options_general[]=array(
'option_name'=>'show_public_rules_page',
'option_text'=>'Should ORSEE show the rules page in the public section?',
Expand Down Expand Up @@ -482,7 +494,6 @@
$system__options_general[]=array('type'=>'comment',
'text'=>'Experiment enrolment settings');


$system__options_general[]=array(
'option_name'=>'enable_enrolment_only_on_invite',
'option_text'=>'Eligible assigned subjects can only enrol after having received an invitation email?',
Expand Down Expand Up @@ -664,6 +675,13 @@
'maxlength'=>'5',
);

$system__options_general[]=array(
'option_name'=>'disable_admin_login_js',
'option_text'=>'Disable auto-submit on admin login form? (May interfere with some browser autofill functions.)',
'type'=>'select_yesno_switchy',
'default_value'=>'n'
);

$system__options_general[]=array('type'=>'line');

$system__options_general[]=array('type'=>'comment',
Expand Down
8 changes: 8 additions & 0 deletions install/CHANGELOG
@@ -1,3 +1,11 @@
ORSEE 3.0.5
Many minor and major bugfixes
New feature: Display ORSEE version in General Settings
New feature: Disable js auto-submit on admin login form
New feature: Edit faq count
New feature: Allow "none"-option for select_numbers field
New feature: Hide planned sessions in public calendar

ORSEE 3.0.4
Many minor and major bugfixes
New feature: Email module allows SSL connections
Expand Down
2 changes: 1 addition & 1 deletion install/LICENSE
@@ -1,6 +1,6 @@
/* This file is part of the Online Recruitment System for Economic Experiments (ORSEE).

Copyright (c) 2003-2016 Ben Greiner (m@ilben.de).
Copyright (c) 2003-2017 Ben Greiner (m@ilben.de).

Author(s): Ben Greiner

Expand Down
4 changes: 2 additions & 2 deletions install/install.sql

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/participant_reset_pw.php
Expand Up @@ -49,7 +49,7 @@
}
}
if ($continue) {
if ($participant['email']!=trim($_REQUEST['reset_email'])) {
if (strtolower($participant['email'])!=strtolower(trim($_REQUEST['reset_email']))) {
//if email address not ok: save email address to session, show message, redirect
message(lang('password_reset_provided_email_address_not_correct'));
$continue=false;
Expand Down
4 changes: 4 additions & 0 deletions tagsets/calendar.php
Expand Up @@ -80,6 +80,10 @@ function calendar__get_events($admin = false, $start_time = 0, $end_time = 0, $a
if (!$admin) {
$query.=" AND ".table('experiments').".hide_in_cal='n' ";
}
// don't include planned sessions if not admin and setting is disabled
if (!$admin & $settings['hide_planned_sessions_in_public_calendar']=='y') {
$query.=" AND ".table('sessions').".session_status!='planned' ";
}
//only events between start and end time parameters
$pars=array(':end_time'=>date("Ym320000", $end_time), // lowerr than "32nd day" of end time month
':start_time'=>date("Ym000000", $start_time)); // larger than "0st day" of start time month
Expand Down
14 changes: 11 additions & 3 deletions tagsets/expadmin.php
Expand Up @@ -3,12 +3,20 @@

// login form
function admin__login_form() {
global $lang;
global $lang, $settings;
echo '<form name="login" action="admin_login.php" method=post>
'.lang('username').':
<input type=text size=20 maxlength=20 name=adminname onChange="gotoPassword()"><BR>
<input type=text size=20 maxlength=20 name=adminname';
if (!(isset($settings['disable_admin_login_js']) && $settings['disable_admin_login_js']=='y')) {
echo ' onChange="gotoPassword()"';
}
echo '><BR>
'.lang('password').':
<input type=password size=20 maxlength=20 name=password onChange="sendForm()"><BR>';
<input type=password size=20 maxlength=20 name=password';
if (!(isset($settings['disable_admin_login_js']) && $settings['disable_admin_login_js']=='y')) {
echo ' onChange="sendForm()"';
}
echo '><BR>';
if (isset($_REQUEST['requested_url']) && $_REQUEST['requested_url'])
echo '<input type=hidden name="requested_url" value="'.$_REQUEST['requested_url'].'">';
echo '<input class="button" type=submit name=login value="'.lang('login').'">
Expand Down
2 changes: 1 addition & 1 deletion tagsets/experimentmail.php
Expand Up @@ -32,7 +32,7 @@ function experimentmail__send($recipient,$subject,$message,$headers,$env_sender=
pclose($fd);
$done=true;
} else {
$headers="Errors-To: ".$settings['support_mail']."\r\n".$headers;
$headers="Return-Path: ".$settings['support_mail']."\r\n".$headers;
$done=mail($recipient,$subject,$message,$headers,'-f '.$env_sender);
}
return $done;
Expand Down
8 changes: 6 additions & 2 deletions tagsets/html_stuff.php
Expand Up @@ -85,7 +85,9 @@ function html__header() {
';


if (thisdoc()=="admin_login.php") script__login_page();
if (thisdoc()=="admin_login.php" && (!(isset($settings['disable_admin_login_js']) && $settings['disable_admin_login_js']=='y'))) {
script__login_page();
}

if (isset($jquery) && is_array($jquery)) {
include_jquery('',false);
Expand Down Expand Up @@ -137,7 +139,9 @@ function html__header() {
if (isset($color['body_alink'])) echo ' alink="'.$color['body_alink'].'"';
if (isset($color['shade_around_content'])) echo ' bgcolor="'.$color['shade_around_content'].'"';
echo ' TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0';
if (thisdoc()=="admin_login.php") echo ' onload="gotoUsername();"';
if (thisdoc()=="admin_login.php" && (!(isset($settings['disable_admin_login_js']) && $settings['disable_admin_login_js']=='y'))) {
echo ' onload="gotoUsername();"';
}
echo '>
';

Expand Down
2 changes: 1 addition & 1 deletion tagsets/language.php
Expand Up @@ -112,7 +112,7 @@ function language__radioline_item($content_type,$ptablevarname,$formfieldvarname
$query="SELECT *, ".$language." AS item
FROM ".table('lang')."
WHERE content_type= :content_type
ORDER BY ".pdo_escape_string($order_by);
ORDER BY ".$order_by;
$result=or_query($query,$pars);
while ($line = pdo_fetch_assoc($result)) {
$items[$line['content_name']]=$line['item'];
Expand Down
4 changes: 2 additions & 2 deletions tagsets/options.php
Expand Up @@ -156,7 +156,7 @@ function options__get_color_styles() {
$query="select option_style from ".table('options')."
where option_type='color'
group by option_style
order by option_id";
order by option_style";
$result=or_query($query);
while ($line=pdo_fetch_assoc($result)) $color_styles[]=$line['option_style'];
$preloaded_color_styles=$color_styles;
Expand Down Expand Up @@ -377,4 +377,4 @@ function pform_options_selectfield($name,$array,$field,$id="") {



?>
?>
8 changes: 4 additions & 4 deletions tagsets/query.php
Expand Up @@ -213,10 +213,10 @@ function query__get_query($query_array,$query_id,$additional_clauses,$sort,$reso
$add_queries=array();
foreach ($additional_clauses as $add_clause) {
foreach ($add_clause['pars'] as $p=>$v) {
$add_clause['query']=str_replace($p,$p.'_'.$i,$add_clause['query']);
$add_clause['query']=preg_replace('/'.$p.'([^0-9])/',$p.'_'.$i.'\\1',$add_clause['query']);
$pars[$p.'_'.$i]=$v;
$i++;
}
$i++;
$add_queries[]=$add_clause['query'];
}
$query.=implode(' AND ',$add_queries);
Expand All @@ -232,10 +232,10 @@ function query__get_query($query_array,$query_id,$additional_clauses,$sort,$reso
} else {
if (isset($q['subqueries'])) $q['clause']=query__get_subqueries($q['clause'],$q['subqueries'],$resolve_subqueries);
foreach ($q['clause']['pars'] as $p=>$v) {
$q['clause']['query']=str_replace($p,$p.'_'.$i,$q['clause']['query']);
$q['clause']['query']=preg_replace('/'.$p.'([^0-9])/',$p.'_'.$i.'\\1',$q['clause']['query']);
$pars[$p.'_'.$i]=$v;
$i++;
}
$i++;
$query.=' '.$q['op'].' ('.$q['clause']['query'].') ';
}
}
Expand Down

0 comments on commit 3d70bbc

Please sign in to comment.