Commit fc7e70df authored by François Jacquet's avatar François Jacquet
Browse files

Set modfunc to false instead of unset

parent ea8f67c5
......@@ -96,8 +96,8 @@ if ( $_REQUEST['modfunc'] === 'save' )
else
$error[] = _('You must choose at least one period and one student.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
DrawHeader(ProgramTitle());
......
......@@ -62,7 +62,7 @@ if ( $_REQUEST['modfunc']=='update' && AllowEdit())
$error[] = _('Please enter a valid Sort Order.');
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
DrawHeader(ProgramTitle());
......@@ -90,8 +90,8 @@ if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
DBQuery("UPDATE COURSE_PERIODS SET DOES_ATTENDANCE=replace(DOES_ATTENDANCE,',$_REQUEST[id],',',') WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."'");
DBQuery("UPDATE COURSE_PERIODS SET DOES_ATTENDANCE=NULL WHERE DOES_ATTENDANCE=',' AND SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."'");
unset( $_REQUEST['modfunc'] );
unset( $_SESSION['_REQUEST_vars']['modfunc'] );
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
unset( $_SESSION['_REQUEST_vars']['id'] );
}
}
......
......@@ -4,7 +4,7 @@ require_once 'modules/Attendance/includes/UpdateAttendanceDaily.fnc.php';
DrawHeader(ProgramTitle());
//FJ add translation
//FJ add translation
$message = '<table><tr><td colspan="7" class="center">'._('From').' '.PrepareDate(DBDate(),'_min').' '._('to').' '.PrepareDate(DBDate(),'_max').'</td></tr></table>';
if (Prompt(_('Confirm'),_('When do you want to recalculate the daily attendance?'),$message))
{
......@@ -16,7 +16,7 @@ if (Prompt(_('Confirm'),_('When do you want to recalculate the daily attendance?
ob_flush();
flush();
set_time_limit(0);
$current_RET = DBGet(DBQuery("SELECT DISTINCT SCHOOL_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."'"),array(),array('SCHOOL_DATE'));
$students_RET = GetStuList();
......@@ -33,9 +33,9 @@ if (Prompt(_('Confirm'),_('When do you want to recalculate the daily attendance?
}
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
//FJ display notice while calculating daily attendance
echo '<script>var msg_done='.json_encode(ErrorMessage(array(_('The Daily Attendance for that timeframe has been recalculated.')), 'note')).'; document.getElementById("messageDIV").innerHTML = msg_done;</script>';
}
......@@ -237,8 +237,8 @@ if ( $_REQUEST['modfunc'] === 'save'
else
{
$error[] = _('You must choose at least one student.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
//reset $email_column var
......
......@@ -90,8 +90,8 @@ if ( $_REQUEST['modfunc'] === 'save' )
else
{
$error[] = _('You must choose at least one user');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
}
......
......@@ -25,8 +25,8 @@ if ( $_REQUEST['modfunc'] === 'save' )
}
else
$error[] = _('You must choose an activity.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
DrawHeader(ProgramTitle());
......
......@@ -17,7 +17,7 @@ if ( $_REQUEST['modfunc']=='add' && AllowEdit())
echo ErrorMessage(array(_('The activity you selected is already assigned to this student!')));
else
DBQuery("INSERT INTO STUDENT_ELIGIBILITY_ACTIVITIES (STUDENT_ID,ACTIVITY_ID,SYEAR) values('".UserStudentID()."','".$_REQUEST['new_activity']."','".UserSyear()."')");
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -43,8 +43,8 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
require_once 'modules/Food_Service/includes/DeleteTransactionItem.fnc.php';
DeleteTransactionItem($_REQUEST['transaction_id'],$_REQUEST['item_id'],$_REQUEST['type']);
DBQuery('BEGIN; '.$sql1.'; '.$sql2.'; '.$sql3.'; COMMIT');
unset($_REQUEST['modfunc']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
}
else
......@@ -53,8 +53,8 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
{
require_once 'modules/Food_Service/includes/DeleteTransaction.fnc.php';
DeleteTransaction($_REQUEST['transaction_id'],$_REQUEST['type']);
unset($_REQUEST['modfunc']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
}
}
......
......@@ -17,7 +17,7 @@ if ( $_REQUEST['modfunc']=='update')
}
unset($_REQUEST['student']);
unset($_REQUEST['staff']);
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
$schools_RET = DBGet(DBQuery("SELECT ID,SYEAR,TITLE FROM SCHOOLS"),array(),array('SYEAR'));
......
......@@ -91,7 +91,7 @@ if ( $_REQUEST['modfunc']=='update')
}
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -63,7 +63,7 @@ if ( $_REQUEST['modfunc']=='update')
}
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -5,7 +5,7 @@ require_once 'modules/Food_Service/includes/FS_Icons.inc.php';
if ( $_REQUEST['modfunc']=='select')
{
$_SESSION['FSA_type'] = $_REQUEST['fsa_type'];
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['type'])
......@@ -49,14 +49,14 @@ if ( $_REQUEST['modfunc']=='add')
{
if ( $_REQUEST['item_sn'])
$_SESSION['FSA_sale'][] = $_REQUEST['item_sn'];
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='remove')
{
if ( $_REQUEST['id']!='')
unset($_SESSION['FSA_sale'][$_REQUEST['id']]);
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
require_once 'modules/Food_Service/'.($_SESSION['FSA_type']=='staff'?'Users/':'Students/').'/ServeMenus.php';
......
......@@ -62,8 +62,8 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
{
require_once 'modules/Food_Service/includes/DeleteTransactionItem.fnc.php';
DeleteTransactionItem($_REQUEST['transaction_id'],$_REQUEST['item_id'],$_REQUEST['type']);
unset($_REQUEST['modfunc']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
}
else
......@@ -72,8 +72,8 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
{
require_once 'modules/Food_Service/includes/DeleteTransaction.fnc.php';
DeleteTransaction($_REQUEST['transaction_id'],$_REQUEST['type']);
unset($_REQUEST['modfunc']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
}
}
......
......@@ -15,7 +15,7 @@ if ( $_REQUEST['modfunc']=='update')
DBQuery($sql);
}
}
//unset($_REQUEST['modfunc']);
//$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......
......@@ -51,7 +51,7 @@ if ( $_REQUEST['modfunc']=='update')
}
else
$error[] = _('Please enter valid Numeric data.');
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......@@ -59,7 +59,7 @@ if ( $_REQUEST['modfunc']=='update')
}
else
{
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......
......@@ -60,10 +60,10 @@ if ( $_REQUEST['modfunc']=='submit')
unset($_SESSION['FSA_sale']);
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
else
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['submit']);
}
......
......@@ -30,7 +30,7 @@ if ( $_REQUEST['values'] && $_POST['values'] && $_REQUEST['save'])
else
$error[] = _('Please enter valid Type and Amount.');
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
Widgets('fsa_discount');
......
......@@ -28,8 +28,8 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
{
require_once 'modules/Food_Service/includes/DeleteTransaction.fnc.php';
DeleteTransaction($_REQUEST['id'],$_REQUEST['type']);
unset($_REQUEST['modfunc']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
}
......
......@@ -15,7 +15,7 @@ if ( $_REQUEST['modfunc']=='update')
DBQuery($sql);
}
}
//unset($_REQUEST['modfunc']);
//$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......@@ -26,8 +26,8 @@ if ( ! $_REQUEST['modfunc'] && UserStaffID())
(SELECT s.STAFF_ID FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS ACCOUNT_ID,
(SELECT STATUS FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS STATUS,
(SELECT BALANCE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BALANCE,
(SELECT BARCODE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BARCODE
FROM STAFF s
(SELECT BARCODE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BARCODE
FROM STAFF s
WHERE s.STAFF_ID='".UserStaffID()."'"));
$staff = $staff[1];
......
......@@ -55,7 +55,7 @@ if ( $_REQUEST['modfunc']=='update')
DBQuery("UPDATE FOOD_SERVICE_STUDENT_ACCOUNTS SET BARCODE=NULL WHERE BARCODE='".trim($_REQUEST['food_service']['BARCODE'])."'");
}
DBQuery($sql);
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......@@ -64,7 +64,7 @@ if ( $_REQUEST['modfunc']=='update')
}
else
{
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['food_service']);
unset($_SESSION['_REQUEST_vars']['food_service']);
}
......@@ -91,7 +91,7 @@ if ( $_REQUEST['modfunc']=='create')
$sql = 'INSERT INTO FOOD_SERVICE_STAFF_ACCOUNTS ('.mb_substr($fields,0,-1).') values ('.mb_substr($values,0,-1).')';
DBQuery($sql);
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
StaffWidgets('fsa_balance');
......
......@@ -49,10 +49,10 @@ if ( $_REQUEST['modfunc']=='submit')
unset($_SESSION['FSA_sale']);
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
else
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
unset($_REQUEST['submit']);
}
......
......@@ -29,7 +29,7 @@ if ( $_REQUEST['values'] && $_POST['values'] && $_REQUEST['save'])
else
$error[] = _('Please enter valid Type and Amount.');
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
StaffWidgets('fsa_status');
......
......@@ -144,8 +144,8 @@ if ( $_REQUEST['modfunc']=='update')
}
}
unset( $_REQUEST['modfunc'] );
unset( $_SESSION['_REQUEST_vars']['modfunc'] );
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='remove')
......
......@@ -331,7 +331,7 @@ if ( $_REQUEST['modfunc'] === 'delete' )
unset($_REQUEST['assignment_id']);
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
}
......
......@@ -52,7 +52,7 @@ if ( $_REQUEST['modfunc']=='update')
DBQuery($sql);
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='remove')
......
......@@ -121,7 +121,7 @@ if ( UserStudentID() )
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='remove')
......
......@@ -388,16 +388,16 @@ if ( $_REQUEST['modfunc'] === 'save' )
{
$error[] = _('No Students were found.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
}
else
{
$error[] = _('You must choose at least one student and one marking period.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
}
}
......
......@@ -258,7 +258,7 @@ if ( $_REQUEST['modfunc']=='gradebook')
}
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='grades')
......@@ -277,7 +277,7 @@ if ( $_REQUEST['modfunc']=='grades')
unset($_SESSION['_REQUEST_vars']['prev_mp']);
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='comments')
......@@ -308,7 +308,7 @@ if ( $_REQUEST['modfunc']=='comments')
unset($_SESSION['_REQUEST_vars']['prev_mp']);
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='clearall')
......@@ -331,7 +331,7 @@ if ( $_REQUEST['modfunc']=='clearall')
foreach ( (array) $comment as $i => $comment)
$current_commentsB_RET[ $student_id ][ $i ] = '';
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
}
if ( $_REQUEST['values'] && $_POST['values'])
......
......@@ -65,7 +65,7 @@ if ( $_REQUEST['modfunc']=='update')
}
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -71,7 +71,7 @@ if ( $_REQUEST['modfunc']=='update')
$error[] = _('There are no courses setup yet.');
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -72,7 +72,7 @@ if ( $_REQUEST['modfunc'] === 'update' )
}
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] === 'remove' && AllowEdit() )
......
......@@ -41,7 +41,7 @@ if ( $_REQUEST['modfunc']=='update')
}
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
DrawHeader(ProgramTitle());
......
......@@ -531,7 +531,7 @@ if ( $_REQUEST['modfunc']=='delete' && AllowEdit())
}
unset($_REQUEST[ $unset ]);
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
}
......
......@@ -86,8 +86,8 @@ if ( $_REQUEST['modfunc'] === 'save' )
if (empty($schedule_deletion_pending))
{
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
unset($_SESSION['MassDrops.php']);
}
}
......
......@@ -24,8 +24,8 @@ if ( $_REQUEST['modfunc'] === 'save' )
else
$error[] = _('You must choose a course.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
unset($_SESSION['MassRequests.php']);
}
......
......@@ -79,8 +79,8 @@ if ( $_REQUEST['modfunc'] === 'save'
else
$error[] = _('You must choose a course.');
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_REQUEST['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
$_REQUEST['modfunc'] = false;
unset($_SESSION['MassSchedule.php']);
}
......
......@@ -34,7 +34,7 @@ if ( $_REQUEST['modfunc']=='update')
DBQuery($sql);
}
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc']=='add' && AllowEdit())
......@@ -44,7 +44,7 @@ if ( $_REQUEST['modfunc']=='add' && AllowEdit())
$subject_id = $subject_id[1]['SUBJECT_ID'];
DBQuery("INSERT INTO SCHEDULE_REQUESTS (REQUEST_ID,SYEAR,SCHOOL_ID,STUDENT_ID,SUBJECT_ID,COURSE_ID) values(".db_seq_nextval('SCHEDULE_REQUESTS_SEQ').",'".UserSyear()."','".UserSchool()."','".UserStudentID()."','".$subject_id."','".$course_id."')");
unset($_REQUEST['modfunc']);
$_REQUEST['modfunc'] = false;
}
if ( $_REQUEST['modfunc'] == 'XMLHttpRequest' )
......
......@@ -47,7 +47,7 @@ else
$date = $_REQUEST['year_date'] . '-' . $_REQUEST['month_date'] . '-' . $_REQUEST['day_date'];
}
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
$_SESSION['_REQUEST_vars']['modfunc'] = false;
Widgets('course');
Widgets('request');
......
......@@ -371,8 +371,8 @@ if ( $_REQUEST['modfunc'] === 'create'
// Set Current Calendar
$_REQUEST['calendar_id'] = $calendar_id;
unset( $_REQUEST['modfunc'] );
unset( $_SESSION['_REQUEST_vars']['modfunc'] );
$_REQUEST['modfunc'] = false;
$_SESSION['_REQUEST_vars']['modfunc'] = false;
unset( $_REQUEST['weekdays']);