Skip to content
Permalink
Browse files
Merge branch 'develop' for Release 3.0.4
  • Loading branch information
bgreiner committed Dec 2, 2016
2 parents 8731f5a + 61bae3c commit 18bf8abf73d7de3e6d42e408f84b93336145604f
Show file tree
Hide file tree
Showing 24 changed files with 507 additions and 122 deletions.
@@ -64,8 +64,8 @@
$_REQUEST['password2']="";
}

if ($continue) {
foreach (array('fname','lname','adminname') as $k) $_REQUEST[$k]=trim($_REQUEST[$k]);
if ($continue && isset($_REQUEST['adminname'])) {
$_REQUEST['adminname']=trim($_REQUEST['adminname']);
$pars=array(':adminname'=>$_REQUEST['adminname']);
$query="SELECT admin_id FROM ".table('admin')."
WHERE adminname = :adminname";
@@ -84,6 +84,9 @@
} else unset($_REQUEST['password']);

if (!$admin_id) $admin_id=time();
foreach (array('fname','lname') as $k) {
$_REQUEST[$k]=trim($_REQUEST[$k]);
}
$done=orsee_db_save_array($_REQUEST,"admin",$admin_id,"admin_id");
message(lang('changes_saved'));
log__admin("admin_edit",$_REQUEST['adminname']);
@@ -5,14 +5,22 @@

$continue=true; $all=false;

if(!isset($_REQUEST['cal'])) { $continue=false; $message="no token"; }
if(!isset($_REQUEST['cal'])) {
$continue=false;
$message="no token";
}

if ($continue) {
$caltype=substr($_REQUEST['cal'],0,1);
$token=substr($_REQUEST['cal'],1);
if ($caltype=='a') $all=true;
elseif ($caltype=='p') $all=false;
else { $continue=false; $message="cal type not allowed"; }
if ($caltype=='a') {
$all=true;
} elseif ($caltype=='p') {
$all=false;
} else {
$continue=false;
$message="cal type not allowed";
}
}

if ($continue) {
@@ -22,73 +30,90 @@
if (check_allow('login') && $expadmindata['disabled']!='y'
&& (check_allow('calendar_export_my') || check_allow('calendar_export_all'))
) {
if ($all==true && !check_allow('calendar_export_all')) $all=false;
} else { $continue=false; $message="no rights to export"; }
} else { $continue=false; $message="invalid token"; }
if ($all==true && !check_allow('calendar_export_all')) {
$all=false;
}
} else {
$continue=false;
$message="no rights to export";
}
} else {
$continue=false;
$message="invalid token";
}
}


