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

Add space after control structures keywords: if (2)

Replace "if ($" with "if ( $"
Replace "if (!" with "if ( !"
parent afc8ea9a
......@@ -16,10 +16,10 @@ function FileUpload($key, $path, $extensions_white_list, $size_limit, &$error, $
{
$file_name = $full_path = false;
if ($final_extension!=false && $file_name_without_extension!=false)
if ( $final_extension!=false && $file_name_without_extension!=false)
$file_name = $file_name_without_extension.$final_extension;
if (!is_uploaded_file($_FILES[$key]['tmp_name']))
if ( !is_uploaded_file($_FILES[$key]['tmp_name']))
$error[] = _('File not uploaded'); //Check the post_max_size & php_value upload_max_filesize values in the php.ini file
elseif ( !in_array( mb_strtolower(mb_strrchr($_FILES[$key]['name'], '.')), $extensions_white_list ) )
......@@ -30,14 +30,14 @@ function FileUpload($key, $path, $extensions_white_list, $size_limit, &$error, $
$error[] = sprintf(_('File size > %01.2fMb: %01.2fMb'),$size_limit,(($_FILES[$key]['size']/1024)/1024));
//if folder doesnt exist, create it!
elseif (!is_dir($path) && !mkdir($path))
elseif ( !is_dir($path) && !mkdir($path))
$error[] = sprintf(_('Folder not created').': %s',$path);
elseif (!is_writable($path))
elseif ( !is_writable($path))
$error[] = sprintf(_('Folder not writable').': %s',$path); //see PHP user rights
//store file
elseif (!move_uploaded_file($_FILES[$key]['tmp_name'],$full_path = ($path.($file_name!=false ? $file_name : ($final_extension==false ? no_accents($_FILES[$key]['name']) : no_accents(mb_substr($_FILES[$key]['name'], 0, mb_strrpos($_FILES[$key]['name'],'.'))).$final_extension)))))
elseif ( !move_uploaded_file($_FILES[$key]['tmp_name'],$full_path = ($path.($file_name!=false ? $file_name : ($final_extension==false ? no_accents($_FILES[$key]['name']) : no_accents(mb_substr($_FILES[$key]['name'], 0, mb_strrpos($_FILES[$key]['name'],'.'))).$final_extension)))))
$error[] = sprintf(_('File invalid or not moveable').': %s',$_FILES[$key]['tmp_name']);
return $full_path;
......
......@@ -4,7 +4,7 @@ function MailingLabel($address_id)
{ global $THIS_RET,$_ROSARIO;
$student_id = $THIS_RET['STUDENT_ID'];
if ($address_id && !$_ROSARIO['MailingLabel'][$address_id][$student_id])
if ( $address_id && !$_ROSARIO['MailingLabel'][$address_id][$student_id])
{
$people_RET = DBGet(DBQuery("SELECT p.FIRST_NAME,p.MIDDLE_NAME,p.LAST_NAME,
coalesce(a.MAIL_ADDRESS,a.ADDRESS) AS ADDRESS,coalesce(a.MAIL_CITY,a.CITY) AS CITY,coalesce(a.MAIL_STATE,a.STATE) AS STATE,coalesce(a.MAIL_ZIPCODE,a.ZIPCODE) AS ZIPCODE
......
<?php
// Portal Notes attached files Path
// You can override the Path definition in the config.inc.php file
if (!isset($PortalNotesFilesPath))
if ( !isset($PortalNotesFilesPath))
$PortalNotesFilesPath = 'assets/PortalNotesFiles/';
//FJ Portal Polls functions
......@@ -16,7 +16,7 @@ function PortalPollsVote($poll_id, $votes_array)
WHERE PORTAL_POLL_ID='".$poll_id."'
ORDER BY ID"));
if (!$poll_RET || !$poll_questions_RET)
if ( !$poll_RET || !$poll_questions_RET)
return ErrorMessage(array('Poll does not exist'));//should never be displayed, so do not translate
//add user to excluded users list (format = '|[profile_id]:[user_id]')
......@@ -59,7 +59,7 @@ function PortalPollsSaveVotes($poll_questions_RET, $votes_array)
foreach ($poll_questions_RET as $key=>$question)
{
if (!empty($question['VOTES']))
if ( !empty($question['VOTES']))
{
$voted_array[$question['ID']] = explode('||', $question['VOTES']);
......@@ -117,13 +117,13 @@ function PortalPollsDisplay($value,$name)
WHERE PORTAL_POLL_ID='".$poll_id."'
ORDER BY ID"), array('OPTIONS'=>'Linkify'));
if (!$poll_RET || !$poll_questions_RET)
if ( !$poll_RET || !$poll_questions_RET)
return ErrorMessage(array('Poll does not exist'));//should never be displayed, so do not translate
//verify if user is in excluded users list (format = '|[profile_id]:[user_id]')
$profile_id = User('PROFILE_ID');
if ($profile_id != 0) //FJ call right Student/Staff ID
if ( $profile_id != 0) //FJ call right Student/Staff ID
$user_id = $_SESSION['STAFF_ID'];
else
$user_id = $_SESSION['STUDENT_ID'];
......@@ -152,7 +152,7 @@ function PortalPollForm($poll_id, $profile_id, $user_id, $poll_questions_RET)
$PollForm = '';
//FJ responsive rt td too large
if (!isset($_REQUEST['_ROSARIO_PDF']))
if ( !isset($_REQUEST['_ROSARIO_PDF']))
$PollForm .= '<div id="divPortalPoll'.$poll_id.'" class="divPortalPoll rt2colorBox">';
$PollForm .= '<form method="POST" id="formPortalPoll'.$poll_id.'" action="ProgramFunctions/PortalPollsNotes.fnc.php" target="divPortalPoll'.$poll_id.'">
......@@ -172,7 +172,7 @@ function PortalPollForm($poll_id, $profile_id, $user_id, $poll_questions_RET)
$checked = true;
foreach ($options_array as $option_nb => $option_label)
{
if ($question['TYPE'] == 'multiple_radio')
if ( $question['TYPE'] == 'multiple_radio')
{
$PollForm .= '<TR><TD>
<label>
......@@ -198,7 +198,7 @@ function PortalPollForm($poll_id, $profile_id, $user_id, $poll_questions_RET)
$PollForm .= '</TD></TR></TABLE>
<P><input type="submit" value="'._('Submit').'" id="pollSubmit'.$poll_id.'" /></P></form>';
if (!isset($_REQUEST['_ROSARIO_PDF']))
if ( !isset($_REQUEST['_ROSARIO_PDF']))
$PollForm .= '</div>';
return $PollForm;
......@@ -208,7 +208,7 @@ function PortalPollForm($poll_id, $profile_id, $user_id, $poll_questions_RET)
function PortalPollsVotesDisplay($poll_id, $display_votes, $poll_questions_RET, $votes_number, $js_included_is_voting = false)
{
if (!$display_votes)
if ( !$display_votes)
{
$poll_completed_str = isset($_POST['poll_completed_string']) ? $_POST['poll_completed_string'] : _('Poll completed');
......@@ -216,7 +216,7 @@ function PortalPollsVotesDisplay($poll_id, $display_votes, $poll_questions_RET,
}
//FJ responsive rt td too large
if (!$js_included_is_voting)
if ( !$js_included_is_voting)
{
$votes_display .= '<DIV id="divPortalPoll'.$poll_id.'" class="divPortalPoll rt2colorBox">'."\n";
}
......@@ -254,7 +254,7 @@ function PortalPollsVotesDisplay($poll_id, $display_votes, $poll_questions_RET,
$votes_display .= '<p>'.$total_votes_str.': '.$votes_number.'</p>';
if (!$js_included_is_voting)
if ( !$js_included_is_voting)
$votes_display .= '</DIV>';
return $votes_display;
......@@ -282,7 +282,7 @@ if (isset($_POST['votes']) && is_array($_POST['votes']))
foreach ($_POST['votes'] as $poll_id=>$votes_array)
{
if (!empty($votes_array))
if ( !empty($votes_array))
{
echo PortalPollsVote($poll_id, $votes_array);
break;
......@@ -295,7 +295,7 @@ function makePublishing($value,$name)
{ global $THIS_RET;
static $profiles = null;
if ($THIS_RET['ID'])
if ( $THIS_RET['ID'])
$id = $THIS_RET['ID'];
else
$id = 'new';
......@@ -326,7 +326,7 @@ function makePublishing($value,$name)
$return .= '</TD></TR></TABLE>';
if (!isset($_REQUEST['_ROSARIO_PDF']))
if ( !isset($_REQUEST['_ROSARIO_PDF']))
$return .= '</DIV>';
return $return;
......@@ -372,7 +372,7 @@ function makePublishingVisibleTo($profiles, $THIS_RET, $id)
$visibleTo .= '<TD>'.CheckboxInput($checked, 'profiles['.$id.']['.$profile['ID'].']', _($profile['TITLE']), '', true);
//FJ Portal Polls add students teacher
if ($profile['ID'] === '0' && $_REQUEST['modname']=='School_Setup/PortalPolls.php') //student & verify this is not a Portal Note!
if ( $profile['ID'] === '0' && $_REQUEST['modname']=='School_Setup/PortalPolls.php') //student & verify this is not a Portal Note!
{
$visibleTo .= ': ' . SelectInput($THIS_RET['STUDENTS_TEACHER_ID'],
'values['.$id.'][STUDENTS_TEACHER_ID]',
......@@ -386,7 +386,7 @@ function makePublishingVisibleTo($profiles, $THIS_RET, $id)
$visibleTo .= '</TD>';
if ($i%2==0 && $i!=count($profiles))
if ( $i%2==0 && $i!=count($profiles))
$visibleTo .= '</TR><TR class="st">';
}
......@@ -395,7 +395,7 @@ function makePublishingVisibleTo($profiles, $THIS_RET, $id)
$visibleTo .= '</TR>';
if ($_REQUEST['modname']=='School_Setup/PortalNotes.php')
if ( $_REQUEST['modname']=='School_Setup/PortalNotes.php')
{
//hook
$args = $id;
......@@ -413,7 +413,7 @@ function makeFileAttached($value,$name)
{ global $THIS_RET, $PortalNotesFilesPath;
static $filesAttachedCount = 0;
if ($THIS_RET['ID'])
if ( $THIS_RET['ID'])
{
$id = $THIS_RET['ID'];
......
......@@ -51,7 +51,7 @@ function SendEmail($to, $subject, $message, $from = null, $cc = null)
}
$headers = 'From:'. $from ."\r\n";
if (!empty($cc))
if ( !empty($cc))
$headers .= "Cc:". $cc ."\r\n";
$headers .= 'Return-Path:'. $from ."\r\n";
$headers .= 'Reply-To:'. $from ."\r\n". 'X-Mailer: PHP/' . phpversion() ."\r\n";
......
......@@ -65,7 +65,7 @@ function _makeLetterGrade( $percent, $course_period_id = 0, $staff_id = 0, $ret
if ( $programconfig[$staff_id]['ROUNDING'] == 'UP' )
$percent = ceil( $percent );
elseif ($programconfig[$staff_id]['ROUNDING'] == 'DOWN' )
elseif ( $programconfig[$staff_id]['ROUNDING'] == 'DOWN' )
$percent = floor( $percent );
elseif ( $programconfig[$staff_id]['ROUNDING'] == 'NORMAL' )
......
......@@ -2,13 +2,13 @@
function _makePercentGrade($grade_id,$course_period_id=0,$staff_id=0)
{ global $programconfig,$_ROSARIO;
if (!$course_period_id)
if ( !$course_period_id)
$course_period_id = UserCoursePeriod();
if (!$staff_id)
if ( !$staff_id)
$staff_id = User('STAFF_ID');
if (!$programconfig[$staff_id])
if ( !$programconfig[$staff_id])
{
$config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='".$staff_id."' AND PROGRAM='Gradebook'"),array(),array('TITLE'));
if (count($config_RET))
......@@ -17,12 +17,12 @@ function _makePercentGrade($grade_id,$course_period_id=0,$staff_id=0)
else
$programconfig[$staff_id] = true;
}
if (!$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id])
if ( !$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id])
$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery("SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='".$course_period_id."'"));
$does_breakoff = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['DOES_BREAKOFF'];
$grade_scale_id = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['GRADE_SCALE_ID'];
if (!$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id])
if ( !$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id])
$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery("SELECT TITLE,ID,BREAK_OFF FROM REPORT_CARD_GRADES WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."' AND GRADE_SCALE_ID='".$grade_scale_id."' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER"));
//$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
......
......@@ -8,7 +8,7 @@ function GetRawPOSTvar($key)
$rawpost = "&".file_get_contents("php://input");
$pos = preg_match("/&".$key."=([^&]*)/i",$rawpost, $regs);
if ($pos == 1)
if ( $pos == 1)
return urldecode($regs[1]);
else
return null;
......
......@@ -2,16 +2,16 @@
function _makeNextSchool($value,$column)
{ global $THIS_RET;
if ($value=='0')
if ( $value=='0')
return _('Retain');
elseif ($value=='-1')
elseif ( $value=='-1')
return _('Do not enroll after this school year');
else
{
$school_RET = DBGet(DBQuery("SELECT TITLE FROM SCHOOLS WHERE SYEAR='".UserSyear()."' AND ID='".$value."'"));
$school_title = $school_RET[1]['TITLE'];
if ($value==$THIS_RET['SCHOOL_ID'])
if ( $value==$THIS_RET['SCHOOL_ID'])
return _('Next Grade at ').$school_title;
else
return $school_title;
......@@ -21,7 +21,7 @@ function _makeNextSchool($value,$column)
function _makeCalendar($value,$column)
{ global $calendars_RET;
if (!$calendars_RET)
if ( !$calendars_RET)
$calendars_RET = DBGet(DBQuery("SELECT CALENDAR_ID,DEFAULT_CALENDAR,TITLE FROM ATTENDANCE_CALENDARS WHERE SYEAR='".UserSyear()."'"),array(),array('CALENDAR_ID'));
return $calendars_RET[$value][1]['TITLE'];
......
......@@ -8,7 +8,7 @@ function GetStaffList(& $extra)
{
case 'admin':
case 'teacher':
if ($_REQUEST['expanded_view']=='true')
if ( $_REQUEST['expanded_view']=='true')
{
$select = ',LAST_LOGIN';
$extra['columns_after']['LAST_LOGIN'] = _('Last Login');
......@@ -27,13 +27,13 @@ function GetStaffList(& $extra)
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
if ( $field['TYPE']=='date')
$functions['CUSTOM_'.$field['ID']] = 'ProperDate';
elseif ($field['TYPE']=='numeric')
elseif ( $field['TYPE']=='numeric')
$functions['CUSTOM_'.$field['ID']] = 'removeDot00';
elseif ($field['TYPE']=='codeds')
elseif ( $field['TYPE']=='codeds')
$functions['CUSTOM_'.$field['ID']] = 'StaffDeCodeds';
elseif ($field['TYPE']=='exports')
elseif ( $field['TYPE']=='exports')
$functions['CUSTOM_'.$field['ID']] = 'StaffDeCodeds';
$select .= ',s.CUSTOM_'.$field['ID'];
}
......@@ -41,22 +41,22 @@ function GetStaffList(& $extra)
}
else
{
if (!$extra['columns_after'])
if ( !$extra['columns_after'])
$extra['columns_after'] = array();
if ($extra['staff_fields']['view'])
if ( $extra['staff_fields']['view'])
{
$view_fields_RET = DBGet(DBQuery("SELECT cf.ID,cf.TYPE,cf.TITLE FROM STAFF_FIELDS cf WHERE cf.ID IN (".$extra['staff_fields']['view'].") ORDER BY cf.SORT_ORDER,cf.TITLE"));
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
if ( $field['TYPE']=='date')
$functions['CUSTOM_'.$field['ID']] = 'ProperDate';
elseif ($field['TYPE']=='numeric')
elseif ( $field['TYPE']=='numeric')
$functions['CUSTOM_'.$field['ID']] = 'removeDot00';
elseif ($field['TYPE']=='codeds')
elseif ( $field['TYPE']=='codeds')
$functions['CUSTOM_'.$field['ID']] = 'StaffDeCodeds';
elseif ($field['TYPE']=='exports')
elseif ( $field['TYPE']=='exports')
$functions['CUSTOM_'.$field['ID']] = 'StaffDeCodeds';
$select .= ',s.CUSTOM_'.$field['ID'];
}
......@@ -66,7 +66,7 @@ function GetStaffList(& $extra)
if (User('PROFILE')!='admin')
{
$extra['WHERE'] .= " AND (s.STAFF_ID='".User('STAFF_ID')."' OR s.PROFILE='parent' AND exists(SELECT '' FROM STUDENTS_JOIN_USERS _sju,STUDENT_ENROLLMENT _sem,SCHEDULE _ss WHERE _sju.STAFF_ID=s.STAFF_ID AND _sem.STUDENT_ID=_sju.STUDENT_ID AND _sem.SYEAR='".UserSYEAR()."' AND _ss.STUDENT_ID=_sem.STUDENT_ID AND _ss.COURSE_PERIOD_ID='".UserCoursePeriod()."'";
if ($_REQUEST['include_inactive']!='Y')
if ( $_REQUEST['include_inactive']!='Y')
$extra['WHERE'] .= " AND _ss.MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).") AND ('".DBDate()."'>=_sem.START_DATE AND ('".DBDate()."'<=_sem.END_DATE OR _sem.END_DATE IS NULL)) AND ('".DBDate()."'>=_ss.START_DATE AND ('".DBDate()."'<=_ss.END_DATE OR _ss.END_DATE IS NULL))";
$extra['WHERE'] .= "))";
}
......@@ -80,7 +80,7 @@ function GetStaffList(& $extra)
WHERE
s.SYEAR='".UserSyear()."'";
//$sql = appendStaffSQL($sql,array('NoSearchTerms'=>$extra['NoSearchTerms']));
if ($_REQUEST['_search_all_schools']!='Y')
if ( $_REQUEST['_search_all_schools']!='Y')
$sql .= " AND (s.SCHOOLS LIKE '%,".UserSchool().",%' OR s.SCHOOLS IS NULL OR s.SCHOOLS='') ";
$sql .= $extra['WHERE'].' ';
......@@ -88,7 +88,7 @@ function GetStaffList(& $extra)
// it would be easier to sort on full_name but postgres sometimes yields strange results
$sql .= 'ORDER BY s.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME';
if ($extra['functions'])
if ( $extra['functions'])
$functions += $extra['functions'];
return DBGet(DBQuery($sql),$functions);
......@@ -99,7 +99,7 @@ function GetStaffList(& $extra)
function appendStaffSQL($sql,$extra)
{ global $_ROSARIO;
if ($_REQUEST['usrid'])
if ( $_REQUEST['usrid'])
{
//FJ allow comma separated list of staff IDs
$usrid_array = explode(',', $_REQUEST['usrid']);
......@@ -109,46 +109,46 @@ function appendStaffSQL($sql,$extra)
if (is_numeric($usrid))
$usrids[] = $usrid;
}
if (!empty($usrids))
if ( !empty($usrids))
{
$usrids = implode(',', $usrids);
//$sql .= " AND s.STAFF_ID='".$_REQUEST['usrid']."'";
$sql .= " AND s.STAFF_ID IN (".$usrids.")";
if (!$extra['NoSearchTerms'])
if ( !$extra['NoSearchTerms'])
$_ROSARIO['SearchTerms'] .= '<b>'._('User ID').': </b>'.$usrids.'<BR />';
}
}
if ($_REQUEST['last'])
if ( $_REQUEST['last'])
{
$sql .= " AND UPPER(s.LAST_NAME) LIKE '".mb_strtoupper($_REQUEST['last'])."%'";
if (!$extra['NoSearchTerms'])
if ( !$extra['NoSearchTerms'])
$_ROSARIO['SearchTerms'] .= '<b>'._('Last Name starts with').': </b>'.str_replace("''", "'", $_REQUEST['last']).'<BR />';
}
if ($_REQUEST['first'])
if ( $_REQUEST['first'])
{
$sql .= " AND UPPER(s.FIRST_NAME) LIKE '".mb_strtoupper($_REQUEST['first'])."%'";
if (!$extra['NoSearchTerms'])
if ( !$extra['NoSearchTerms'])
$_ROSARIO['SearchTerms'] .= '<b>'._('First Name starts with').': </b>'.str_replace("''", "'", $_REQUEST['first']).'<BR />';
}
if ($_REQUEST['profile'])
if ( $_REQUEST['profile'])
{
$sql .= " AND s.PROFILE='".$_REQUEST['profile']."'";
if (!$extra['NoSearchTerms'])
if ( !$extra['NoSearchTerms'])
$_ROSARIO['SearchTerms'] .= '<b>'._('Profile').': </b>'._(UCFirst($_REQUEST['profile'])).'<BR />';
}
if ($_REQUEST['username'])
if ( $_REQUEST['username'])
{
$sql .= " AND UPPER(s.USERNAME) LIKE '".mb_strtoupper($_REQUEST['username'])."%'";
if (!$extra['NoSearchTerms'])
if ( !$extra['NoSearchTerms'])
$_ROSARIO['SearchTerms'] .= '<b>'._('UserName starts with').': </b>'.str_replace("''", "'", $_REQUEST['username']).'<BR />';
}
......@@ -158,19 +158,19 @@ function appendStaffSQL($sql,$extra)
function makeProfile($value)
{ global $THIS_RET,$profiles_RET;
if ($value=='admin')
if ( $value=='admin')
$return = _('Administrator');
elseif ($value=='teacher')
elseif ( $value=='teacher')
$return = _('Teacher');
elseif ($value=='parent')
elseif ( $value=='parent')
$return = _('Parent');
elseif ($value=='none')
elseif ( $value=='none')
$return = _('No Access');
else $return = $value;
if ($THIS_RET['PROFILE_ID'])
if ( $THIS_RET['PROFILE_ID'])
$return .= ' / '.($profiles_RET[$THIS_RET['PROFILE_ID']]?$profiles_RET[$THIS_RET['PROFILE_ID']][1]['TITLE']:'<span style="color:red">'.$THIS_RET['PROFILE_ID'].'</span>');
elseif ($value!='none')
elseif ( $value!='none')
$return .= ' w/Custom';
return $return;
......@@ -179,14 +179,14 @@ function makeProfile($value)
function makeLogin($value,$title='LAST_LOGIN')
{
//FJ add failed login to expanded view
if ($title == 'LAST_LOGIN')
if ( $title == 'LAST_LOGIN')
{
if (empty($value))
return button('x');
else
return ProperDate(mb_substr($value,0,10)).mb_substr($value,10);
}
if ($title == 'FAILED_LOGIN')
if ( $title == 'FAILED_LOGIN')
{
if (empty($value))
return '0';
......
......@@ -13,19 +13,19 @@ function GetStuList(&$extra=array())
if (isset($extra['functions']))
$functions += $extra['functions'];
if (!isset($extra['MP']) && !isset($extra['DATE']))
if ( !isset($extra['MP']) && !isset($extra['DATE']))
{
$extra['MP'] = UserMP();
$extra['DATE'] = DBDate();
}
elseif (!$extra['MP'])
elseif ( !$extra['MP'])
$extra['MP'] = GetCurrentMP('QTR',$extra['DATE'],false);
elseif (!$extra['DATE'])
elseif ( !$extra['DATE'])
$extra['DATE'] = DBDate();
if (isset($_REQUEST['expanded_view']) && $_REQUEST['expanded_view']=='true')
{
if (!$extra['columns_after'])
if ( !$extra['columns_after'])
$extra['columns_after'] = array();
$view_fields_RET = DBGet(DBQuery("SELECT cf.ID,cf.TYPE,cf.TITLE
......@@ -36,7 +36,7 @@ function GetStuList(&$extra=array())
$view_address_RET = $view_address_RET[1]['VALUE'];
$view_other_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE PROGRAM='StudentFieldsView' AND TITLE IN ('CONTACT_INFO','HOME_PHONE','GUARDIANS','ALL_CONTACTS') AND USER_ID='".User('STAFF_ID')."'"),array(),array('TITLE'));
if (!count($view_fields_RET) && !isset($view_address_RET) && !isset($view_other_RET['CONTACT_INFO']))
if ( !count($view_fields_RET) && !isset($view_address_RET) && !isset($view_other_RET['CONTACT_INFO']))
{
//FJ add translation
$extra['columns_after'] = array('ADDRESS'=>_('Mailing Address'),'CITY'=>_('City'),'STATE'=>_('State'),'ZIPCODE'=>_('Zipcode')) + $extra['columns_after'];
......@@ -46,7 +46,7 @@ function GetStuList(&$extra=array())
{
$extra['columns_after'] = array('CUSTOM_'.$field['ID']=>ParseMLField($field['TITLE'])) + $extra['columns_after'];
// if gender and ethnicity are converted to codeds or exports type
if ($field['TYPE']=='codeds' || $field['TYPE']=='exports')
if ( $field['TYPE']=='codeds' || $field['TYPE']=='exports')
$functions['CUSTOM_'.$field['ID']] = 'DeCodeds';
$select .= ',s.CUSTOM_'.$field['ID'];
}
......@@ -66,7 +66,7 @@ function GetStuList(&$extra=array())
$extra2['group'] = array('STUDENT_ID','PERSON_ID');
// EXPANDED VIEW AND ADDR BREAKS THIS QUERY ... SO, TURN 'EM OFF
if (!isset($_REQUEST['_ROSARIO_PDF']))
if ( !isset($_REQUEST['_ROSARIO_PDF']))
{
$expanded_view = $_REQUEST['expanded_view'];
$_REQUEST['expanded_view'] = false;
......@@ -81,7 +81,7 @@ function GetStuList(&$extra=array())
}
else
{
if ($view_other_RET['CONTACT_INFO'][1]['VALUE']=='Y' && !isset($_REQUEST['_ROSARIO_PDF']))
if ( $view_other_RET['CONTACT_INFO'][1]['VALUE']=='Y' && !isset($_REQUEST['_ROSARIO_PDF']))
{
$select .= ',ssm.STUDENT_ID AS CONTACT_INFO ';
$extra['columns_after']['CONTACT_INFO'] = button('down_phone');
......@@ -110,42 +110,42 @@ function GetStuList(&$extra=array())
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
if ( $field['TYPE']=='date')
$functions['CUSTOM_'.$field['ID']] = 'ProperDate';
elseif ($field['TYPE']=='numeric')
elseif ( $field['TYPE']=='numeric')
$functions['CUSTOM_'.$field['ID']] = 'removeDot00';
elseif ($field['TYPE']=='codeds')
elseif ( $field['TYPE']=='codeds')
$functions['CUSTOM_'.$field['ID']] = 'DeCodeds';
elseif ($field['TYPE']=='exports')
elseif ( $field['TYPE']=='exports')
$functions['CUSTOM_'.$field['ID']] = 'DeCodeds';
$select .= ',s.CUSTOM_'.$field['ID'];
}
if ($view_address_RET)
if ( $view_address_RET)
{
$extra['FROM'] = " LEFT OUTER JOIN STUDENTS_JOIN_ADDRESS sam ON (ssm.STUDENT_ID=sam.STUDENT_ID AND sam.".$view_address_RET."='Y') LEFT OUTER JOIN ADDRESS a ON (sam.ADDRESS_ID=a.ADDRESS_ID) ".$extra['FROM'];
$extra['columns_after'] += array('ADDRESS'=>_(ucwords(mb_strtolower(str_replace('_',' ',$view_address_RET)))).' '._('Address'),'CITY'=>_('City'),'STATE'=>_('State'),'ZIPCODE'=>_('Zipcode'));
if ($view_address_RET!='MAILING')
if ( $view_address_RET!='MAILING')
$select .= ",a.ADDRESS_ID,a.ADDRESS,a.CITY,a.STATE,a.ZIPCODE,a.PHONE,ssm.STUDENT_ID AS PARENTS";
else
$select .= ",a.ADDRESS_ID,coalesce(a.MAIL_ADDRESS,a.ADDRESS) AS ADDRESS,coalesce(a.MAIL_CITY,a.CITY) AS CITY,coalesce(a.MAIL_STATE,a.STATE) AS STATE,coalesce(a.MAIL_ZIPCODE,a.ZIPCODE) AS ZIPCODE,a.PHONE,ssm.STUDENT_ID AS PARENTS ";
$extra['singular'] = 'Student Address';