Skip to content

Commit

Permalink
Add User / Student photo tooltip: use makePhotoTipMessage() instead o…
Browse files Browse the repository at this point in the history
…f local function
  • Loading branch information
francoisjacquet committed Apr 30, 2022
1 parent f8b9f81 commit aa8d65a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 52 deletions.
30 changes: 2 additions & 28 deletions modules/Attendance/TeacherCompletion.php
Expand Up @@ -96,7 +96,7 @@
}
else
{
$sql = "SELECT s.STAFF_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
$sql = "SELECT s.STAFF_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,s.ROLLOVER_ID,
sp.TITLE,cpsp.PERIOD_ID,cp.TITLE AS CP_TITLE,
(SELECT 'Y'
FROM ATTENDANCE_COMPLETED ac
Expand Down Expand Up @@ -127,7 +127,7 @@
ORDER BY FULL_NAME";
}

$RET = DBGet( $sql, [ 'FULL_NAME' => '_makeUserPhotoTipMessage' ], [ 'STAFF_ID' ] );
$RET = DBGet( $sql, [ 'FULL_NAME' => 'makePhotoTipMessage' ], [ 'STAFF_ID' ] );

if ( ! isset( $_REQUEST['period'] )
|| ! $_REQUEST['period'] )
Expand Down Expand Up @@ -196,29 +196,3 @@
[ 'STAFF_ID' ]
);
}

/**
* Make User Photo Tip Message
*
* Local function
*
* @uses MakeUserPhotoTipMessage()
*
* @global $THIS_RET
*
* @since 9.0
*
* @param string $value User full name.
* @param string $column Column, defaults to 'FULL_NAME'.
* @return string User full name plus photo tip message.
*/
function _makeUserPhotoTipMessage( $value, $column = 'FULL_NAME' )
{
global $THIS_RET;

$staff_id = $THIS_RET['STAFF_ID'];

$title = $value;

return MakeUserPhotoTipMessage( $staff_id, $title );
}
25 changes: 1 addition & 24 deletions modules/Eligibility/StudentList.php
@@ -1,5 +1,4 @@
<?php
require_once 'ProgramFunctions/TipMessage.fnc.php';

// GET ALL THE CONFIG ITEMS FOR ELIGIBILITY
$eligibility_config = ProgramConfig( 'eligibility' );
Expand Down Expand Up @@ -68,7 +67,7 @@
$extra['FROM'] = ",ELIGIBILITY e,COURSES c,COURSE_PERIODS cp";
$extra['WHERE'] = "AND e.STUDENT_ID=ssm.STUDENT_ID AND e.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND e.SCHOOL_DATE BETWEEN '" . $start_date . "' AND '" . $end_date . "'";

$extra['functions'] = [ 'ELIGIBILITY_CODE' => '_makeLower', 'FULL_NAME' => '_makeStudentPhotoTipMessage' ];
$extra['functions'] = [ 'ELIGIBILITY_CODE' => '_makeLower', 'FULL_NAME' => 'makePhotoTipMessage' ];
$extra['group'] = [ 'STUDENT_ID' ];

Widgets( 'eligibility' );
Expand Down Expand Up @@ -110,25 +109,3 @@ function _makeLower( $word )
{
return ucwords( mb_strtolower( $word ) );
}

/**
* Make Student Photo Tip Message
*
* @since 9.0
*
* @uses MakeStudentPhotoTipMessage()
*
* @param string $value Student name.
* @param string $column Column name FULL_NAME.
* @return string Student Photo Tip Message
*/
function _makeStudentPhotoTipMessage( $value, $column = 'FULL_NAME' )
{
global $THIS_RET;

$student_id = $THIS_RET['STUDENT_ID'];

$student_name = $value;

return MakeStudentPhotoTipMessage( $student_id, $student_name );
}

0 comments on commit aa8d65a

Please sign in to comment.