Update to deal with how newer versions of PHP deal with object pointers.

This commit is contained in:
james 2012-10-19 15:08:21 +00:00
parent 4018d48cc4
commit 8eef980ca7
5 changed files with 35 additions and 35 deletions

View File

@ -21,11 +21,11 @@
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
function report_awards_fr(&$report, $field, $text) { function report_awards_fr($report, $field, $text) {
return i18n($text,array(),array(),"fr"); return i18n($text,array(),array(),"fr");
} }
function report_cash_words(&$report, $field, $text) { function report_cash_words($report, $field, $text) {
return wordify($text, true); return wordify($text, true);
} }

View File

@ -24,7 +24,7 @@
/* Take the language array in users_fundraising, unserialize it, and join it /* Take the language array in users_fundraising, unserialize it, and join it
* with a space */ * with a space */
function report_fundraisings_languages(&$report, $field, $text) function report_fundraisings_languages($report, $field, $text)
{ {
$l = unserialize($text); $l = unserialize($text);
return join(' ', $l); return join(' ', $l);

View File

@ -25,7 +25,7 @@ require_once('../questions.inc.php');
/* Take the language array in users_judge, unserialize it, and join it /* Take the language array in users_judge, unserialize it, and join it
* with a space */ * with a space */
function report_judges_languages(&$report, $field, $text) function report_judges_languages($report, $field, $text)
{ {
$l = unserialize($text); $l = unserialize($text);
return ($l?join(' ', $l):''); return ($l?join(' ', $l):'');
@ -61,7 +61,7 @@ function report_judges_load_cats($year)
/* Return all divisions rated at expertise level x */ /* Return all divisions rated at expertise level x */
function report_judges_divs_at_exp(&$report, $field, $text) function report_judges_divs_at_exp($report, $field, $text)
{ {
global $report_judges_divs; global $report_judges_divs;
@ -89,7 +89,7 @@ function report_judges_divs_at_exp(&$report, $field, $text)
return join(', ', $retl); return join(', ', $retl);
} }
function report_judges_cats_at_pref(&$report, $field, $text) function report_judges_cats_at_pref($report, $field, $text)
{ {
global $report_judges_cats; global $report_judges_cats;
$prefs = array('H' => 2, 'h' => 1, 'i' => 0, 'l' => -1, 'L' => -2); $prefs = array('H' => 2, 'h' => 1, 'i' => 0, 'l' => -1, 'L' => -2);
@ -118,7 +118,7 @@ function report_judges_cats_at_pref(&$report, $field, $text)
return join(', ', $retl); return join(', ', $retl);
} }
function report_judges_custom_question(&$report, $field, $text) function report_judges_custom_question($report, $field, $text)
{ {
/* Field is 'question_x', users_id is passed in $text */ /* Field is 'question_x', users_id is passed in $text */
$q_ord = substr($field, 9); $q_ord = substr($field, 9);
@ -138,7 +138,7 @@ function report_judges_custom_question(&$report, $field, $text)
return $answer['answer']; return $answer['answer'];
} }
function report_judges_div_exp(&$report, $field, $text) function report_judges_div_exp($report, $field, $text)
{ {
/* Field is 'div_exp_x', users_id is passed in $text */ /* Field is 'div_exp_x', users_id is passed in $text */
$div_id = substr($field, 8); $div_id = substr($field, 8);
@ -150,7 +150,7 @@ function report_judges_div_exp(&$report, $field, $text)
return $divprefs[$div_id]; return $divprefs[$div_id];
} }
function report_judges_cat_pref(&$report, $field, $text) function report_judges_cat_pref($report, $field, $text)
{ {
$prefs = array(-2 => 'Lowest', -1 => 'Low', $prefs = array(-2 => 'Lowest', -1 => 'Low',
0 => '--', 0 => '--',
@ -166,7 +166,7 @@ function report_judges_cat_pref(&$report, $field, $text)
return i18n($prefs[$catprefs[$cat_id]]); return i18n($prefs[$catprefs[$cat_id]]);
} }
function report_judges_team_members(&$report, $field, $text) function report_judges_team_members($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
$judges_teams_id = $text; $judges_teams_id = $text;
@ -223,7 +223,7 @@ function report_judges_load_rounds($year)
// if($r['type'] == 'special') $round_special_awards[] = $r; // if($r['type'] == 'special') $round_special_awards[] = $r;
} }
function report_judges_time_availability(&$report, $field, $text) function report_judges_time_availability($report, $field, $text)
{ {
global $config, $report_judges_rounds; global $config, $report_judges_rounds;
$year = $report['year']; $year = $report['year'];

View File

@ -22,7 +22,7 @@
*/ */
function reports_schools_principal(&$report, $field, $text) function reports_schools_principal($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
if($text > 0) { /* text is the uid */ if($text > 0) { /* text is the uid */
@ -31,7 +31,7 @@ function reports_schools_principal(&$report, $field, $text)
} }
return ''; return '';
} }
function reports_schools_sciencehead(&$report, $field, $text) function reports_schools_sciencehead($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
if($text > 0) { /* text is the uid */ if($text > 0) { /* text is the uid */
@ -41,7 +41,7 @@ function reports_schools_sciencehead(&$report, $field, $text)
return i18n("Science Department Head"); return i18n("Science Department Head");
} }
function reports_schools_shphone(&$report, $field, $text) function reports_schools_shphone($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
if($text > 0) { /* text is the uid */ if($text > 0) { /* text is the uid */
@ -51,7 +51,7 @@ function reports_schools_shphone(&$report, $field, $text)
return ''; return '';
} }
function reports_schools_shemail(&$report, $field, $text) function reports_schools_shemail($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
if($text > 0) { /* text is the uid */ if($text > 0) { /* text is the uid */

View File

@ -21,24 +21,24 @@
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
function report_students_i18n_fr(&$report, $field, $text) function report_students_i18n_fr($report, $field, $text)
{ {
return i18n($text, array(), array(), 'fr'); return i18n($text, array(), array(), 'fr');
} }
function report_student_cash_words(&$report, $field, $text) { function report_student_cash_words($report, $field, $text) {
return wordify($text, true); return wordify($text, true);
} }
function report_student_cash_cheque(&$report, $field, $text) { function report_student_cash_cheque($report, $field, $text) {
return sprintf("\$***%0.2f", $text); return sprintf("\$***%0.2f", $text);
} }
function report_student_get_date_today(&$report, $field, $text) { function report_student_get_date_today($report, $field, $text) {
return format_date(time()); return format_date(time());
} }
function report_student_get_date_today_for_cheques(&$report, $field, $text) { function report_student_get_date_today_for_cheques($report, $field, $text) {
global $config; global $config;
$format = $config['cheque_date_format']; $format = $config['cheque_date_format'];
$format = str_replace(array('YYYY', 'MM', 'DD'), array('Y', 'm', 'd'), $format); $format = str_replace(array('YYYY', 'MM', 'DD'), array('Y', 'm', 'd'), $format);
@ -48,12 +48,12 @@ function report_student_get_date_today_for_cheques(&$report, $field, $text) {
return implode(' ', preg_split('//', date($format), -1)); return implode(' ', preg_split('//', date($format), -1));
} }
function report_student_get_cheque_date_format(&$report, $field, $text){ function report_student_get_cheque_date_format($report, $field, $text){
global $config; global $config;
return implode(' ', preg_split('//', $config['cheque_date_format'], -1)); return implode(' ', preg_split('//', $config['cheque_date_format'], -1));
} }
function reports_students_numstudents(&$report, $field, $text) function reports_students_numstudents($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
$q = mysql_query("SELECT students.id FROM students $q = mysql_query("SELECT students.id FROM students
@ -62,7 +62,7 @@ function reports_students_numstudents(&$report, $field, $text)
return mysql_num_rows($q); return mysql_num_rows($q);
} }
function reports_students_award_selfnom_num(&$report, $field, $text, $n) function reports_students_award_selfnom_num($report, $field, $text, $n)
{ {
$year = $report['year']; $year = $report['year'];
$q = mysql_query("SELECT award_awards.name FROM $q = mysql_query("SELECT award_awards.name FROM
@ -77,27 +77,27 @@ function reports_students_award_selfnom_num(&$report, $field, $text, $n)
$i = mysql_fetch_assoc($q); $i = mysql_fetch_assoc($q);
return $i['name']; return $i['name'];
} }
function reports_students_award_selfnom_1(&$report, $field, $text) function reports_students_award_selfnom_1($report, $field, $text)
{ {
return reports_students_award_selfnom_num(&$report, $field, $text, 0); return reports_students_award_selfnom_num($report, $field, $text, 0);
} }
function reports_students_award_selfnom_2(&$report, $field, $text) function reports_students_award_selfnom_2($report, $field, $text)
{ {
return reports_students_award_selfnom_num(&$report, $field, $text, 1); return reports_students_award_selfnom_num($report, $field, $text, 1);
} }
function reports_students_award_selfnom_3(&$report, $field, $text) function reports_students_award_selfnom_3($report, $field, $text)
{ {
return reports_students_award_selfnom_num(&$report, $field, $text, 2); return reports_students_award_selfnom_num($report, $field, $text, 2);
} }
function reports_students_award_selfnom_4(&$report, $field, $text) function reports_students_award_selfnom_4($report, $field, $text)
{ {
return reports_students_award_selfnom_num(&$report, $field, $text, 3); return reports_students_award_selfnom_num($report, $field, $text, 3);
} }
function reports_students_award_selfnom_5(&$report, $field, $text) function reports_students_award_selfnom_5($report, $field, $text)
{ {
return reports_students_award_selfnom_num(&$report, $field, $text, 4); return reports_students_award_selfnom_num($report, $field, $text, 4);
} }
function reports_students_school_principal(&$report, $field, $text) function reports_students_school_principal($report, $field, $text)
{ {
$year = $report['year']; $year = $report['year'];
if($text > 0) { /* text is the uid */ if($text > 0) { /* text is the uid */
@ -107,7 +107,7 @@ function reports_students_school_principal(&$report, $field, $text)
return ''; return '';
} }
function report_student_regfee_item(&$report, $field, $text) { function report_student_regfee_item($report, $field, $text) {
$year = $report['year']; $year = $report['year'];
$id=intval(substr($field,12)); $id=intval(substr($field,12));
$q=mysql_query("SELECT regfee_items_id FROM regfee_items_link WHERE students_id='$text' AND regfee_items_id='$id'"); $q=mysql_query("SELECT regfee_items_id FROM regfee_items_link WHERE students_id='$text' AND regfee_items_id='$id'");