2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

More php8 compat fixes

This commit is contained in:
Adam Zammit
2023-04-26 16:28:14 +10:00
parent fb74ee3c65
commit 7e202234f3
24 changed files with 88 additions and 62 deletions

View File

@@ -94,7 +94,7 @@ if (isset($_POST['import_file']))
}
}
$do = implode($do,",");
$do = implode(",",$do);
//** - end

View File

@@ -272,8 +272,8 @@ if (isset($_GET['delete_sample'])){
$db->CompleteTrans();
if (mysql_errno() == 0){echo "<div class='alert alert-warning'>", T_("Sample $sample_import_id was deleted."), "</div>"; }
else {echo "<div class='alert alert-warning'>ERROR ".mysql_errno()." ".mysql_error()."\n</div>";}
if (mysqli_errno() == 0){echo "<div class='alert alert-warning'>", T_("Sample $sample_import_id was deleted."), "</div>"; }
else {echo "<div class='alert alert-warning'>ERROR ".mysqli_errno()." ".mysqli_error()."\n</div>";}
}
unset($_GET['delete_sample']);

View File

@@ -60,7 +60,7 @@ if (isset($_POST['default']) && isset($_POST['save'])){
{
$sel[] = $val;
}
$sel=implode($sel,",");
$sel=implode(",",$sel);
$sql = "UPDATE `outcome` as o
SET `default` = 1
@@ -108,7 +108,7 @@ if (isset($_POST['qid']) && $_POST['qid'] > 0 && isset($_POST['save'])){
}
}
$sel=implode($sel,",");
$sel=implode(",",$sel);
$qid = intval($_POST['qid']);
$sql = "UPDATE questionnaire
@@ -225,7 +225,7 @@ if (isset($_GET['qid'])) {
$do[] = $val;
}
}
$qoutc = implode($do,",");
$qoutc = implode(",",$do);
$sql = "UPDATE questionnaire
SET outcomes = '$qoutc'

View File