if ($continue) {
$labs=laboratories__get_laboratories();
$laboratory_id=false;
if(isset($_REQUEST['lab_id']) && $_REQUEST['lab_id']) {
if(isset($labs[$_REQUEST['lab_id']])) {
$laboratory_id=$_REQUEST['lab_id'];
}
}

$displayfrom_lower = time()-60*60*24*31*$settings['calendar_export_months_back'];
$displayfrom_upper = time()+60*60*24*31*$settings['calendar_export_months_ahead'];
$displayfrom_lower = time()-60*60*24*31*$settings['calendar_export_months_back'];
$displayfrom_upper = time()+60*60*24*31*$settings['calendar_export_months_ahead'];

if ($all) $expadminid=false; else $expadminid=$expadmindata['admin_id'];
$results = calendar__get_events(true, $displayfrom_lower, $displayfrom_upper,$expadminid);
if ($all) {
$expadminid=false;
} else {
$expadminid=$expadmindata['admin_id'];
}
$results = calendar__get_events(true, $displayfrom_lower, $displayfrom_upper,$expadminid, false, $laboratory_id);


if (isset($_REQUEST['dispout'])) {
header('Content-Type: text/plain');
} else {
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=' . time() . "downlaod.ics");
}
if (isset($_REQUEST['dispout'])) {
header('Content-Type: text/plain');
} else {
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=' . time() . "downlaod.ics");
}


///Start echoing the file out
echo 'BEGIN:VCALENDAR' . "\r\n";
echo 'VERSION:2.0' . "\r\n";
echo 'PRODID:-//hacksw/handcal//NONSGML v1.0//EN' . "\r\n";
echo 'CALSCALE:GREGORIAN' . "\r\n";
echo 'BEGIN:VTIMEZONE' . "\r\n";
echo 'TZID:UTC' . "\r\n";
echo 'BEGIN:STANDARD' . "\r\n";
echo 'DTSTART:19700101T000000' . "\r\n";
echo 'RDATE:19700101T000000' . "\r\n";
echo 'TZOFFSETFROM:-0000' . "\r\n";
echo 'TZOFFSETTO:-0000' . "\r\n";
echo 'TZNAME:UTC' . "\r\n";
echo 'END:STANDARD' . "\r\n";
echo 'END:VTIMEZONE' . "\r\n";
foreach($results as $day){
foreach($day as $item){
$description='';
$description.=experiment__list_experimenters($item['experimenters'],false,true).'\n';
if($item['type'] == "location_reserved") {
if (check_allow('events_edit')) $item['title_link']=$item['edit_link'];
} elseif($item['type'] == "experiment_session") {
$description.=$item['participants_registered'] . " (" . $item['participants_needed']. "," . $item['participants_reserve'] . ")".'\n';
// if(check_allow('session_edit'))
// $description.=lang('participants').': '.$item['edit_link'].'\n';
// if(check_allow('experiment_show_participants'))
// $description.=lang('participants').': '.$item['participants_link'].'\n';
///Start echoing the file out
echo 'BEGIN:VCALENDAR' . "\r\n";
echo 'VERSION:2.0' . "\r\n";
echo 'PRODID:-//hacksw/handcal//NONSGML v1.0//EN' . "\r\n";
echo 'CALSCALE:GREGORIAN' . "\r\n";
echo 'BEGIN:VTIMEZONE' . "\r\n";
echo 'TZID:UTC' . "\r\n";
echo 'BEGIN:STANDARD' . "\r\n";
echo 'DTSTART:19700101T000000' . "\r\n";
echo 'RDATE:19700101T000000' . "\r\n";
echo 'TZOFFSETFROM:-0000' . "\r\n";
echo 'TZOFFSETTO:-0000' . "\r\n";
echo 'TZNAME:UTC' . "\r\n";
echo 'END:STANDARD' . "\r\n";
echo 'END:VTIMEZONE' . "\r\n";
foreach($results as $day) {
foreach($day as $item) {
$description='';
$description.=experiment__list_experimenters($item['experimenters'],false,true).'\n';
if($item['type'] == "location_reserved") {
if (check_allow('events_edit')) {
$item['title_link']=$item['edit_link'];
}
} elseif($item['type'] == "experiment_session") {
$description.=$item['participants_registered'] . " (" . $item['participants_needed']. "," . $item['participants_reserve'] . ")".'\n';
}
$description=trim($description);
echo 'BEGIN:VEVENT' . "\r\n";
echo 'DTEND:' . calendar__unixtime_to_ical_date($item['end_time']) . "\r\n";
echo 'UID:' . calendar__escapestring($item['uid']) . "\r\n";
echo 'DTSTAMP:' . calendar__unixtime_to_ical_date(time()) . "\r\n";
echo 'DTSTART:' . calendar__unixtime_to_ical_date($item['start_time']) . "\r\n";
echo 'LOCATION:' . calendar__escapestring($item['location']) . "\r\n";
echo 'SUMMARY:' . calendar__escapestring($item['title']) . "\r\n";
if(isset($item['title_link'])){
echo 'URL:' . $item['title_link'] . "\r\n";
}
echo 'DESCRIPTION:' . calendar__escapestring($description). "\r\n";;
echo 'END:VEVENT' . "\r\n";
}
$description=trim($description);
echo 'BEGIN:VEVENT' . "\r\n";
echo 'DTEND:' . calendar__unixtime_to_ical_date($item['end_time']) . "\r\n";
echo 'UID:' . calendar__escapestring($item['uid']) . "\r\n";
echo 'DTSTAMP:' . calendar__unixtime_to_ical_date(time()) . "\r\n";
echo 'DTSTART:' . calendar__unixtime_to_ical_date($item['start_time']) . "\r\n";
echo 'LOCATION:' . calendar__escapestring($item['location']) . "\r\n";
echo 'SUMMARY:' . calendar__escapestring($item['title']) . "\r\n";
if(isset($item['title_link'])){
echo 'URL:' . $item['title_link'] . "\r\n";
}
echo 'DESCRIPTION:' . calendar__escapestring($description). "\r\n";;
echo 'END:VEVENT' . "\r\n";
}
}
echo 'END:VCALENDAR';

echo 'END:VCALENDAR';
} else {
header("HTTP/1.0 404 Not Found", true, 404);
die();
@@ -4,7 +4,7 @@

$menu__area="experiments";
$title="assign_subjects";
$jquery=array('arraypicker','textext','dropit','queryform','datepicker');
$jquery=array('arraypicker','textext','dropit','queryform','datepicker','popup');
include ("header.php");
if ($proceed) {
if ($_REQUEST['experiment_id']) $experiment_id=$_REQUEST['experiment_id'];
@@ -87,6 +87,10 @@
$sort=query__load_default_sort('assign',$experiment_id);
}

if (check_allow('participants_edit')) {
echo javascript__edit_popup();
}

// show query in human-readable form
$pseudo_query_array=query__get_pseudo_query_array($posted_query['query']);
$pseudo_query_display=query__display_pseudo_query($pseudo_query_array,true);
@@ -4,7 +4,7 @@

$menu__area="experiments";
$title="remove_participants_from_exp";
$jquery=array('arraypicker','textext','dropit','queryform','datepicker');
$jquery=array('arraypicker','textext','dropit','queryform','datepicker','popup');
include ("header.php");
if ($proceed) {
if ($_REQUEST['experiment_id']) $experiment_id=$_REQUEST['experiment_id'];
@@ -83,6 +83,10 @@
$sort=query__load_default_sort('assign',$experiment_id);
}

if (check_allow('participants_edit')) {
echo javascript__edit_popup();
}

// show query in human-readable form
$pseudo_query_array=query__get_pseudo_query_array($posted_query['query']);
$pseudo_query_display=query__display_pseudo_query($pseudo_query_array,false);
@@ -294,7 +294,9 @@
foreach ($clause_pars as $p=>$v) $pars[$p]=$v;

$order=query__get_sort('session_participants_list',$sort); // sanitize sort or load default if empty
if(!$order) $order=table('participants').".participant_id"; //??
if((!$order) || $order=='participant_id') {
$order=table('participants').".participant_id";
}
$query.=" ORDER BY ".$order;

// get result
@@ -328,6 +330,10 @@
}
unset($temp_participants);

if (check_allow('participants_edit')) {
echo javascript__edit_popup();
}

echo '<center>';

echo '<TABLE class="or_page_subtitle" style="background: '.$color['page_subtitle_background'].'; color: '.$color['page_subtitle_textcolor'].'; width: 95%">
@@ -73,9 +73,8 @@
</FORM><BR>';


$query="select left(content_name,1) as letter,
count(lang_id) as number,
content_name
$query="select lower(left(content_name,1)) as letter,
count(lang_id) as number
from ".table('lang')."
where content_type='lang' GROUP BY letter";
$result=or_query($query);
@@ -179,7 +179,7 @@ function toggle_form_fields() {

echo '<TR class="condfield radioline_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/radioline_lang&quot; or alphabetically in the respective language.">
<TD>Order values</TD>
<TD>'.pform_options_selectfield('order_select_lang_values',array('alphabetically','fixed_order'),$field).'</TD></TR>';
<TD>'.pform_options_selectfield('order_radio_lang_values',array('alphabetically','fixed_order'),$field).'</TD></TR>';


echo '<TR class="condfield select_numbers tooltip" title="First number in list. Must be integer."><TD>Start number
@@ -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.3";
$system__version="3.0.4";

// implemented experiment types
$system__experiment_types=array('laboratory','online-survey','internet');
@@ -407,6 +407,14 @@
'default_value'=>'y'
);

$system__options_general[]=array(
'option_name'=>'include_weekday_in_session_name',
'option_text'=>'Include weekday in session date whereever displayed?',
'type'=>'select_yesno_switchy',
'default_value'=>'n'
);


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

$system__options_general[]=array('type'=>'comment',
@@ -1,3 +1,10 @@
ORSEE 3.0.4
Many minor and major bugfixes
New feature: Email module allows SSL connections
New feature: weekdays can be displayed in session lists
New feature: import participant data from txt file
New feature: calendar can be displayed by laboratory
New feature: Edit links can be displayed in session & assign lists

ORSEE 3.0.3
Larger bugfix for wrongly encoded special characters (UTF8)
@@ -1,6 +1,6 @@
/* This file is part of the Online Recruitment System for Economic Experiments (ORSEE).

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

Author(s): Ben Greiner

@@ -17,9 +17,9 @@
software's use by an appropriate citation of the following
publication (or an updated version):

Ben Greiner (2015), Subject Pool Recruitment Procedures: Organizing
Experiments with ORSEE, Journal of the Economic Science Association 1.
Forthcoming.
Ben Greiner (2015),
Subject Pool Recruitment Procedures: Organizing Experiments with ORSEE,
Journal of the Economic Science Association 1 (1), 114-125.
http://link.springer.com/article/10.1007/s40881-015-0004-4

2. Redistributions of source code must retain the above copyright

0 comments on commit 18bf8ab

Please sign in to comment.