Skip to content

Commit

Permalink
Release 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bgreiner committed Sep 3, 2015
2 parents e206bea + 3168108 commit acccc8c
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
config/settings.php
README.md
usage/*
!usage/webalizer.template
2 changes: 1 addition & 1 deletion 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.0";
$system__version="3.0.1";

// implemented experiment types
$system__experiment_types=array('laboratory','online-survey','internet');
Expand Down
5 changes: 5 additions & 0 deletions install/CHANGELOG
@@ -1,4 +1,9 @@

ORSEE 3.0.1:
Many minor bugfixes.
config/settings.php is now in install/settings-dist.php
and needs to be copied over

ORSEE 3.0.0:
Too numerous to list.

Expand Down
15 changes: 10 additions & 5 deletions install/INSTALL.howto
Expand Up @@ -38,15 +38,19 @@ BASIC INSTALLATION
in this file to match your needs.
% crontab crontab-for-orsee

7. Browse to the 'config' dir. Edit the few settings in 'settings.php'.
7. Copy settings-dist.php to 'config' directory and rename to 'settings.php'.
% cp settings-dist.php ../config/settings.php
% cd ../config/

8. Make sure that the 'usage' directory is writable for the user under which the cronjob is running. The webalizer output will be saved there by the server.
8. Edit the few settings in 'settings.php'.

9. Browse to your ORSEE installation: 'http://yourorseewebpath/admin'.
9. Make sure that the 'usage' directory is writable for the user under which the cronjob is running. The webalizer output will be saved there by the server.

10. Login with username 'orsee_install' and password 'install'.
10. Browse to your ORSEE installation: 'http://yourorseewebpath/admin'.

11. Done.
11. Login with username 'orsee_install' and password 'install'.

12. Done.


POST-INSTALLATION
Expand All @@ -67,6 +71,7 @@ Just some notes:
->Copy the 'orsee' directory from the 'style' dir.
% cp -r orsee mystyle
-> Edit the files in the directory.
-> Edit the colors in Options/Colors
-> Select the style in Options/General Settings

- Enable the Options/Regular Tasks (the cronjobs)
Expand Down
2 changes: 1 addition & 1 deletion install/data_import.php
Expand Up @@ -468,7 +468,7 @@ function copy_table($table, $idvar,$cond="",$delete=true) {
$result=or_query($squery); $pars=array();
while ($line=pdo_fetch_assoc($result)) {
$pars[]=array(':participant_id'=>$line['participant_id'],
':last_enrolment'=>ortime__sesstime_to_unixtime($line['participant_id'])
':last_enrolment'=>ortime__sesstime_to_unixtime($line['last_sess'])
);
}
$uquery="UPDATE ".$new_db_name.".".table('participants')."
Expand Down
69 changes: 69 additions & 0 deletions install/settings-dist.php
@@ -0,0 +1,69 @@
<?php
// part of orsee. see orsee.org
error_reporting(E_ALL & ~E_NOTICE);

// SERVER SETTINGS
// Web server document root, e.g. /srv/www/htdocs
// no trailing slash!
$settings__root_to_server="/srv/www/htdocs";

// Experiment system root relative to server root, e.g. /orsee
// begins always with "/" if in a subdirectory
// no trailing slash!
$settings__root_directory="/orsee";

// url to web server document root (IP or domain name)
// without trailing slash and the http://!
//$settings__server_url="www.orsee.org";
$settings__server_url="127.0.0.1";

// servr protocol (either "http://" or "https://"
$settings__server_protocol="http://";

// Double-check your entries above! The URL to your ORSEE installation will be:
// settings__server_protocol + settings__server_url + settings__root_directory


// DATABASE CONFIGURATION
// Don't forget to create the database
$site__database_host="localhost";
//$site__database_port="3306"; // set only if not default 3306
$site__database_database="orsee_db";
$site__database_admin_username="orsee_user";
$site__database_admin_password="orsee_pw";
$site__database_type="mysql";
$site__database_table_prefix="or_";

// TIMEZOME SETTING
// PHP >= 5.1.0 requires the timezone to be explicitely set.
// If you have not set it in php.ini, then set it here. (Otherwise, you can uncomment.)
// List of timezones: http://php.net/manual/en/timezones.php
date_default_timezone_set("Australia/Sydney");

// EMAIL MODULE
// These settings are only needed when you plan to enable the email module
// to retrieve emails from an external email account and process them in ORSEE
$settings__email_server_type="pop3"; // either pop3 or imap
$settings__email_server_name="mail.foobar.edu";
$settings__email_server_port=""; // if empty or not set, port is automatically determined by type
$settings__email_username="orsee@foobar.edu";
$settings__email_password="orseefoorbar_pw";


// STOP SITE, TRACKING, DEBUGGING
// If below is set to "y", the admin part of ORSEE won't be reachable for anybody
// This is useful for example when running some procedures directly in the database
$settings__stop_admin_site="n";

// To stop tracking set to "y"
$settings__disable_orsee_tracking="n";

// Enable/disable debugging information output at the bottom fo each page.
// Do NOT ENABLE on a live ORSEE system - reveals a lot of information.
$settings__time_debugging_enabled="n";
$settings__query_debugging_enabled="n";

// Include path for tagsets. Leave as is, only change when you know what you are doing.
ini_set("include_path",ini_get("include_path").":./tagsets:./../tagsets:./../../tagsets");

?>
24 changes: 11 additions & 13 deletions public/footer.php
@@ -1,22 +1,20 @@
<?php
// part of orsee. see orsee.org

if ($proceed) {
echo '<BR><BR><BR>';
if ($settings['support_mail']) {
echo '<center>
<P class="small" align=center>';
echo lang('for_questions_contact_xxx');
echo ' ';
helpers__scramblemail($settings['support_mail']);
echo $settings['support_mail'];
echo '</A>';
echo '.<BR><BR><BR></CENTER>';
}
echo '<BR><BR><BR>';
if ($settings['support_mail']) {
echo '<center>
<P class="small" align=center>';
echo lang('for_questions_contact_xxx');
echo ' ';
helpers__scramblemail($settings['support_mail']);
echo $settings['support_mail'];
echo '</A>';
echo '.<BR><BR><BR></CENTER>';
}

debug_output();

html__show_style_footer('public');
html__footer();
}
?>
6 changes: 3 additions & 3 deletions public/participant_show.php
Expand Up @@ -99,18 +99,18 @@
redirect($redir);
}
} else {
echo '<TABLE class="or_page_subtitle" style="background: '.$color['page_subtitle_background'].'; color: '.$color['page_subtitle_textcolor'].'">
echo '<center><TABLE class="or_page_subtitle" style="background: '.$color['page_subtitle_background'].'; color: '.$color['page_subtitle_textcolor'].'">
<TR><TD align="center">
'.lang('experiment_registration').'
</TD>';
</TD></TABLE>';

echo '<BR><BR>
<form action="participant_show.php">
<INPUT type=hidden name="s" value="'.$_REQUEST['s'].'">';

if ($token_string) echo '<INPUT type=hidden name="p" value="'.$participant['participant_id_crypt'].'">';
echo '<INPUT type=hidden name="register" value="true">
<TABLE style="outline: 1px solid black;">
<TABLE class="or_formtable">
<TR>
<TD colspan=2 align=center>
<B>'.lang('do_you_really_want_to_register_for_experiment').'</B>
Expand Down
4 changes: 2 additions & 2 deletions public/participant_show_mob.php
Expand Up @@ -75,7 +75,7 @@
"experiment_id:".$session['experiment_id']."\nsession_id:".$session_id);
message(lang('successfully_registered_to_experiment_xxx')." ".
experiment__get_public_name($session['experiment_id']).", ".
session__build_name($session_id).". ".
session__build_name($session).". ".
lang('this_will_be_confirmed_by_an_email'));
$redir="public/participant_show_mob.php".$token_string;
if ($token_string) $redir.="&"; else $redir.="?";
Expand Down Expand Up @@ -394,4 +394,4 @@
html__mobile_footer();

}
?>
?>
31 changes: 19 additions & 12 deletions tagsets/experimentmail.php
Expand Up @@ -74,8 +74,15 @@ function load_mail($mail_name,$lang) {
WHERE content_type='mail'
AND content_name= :mail_name";
$marr=orsee_query($query,$pars);
if (isset($marr[$lang])) $mailtext=$marr[$lang];
else $mailtext=$marr[$authdata['language']];
if (isset($marr[$lang])) {
$mailtext=$marr[$lang];
} elseif (isset($authdata['language'])) {
$mailtext=$marr[$authdata['language']];
} elseif (isset($marr['en'])) {
$mailtext=$marr['en'];
} else {
$mailtext='';
}
return $mailtext;
}

Expand Down Expand Up @@ -244,15 +251,15 @@ function experimentmail__send_noshow_warnings_to_queue($session) {

function experimentmail__set_reminder_checked($session_id) {
// update session table : reminder_checked
$pars=array(':session_id'=>$session['session_id']);
$pars=array(':session_id'=>$session_id);
$query="UPDATE ".table('sessions')." SET reminder_checked='y' WHERE session_id = :session_id";
$done=or_query($query,$pars);
return $done;
}

function experimentmail__set_noshow_warnings_checked($session_id) {
// update session table : reminder_checked
$pars=array(':session_id'=>$session['session_id']);
// update session table : noshow_warning_sent
$pars=array(':session_id'=>$session_id);
$query="UPDATE ".table('sessions')." SET noshow_warning_sent='y' WHERE session_id= :session_id";
$done=or_query($query,$pars);
return $done;
Expand Down Expand Up @@ -347,7 +354,7 @@ function experimentmail__send_mails_from_queue($number=0,$type="",$experiment_id
$mailtext=experimentmail__get_customized_mailtext('experiment_session_reminder_mail',$texp,$tlang);
if (!isset($mailtext) || !$mailtext || !is_array($mailtext)) {
$mailtext['subject']=load_language_symbol('email_session_reminder_subject',$tlang);
$mailtext['body']=load_mail("public_session_reminder",$$tlang);
$mailtext['body']=load_mail("public_session_reminder",$tlang);
}
$reminder_text[$texp][$tlang]=$mailtext;
}
Expand Down Expand Up @@ -616,9 +623,9 @@ function experimentmail__send_participant_exclusion_mail($part) {

function experimentmail__send_reminder_notice($line,$number,$sent,$disclaimer="") {
global $settings;
$experimenters=explode(",",$line['experimenter_mail']);
$experimenters=db_string_to_id_array($line['experimenter_mail']);
foreach ($experimenters as $experimenter) {
$mail=orsee_db_load_array("admin",$experimenter,"adminname");
$mail=orsee_db_load_array("admin",$experimenter,"admin_id");
$tlang= ($mail['language']) ? $mail['language'] : $settings['admin_standard_language'];
$lang=load_language($tlang);
$mail['session_name']=session__build_name($line,$tlang);
Expand Down Expand Up @@ -864,7 +871,7 @@ function experimentmail__experiment_registration_mail($participant,$session) {

$mailtext=false;
if ($settings['enable_enrolment_confirmation_customization']=='y')
$mailtext=experimentmail__get_customized_mailtext('experiment_enrolment_conf_mail',$experiment_id,$maillang);
$mailtext=experimentmail__get_customized_mailtext('experiment_enrolment_conf_mail',$session['experiment_id'],$maillang);
if (!isset($mailtext) || !$mailtext || !is_array($mailtext)) {
$mailtext['subject']=load_language_symbol('enrolment_email_subject',$maillang);
$mailtext['body']=load_mail("public_experiment_registration",$maillang);
Expand Down Expand Up @@ -909,7 +916,7 @@ function experimentmail__send_registration_notice($line) {
$experimenters=db_string_to_id_array($line['experimenter_mail']);

foreach ($experimenters as $experimenter) {
$admin=orsee_db_load_array("admin",$experimenter,"adminname");
$admin=orsee_db_load_array("admin",$experimenter,"admin_id");
if (isset($admin['admin_id'])) {
$tlang= ($admin['language']) ? $admin['language'] : $settings['admin_standard_language'];
$lang=load_language($tlang);
Expand Down Expand Up @@ -975,7 +982,7 @@ function experimentmail__send_calendar() {
$mail_subject=lang('experiment_calendar').' '.ortime__format($now,'hide_time:true',$maillang);
$cal_name=lang('experiment_calendar').' '.date("Y-m-d",$now);
$cal_filename=str_replace(" ","_",$cal_name).".pdf";
$cal_file=pdfoutput__make_calendar($now,false,true,$number_of_months,true);
$cal_file=pdfoutput__make_pdf_calendar($now,false,true,$number_of_months,true);
}
$mailtext=load_mail("admin_calendar_mailtext",$maillang)."\n".
experimentmail__get_admin_footer($maillang,$admin)."\n";
Expand All @@ -1002,7 +1009,7 @@ function experimentmail__send_participant_statistics() {
// preload details with current language
$maillang=$old_lang;
$statistics=stats__get_textstats_for_email();
$subject=load_language_symbol('subject_pool_statistics').' '.
$subject=load_language_symbol('subject_pool_statistics',$maillang).' '.
ortime__format($now,'hide_time:true');

// get experimenters who want to receive the statistics
Expand Down
6 changes: 3 additions & 3 deletions tagsets/participant.php
Expand Up @@ -25,7 +25,7 @@ function participant__participant_get_if_not_confirmed($confirmation_token) {
function participant__exclude_participant($participant) {
global $settings, $lang;
if (lang('lang')) $notice=lang('automatic_exclusion_by_system_due_to_noshows');
else $notice=load_language_symbol('automatic_exclusion_by_system_due_to_noshows',$sesstings['admin_standard_language']);
else $notice=load_language_symbol('automatic_exclusion_by_system_due_to_noshows',$settings['admin_standard_language']);
$remarks=$participant['remarks']."\n".$notice.' '.$participant['number_noshowup'];
$pars=array(':status_id'=>$settings['automatic_exclusion_to_participant_status'],
':deletion_time'=>time(),
Expand Down Expand Up @@ -133,8 +133,8 @@ function participants__stat_laboratory($participant_id) {
echo ' </TD>
<TD>';
if ($p['sess_id']!='0') {
if (isset($laboratories[$p['laboratory_id']]['name']))
echo $laboratories[$p['laboratory_id']]['name'];
if (isset($laboratories[$p['laboratory_id']]['lab_name']))
echo $laboratories[$p['laboratory_id']]['lab_name'];
else echo 'undefined';
} else {
echo '-';
Expand Down
6 changes: 5 additions & 1 deletion tagsets/pdfoutput.php
Expand Up @@ -156,7 +156,11 @@ function pdfoutput__make_pdf_calendar($displayfrom=0,$wholeyear=false,$admin=fal

//start building calendar
$displayfrom_lower = $displayfrom;
$displayfrom_upper = date__skip_months($forward, $displayfrom_lower);
if ($forward > 0) {
$displayfrom_upper = date__skip_months($forward, $displayfrom_lower);
} else {
$displayfrom_upper=$displayfrom_lower;
}
if($wholeyear){
$displayfrom_upper = mktime(0, 0, 0, 1, 1, date('Y', $displayfrom)+1);
}
Expand Down

0 comments on commit acccc8c

Please sign in to comment.