@@ -203,7 +203,7 @@ class Calendar
*
* @access protected
*/
function Calendar($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
function __construct($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
{
static $cE = null;
if (!isset($cE)) {
@@ -392,6 +392,19 @@ class Calendar
return false;
}
function legacy_each($array){
$key = key($array);
$value = current($array);
$each = is_null($key) ? false : [
1 => $value,
'value' => $value,
0 => $key,
'key' => $key,
];
next($array);
return $each;
}
/**
* Iterator method for fetching child Calendar subclass objects
* (e.g. a minute from an hour object). On reaching the end of
@@ -403,7 +416,7 @@ class Calendar
*/
function fetch()
{
$child = each($this->children);
$child = $this->legacy_each($this->children);
if ($child) {
return $child['value'];
} else {

View File

@@ -100,9 +100,9 @@ class Calendar_Day extends Calendar
*
* @access public
*/
function Calendar_Day($y, $m, $d)
function __construct($y, $m, $d)
{
parent::Calendar($y, $m, $d);
parent::__construct($y, $m, $d);
}
/**
@@ -229,4 +229,4 @@ class Calendar_Day extends Calendar
return $this->empty;
}
}
?>
?>

View File

@@ -76,7 +76,7 @@ class Calendar_Decorator
*
* @param object &$calendar subclass to Calendar to decorate
*/
function Calendar_Decorator(&$calendar)
function __construct(&$calendar)
{
$this->calendar = & $calendar;
}
@@ -647,4 +647,4 @@ class Calendar_Decorator
return $this->calendar->nextSecond($format);
}
}
?>
?>

View File

@@ -79,9 +79,9 @@ class Calendar_Decorator_Textual extends Calendar_Decorator
*
* @access public
*/
function Calendar_Decorator_Textual(&$Calendar)
function __construct(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
parent::__construct($Calendar);
}
/**
@@ -205,4 +205,4 @@ class Calendar_Decorator_Textual extends Calendar_Decorator
return Calendar_Util_Textual::orderedWeekdays($this->calendar, $format);
}
}
?>
?>

View File

@@ -92,9 +92,9 @@ class Calendar_Decorator_Uri extends Calendar_Decorator
*
* @access public
*/
function Calendar_Decorator_Uri(&$Calendar)
function __construct(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
parent::__construct($Calendar);
}
/**
@@ -180,4 +180,4 @@ class Calendar_Decorator_Uri extends Calendar_Decorator
return $this->Uri->next($this, $method);
}
}
?>
?>

View File

@@ -88,9 +88,9 @@ class Calendar_Decorator_Weekday extends Calendar_Decorator
*
* @access public
*/
function Calendar_Decorator_Weekday(&$Calendar)
function __construct(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
parent::__construct($Calendar);
}
/**
@@ -192,4 +192,4 @@ class Calendar_Decorator_Weekday extends Calendar_Decorator
}
}
}
?>
?>

View File

@@ -71,9 +71,9 @@ class Calendar_Decorator_Wrapper extends Calendar_Decorator
*
* @access public
*/
function Calendar_Decorator_Wrapper(&$Calendar)
function __construct(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
parent::__construct($Calendar);
}
/**
@@ -112,4 +112,4 @@ class Calendar_Decorator_Wrapper extends Calendar_Decorator
return $children;
}
}
?>
?>

View File

@@ -80,9 +80,9 @@ class Calendar_Hour extends Calendar
*
* @access public
*/
function Calendar_Hour($y, $m, $d, $h)
function __construct($y, $m, $d, $h)
{
parent::Calendar($y, $m, $d, $h);
parent::__construct($y, $m, $d, $h);
}
/**
@@ -134,4 +134,4 @@ class Calendar_Hour extends Calendar
}
}
}
?>
?>

View File

@@ -81,9 +81,9 @@ class Calendar_Minute extends Calendar
*
* @access public
*/
function Calendar_Minute($y, $m, $d, $h, $i)
function __construct($y, $m, $d, $h, $i)
{
parent::Calendar($y, $m, $d, $h, $i);
parent::__construct($y, $m, $d, $h, $i);
}
/**
@@ -135,4 +135,4 @@ class Calendar_Minute extends Calendar
}
}
}
?>
?>

View File

@@ -79,9 +79,9 @@ class Calendar_Month extends Calendar
*
* @access public
*/
function Calendar_Month($y, $m, $firstDay=null)
function __construct($y, $m, $firstDay=null)
{
parent::Calendar($y, $m);
parent::__construct($y, $m);
$this->firstDay = $this->defineFirstDayOfWeek($firstDay);
}
@@ -135,4 +135,4 @@ class Calendar_Month extends Calendar
}
}
}
?>
?>

View File

@@ -108,9 +108,9 @@ class Calendar_Month_Weekdays extends Calendar_Month
*
* @access public
*/
function Calendar_Month_Weekdays($y, $m, $firstDay=null)
function __construct($y, $m, $firstDay=null)
{
parent::Calendar_Month($y, $m, $firstDay);
parent::__construct($y, $m, $firstDay);
}
/**
@@ -212,4 +212,4 @@ class Calendar_Month_Weekdays extends Calendar_Month
}
}
}
?>
?>

View File

@@ -100,9 +100,9 @@ class Calendar_Month_Weeks extends Calendar_Month
*
* @access public
*/
function Calendar_Month_Weeks($y, $m, $firstDay=null)
function __construct($y, $m, $firstDay=null)
{
parent::Calendar_Month($y, $m, $firstDay);
parent::__construct($y, $m, $firstDay);
}
/**
@@ -163,4 +163,4 @@ class Calendar_Month_Weeks extends Calendar_Month
}
}
}
?>
?>

View File

@@ -74,9 +74,9 @@ class Calendar_Second extends Calendar
* @param int $i minute e.g. 31
* @param int $s second e.g. 45
*/
function Calendar_Second($y, $m, $d, $h, $i, $s)
function __construct($y, $m, $d, $h, $i, $s)
{
parent::Calendar($y, $m, $d, $h, $i, $s);
parent::__construct($y, $m, $d, $h, $i, $s);
}
/**
@@ -119,4 +119,4 @@ class Calendar_Second extends Calendar
return null;
}
}
?>
?>

View File

@@ -114,7 +114,7 @@ class Calendar_Table_Helper
*
* @access protected
*/
function Calendar_Table_Helper(& $calendar, $firstDay=null)
function __construct(& $calendar, $firstDay=null)
{
$this->calendar = & $calendar;
$this->cE = & $calendar->getEngine();
@@ -313,4 +313,4 @@ class Calendar_Table_Helper
return $this->cE->dateToStamp($y, $m, $d);
}
}
?>
?>

View File

@@ -98,7 +98,7 @@ class Calendar_Util_Uri
*
* @access public
*/
function Calendar_Util_Uri($y, $m=null, $d=null, $h=null, $i=null, $s=null)
function __construct($y, $m=null, $d=null, $h=null, $i=null, $s=null)
{
$this->setFragments($y, $m, $d, $h, $i, $s);
}
@@ -201,4 +201,4 @@ class Calendar_Util_Uri
return $uriString;
}
}
?>
?>

View File

@@ -89,7 +89,7 @@ class Calendar_Validator
*
* @access public
*/
function Calendar_Validator(&$calendar)
function __construct(&$calendar)
{
$this->calendar = & $calendar;
$this->cE = & $calendar->getEngine();
@@ -261,6 +261,19 @@ class Calendar_Validator
return true;
}
function legacy_each($array){
$key = key($array);
$value = current($array);
$each = is_null($key) ? false : [
1 => $value,
'value' => $value,
0 => $key,
'key' => $key,
];
next($array);
return $each;
}
/**
* Iterates over any validation errors
*
@@ -269,7 +282,7 @@ class Calendar_Validator
*/
function fetch()
{
$error = each($this->errors);
$error = $this->legacy_each($this->errors);
if ($error) {
return $error['value'];
} else {
@@ -323,7 +336,7 @@ class Calendar_Validation_Error
*
* @access protected
*/
function Calendar_Validation_Error($unit, $value, $message)
function __construct($unit, $value, $message)
{
$this->unit = $unit;
$this->value = $value;
@@ -374,4 +387,4 @@ class Calendar_Validation_Error
return $this->unit.' = '.$this->value.' ['.$this->message.']';
}
}
?>
?>

View File

@@ -135,7 +135,7 @@ class Calendar_Week extends Calendar
*
* @access public
*/
function Calendar_Week($y, $m, $d, $firstDay = null)
function __construct($y, $m, $d, $firstDay = null)
{
include_once CALENDAR_ROOT.'Table/Helper.php';
parent::Calendar($y, $m, $d);
@@ -467,4 +467,4 @@ class Calendar_Week extends Calendar
}
}
}
?>
?>

View File

@@ -77,9 +77,9 @@ class Calendar_Year extends Calendar
*
* @access public
*/
function Calendar_Year($y)
function __construct($y)
{
parent::Calendar($y);
parent::__construct($y);
}
/**
@@ -137,4 +137,4 @@ class Calendar_Year extends Calendar
}
}
}
?>
?>

View File

@@ -196,7 +196,7 @@ class Date
* @param mixed $date optional - date/time to initialize
* @return object Date the new Date object
*/
function Date($date = null)
function __construct($date = null)
{
$this->tz = Date_TimeZone::getDefault();
if (is_null($date)) {
@@ -1462,4 +1462,4 @@ class Date
* c-hanging-comment-ender-p: nil
* End:
*/
?>
?>

View File

@@ -150,7 +150,7 @@ class Date_Span
* @see set()
* @access public
*/
function Date_Span($time = 0, $format = null)
function __construct($time = 0, $format = null)
{
$this->set($time, $format);
}
@@ -1080,4 +1080,4 @@ class Date_Span
* c-hanging-comment-ender-p: nil
* End:
*/
?>
?>

View File

@@ -133,7 +133,7 @@ class Date_TimeZone
* @param string $id the time zone id
* @return object Date_TimeZone the new Date_TimeZone object
*/
function Date_TimeZone($id)
function __construct($id)
{
$_DATE_TIMEZONE_DATA =& $GLOBALS['_DATE_TIMEZONE_DATA'];
if(Date_TimeZone::isValidID($id)) {
@@ -4728,4 +4728,4 @@ if(isset($GLOBALS['_DATE_TIMEZONE_DEFAULT'])
* c-hanging-comment-ender-p: nil
* End:
*/
?>
?>