Skip to content

Commit

Permalink
Updates for 7.2 release
Browse files Browse the repository at this point in the history
openSIS CE 7.2 release commit.
  • Loading branch information
openSISAdmin committed Apr 23, 2019
1 parent 4db1967 commit 4a53c8c
Show file tree
Hide file tree
Showing 35 changed files with 577 additions and 145 deletions.
4 changes: 2 additions & 2 deletions Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
});
}
if($(".table-responsive").hasScrollBar("horizontal")){
/*if(hasScrollBar(".table-responsive", "horizontal")){
$(".table-responsive").mousewheel(function (e, delta) {
this.scrollLeft -= (delta * 40);
e.preventDefault();
});
}
}*/
$(".switch-fake-title").closest("label").children("input[type=checkbox]").change(function(){
if($(this).is(":checked")){
Expand Down
9 changes: 8 additions & 1 deletion MassScheduleSessionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
{
$_SESSION['MassSchedule.php']['course_period_id']=$_REQUEST['course_period_id'];
$gender_res = DBGet(DBQuery('SELECT GENDER_RESTRICTION FROM course_periods WHERE COURSE_PERIOD_ID='.$_REQUEST['course_period_id']));
$marking_period= DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM course_periods WHERE COURSE_PERIOD_ID='.$_REQUEST['course_period_id']));
if($marking_period[1]['MARKING_PERIOD_ID']==''){
$get_syear_mpid=DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SCHOOL_ID='.UserSchool().' AND SYEAR='.UserSyear()));
$marking_period=$get_syear_mpid;
}
$get_mp_det=DBGet(DBQuery('SELECT * FROM marking_periods WHERE MARKING_PERIOD_ID='.$marking_period[1]['MARKING_PERIOD_ID']));

$_SESSION['MassSchedule.php']['gender'] = $gender_res[1]['GENDER_RESTRICTION'];
// $_REQUEST['title'] = str_replace('"', '\"', $_REQUEST['title']);
if ($gender_res[1]['GENDER_RESTRICTION'] != 'N')
Expand All @@ -45,7 +52,7 @@
if($_REQUEST['subject_id'])
$_SESSION['MassSchedule.php']['subject_id']=$_REQUEST['subject_id'];

echo $_REQUEST['title'];
echo $_REQUEST['title'].'|_*|*_|'.$get_mp_det[1]['MARKING_PERIOD_ID'].'|_*|*_|'.$get_mp_det[1]['TITLE'];

}
?>
3 changes: 3 additions & 0 deletions assets/css/export_print.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}
td{ font-size:11px; color:#000;}
.table tr td {
padding: 5px;
font-size:11px;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
.table tr td.subtabs {
background: #eee;
border-bottom: 1px solid #ccc;
font-size:11px;
}
23 changes: 11 additions & 12 deletions assets/js/core/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,16 +664,15 @@ $(function () {
});


jQuery.fn.hasScrollBar = function (direction)
{
if (direction == 'vertical')
{
return this.get(0).scrollHeight > this.innerHeight();
}
else if (direction == 'horizontal')
{
return this.get(0).scrollWidth > this.innerWidth();
}
return false;
//function hasScroll(el, direction){
// direction = (direction === 'vertical') ? 'scrollTop' : 'scrollLeft';
// var result = !! el[direction];
//
// if (!result) {
// el[direction] = 1;
// result = !!el[direction];
// el[direction] = 0;
// }
// return result;
//}

}
36 changes: 35 additions & 1 deletion assets/js/pages/picker_date.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $(function () {
$(this).next('.input-group').children('.daterange-single').trigger('focus');
});
$('.datepicker-group .daterange-single').datepicker({
selectYears: true,
selectYears: false,
selectMonths: true,
autoclose: true,
//format: 'dd-M-yyyy',
Expand All @@ -94,6 +94,15 @@ $(function () {
minViewMode: 1,
maxViewMode: 2
})

$('.datepicker-group-month-date .daterange-single').datepicker({
selectDays: true,
selectMonths: true,
autoclose: true,
format: "mm-dd",
minViewMode: "days",
maxViewMode: 1
})
.change(function(){

var calid2 = $(this).attr('id');
Expand Down Expand Up @@ -137,6 +146,31 @@ $(function () {

$('input[type=submit], button[type=submit]').attr('disabled',false);
});

$('.datepicker-group-month-date .daterange-single').change(function (e) {
$('input[type=submit], button[type=submit]').attr('disabled',true);
var calid = $(this).attr('id');
var selectedDate = $(this).val();
//var newDate = new Date(selectedDate);
var newDate = selectedDate.split("-");

// var monthNames = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN",
// "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
// ];


//$('#daySelect_' + calid).val(newDate.getDate());
//$('#monthSelect_' + calid).val(monthNames[newDate.getMonth()]);
//$('#yearSelect_' + calid).val(newDate.getFullYear());

$('#daySelect_' + calid).val(newDate[1]);
$('#monthSelect_' + calid).val(newDate[0]);


$('input[type=submit], button[type=submit]').attr('disabled',false);
});


}

/*$('.daterange-single').on('apply.daterangepicker', function (ev, picker) {
Expand Down
30 changes: 24 additions & 6 deletions functions/GetStuListFnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ function GetStuList(& $extra) {
if ($extra['DEBUG'] === true)
echo '<!--' . $sql . '-->';



$return = DBGet(DBQuery($sql), $functions, $extra['group']);
$_SESSION['count_stu'] = count($return);
Expand Down Expand Up @@ -757,7 +758,8 @@ function appendSQL($sql, & $extra) {

//////////////extra field table start2////////////////////

if ($_REQUEST['username']) {

if ($_REQUEST['username']) {
$sql .= ' AND LOWER(la.username) LIKE \'' . singleQuoteReplace("'", "\'", strtolower(trim($_REQUEST['username']))) . '%\' and la.user_id=s.student_id ';
}
//////////////extra field table end2////////////////////
Expand Down Expand Up @@ -903,21 +905,37 @@ function appendSQL($sql, & $extra) {
if (!$extra['NoSearchTerms'])
$_openSIS['SearchTerms'] .= '<font color=gray><b>Nurse Visit Comments starts with: </b></font>' . $_REQUEST['med_vist_comments'] . '<BR>';
}
if ($_REQUEST['day_to_birthdate'] && $_REQUEST['month_to_birthdate'] && $_REQUEST['year_to_birthdate'] && $_REQUEST['day_from_birthdate'] && $_REQUEST['month_from_birthdate'] && $_REQUEST['year_from_birthdate']) {

if ($_REQUEST['day_to_birthdate'] && $_REQUEST['month_to_birthdate'] && $_REQUEST['day_from_birthdate'] && $_REQUEST['month_from_birthdate']) {

$date_to =$_REQUEST['year_to_birthdate'].'-'.$_REQUEST['day_to_birthdate'] . '-' . $_REQUEST['month_to_birthdate'];
$date_from = $_REQUEST['year_from_birthdate'] . '-' .$_REQUEST['day_from_birthdate'] . '-' . $_REQUEST['month_from_birthdate'];
// $date_to =$_REQUEST['year_to_birthdate'].'-'.$_REQUEST['day_to_birthdate'] . '-' . $_REQUEST['month_to_birthdate'];
//$date_from = $_REQUEST['year_from_birthdate'] . '-' .$_REQUEST['day_from_birthdate'] . '-' . $_REQUEST['month_from_birthdate'];

// $sql .= ' AND (SUBSTR(s.BIRTHDATE,6,2) BETWEEN \'' . $_REQUEST['month_from_birthdate'] . '\' AND \'' . $_REQUEST['month_to_birthdate'] . '\') ';
// $sql .= ' AND (SUBSTR(s.BIRTHDATE,9,2) BETWEEN \'' . $_REQUEST['day_from_birthdate'] . '\' AND \'' . $_REQUEST['day_to_birthdate'] . '\') ';
//
$sql .= ' AND (s.BIRTHDATE BETWEEN \'' .$date_from . '\' AND \'' . $date_to. '\') ';
// $sql .= ' AND (s.BIRTHDATE BETWEEN \'' .$date_from . '\' AND \'' . $date_to. '\') ';
// $sql .= ' AND (s.BIRTHDATE >= \'' .$date_from . '\' AND s.BIRTHDATE <= \'' . $date_to. '\') ';
if (!$extra['NoSearchTerms'])
$date_to = $_REQUEST['month_to_birthdate'] . '-' . $_REQUEST['day_to_birthdate'];
$date_from = $_REQUEST['month_from_birthdate'] . '-' . $_REQUEST['day_from_birthdate'];
$sql .= ' AND (SUBSTR(s.BIRTHDATE,6,2) BETWEEN \'' . $_REQUEST['day_from_birthdate'] . '\' AND \'' . $_REQUEST['day_to_birthdate'] . '\') ';
$sql .= ' AND (SUBSTR(s.BIRTHDATE,9,2) BETWEEN \'' . $_REQUEST['month_from_birthdate'] . '\' AND \'' . $_REQUEST['month_to_birthdate'] . '\') ';
if (!$extra['NoSearchTerms'])
$_openSIS['SearchTerms'] .= '<font color=gray><b>Birthday Starts from ' . $date_from . ' to ' . $date_to . '</b></font>';
}


if ($_REQUEST['day_dob_birthdate'] && $_REQUEST['month_dob_birthdate'] && $_REQUEST['year_dob_birthdate']) {


$date_dob = $_REQUEST['year_dob_birthdate'] . '-' . $_REQUEST['day_dob_birthdate'].'-'.$_REQUEST['month_dob_birthdate'];
//$date_from = $_REQUEST['month_from_birthdate'] . '-' . $_REQUEST['day_from_birthdate'];
$sql .= ' AND s.BIRTHDATE = \'' .$date_dob. '\'';
//$sql .= ' AND (SUBSTR(s.BIRTHDATE,9,2) BETWEEN \'' . $_REQUEST['month_from_birthdate'] . '\' AND \'' . $_REQUEST['month_to_birthdate'] . '\') ';
if (!$extra['NoSearchTerms'])
$_openSIS['SearchTerms'] .= '<font color=gray><b>Birthday is ' .$date_dob . '</b></font>';
}


if ($_REQUEST['day_to_est'] && $_REQUEST['month_to_est'] && $_REQUEST['day_from_est'] && $_REQUEST['month_from_est']) {
$date_to_est = $_REQUEST['year_to_est'] . '-' .$_REQUEST['month_to_est'] . '-' . $_REQUEST['day_to_est'];
Expand Down
54 changes: 54 additions & 0 deletions functions/InputsFnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,60 @@ function SearchDateInput($day, $month, $year, $allow_day, $allow_month, $allow_y
return $dt;
}




function SearchDateInputDob($day, $month, $year, $allow_day, $allow_month, $allow_year) {
$dt = '';

$dt.= '<div class="input-group datepicker-group-month-date" id="original_date_' . $day . '" value="" style="">';
$dt.= '<span class="input-group-addon"><i class="icon-calendar22"></i></span>';
$dt.= '<input id="date_' . $day . '" placeholder="Select Date" value="" class="form-control daterange-single" type="text">';
$dt.= '</div>';

$dt.= '<input value="" id="monthSelect_date_' . $day . '" name="' . $day . '" type="hidden">';
$dt.= '<input value="" id="daySelect_date_' . $day . '" name="' . $month . '" type="hidden">';


/* if ($allow_day == 'Y') {
$dt.='<div class="col-xs-3">';
$dt.='<select class="form-control" name="' . $day . '" id="' . $day . '">';
$dt.='<option value="">Day</option>';
for ($i = 1; $i <= 31; $i++) {
if ($i < 10)
$i = '0' . $i;
$dt.='<option value="' . $i . '">' . $i . '</option>';
}
$dt.='</select>';
$dt.='</div>';
}
if ($allow_month == 'Y') {
$dt.='<div class="col-xs-3">';
$dt.='<select class="form-control" name="' . $month . '" id="' . $month . '">';
$dt.='<option value="">Month</option><option value="01">January</option><option value="02">February</option><option value="03">March</option><option value="04">April</option><option value="05">May</option><option value="06">June</option><option value="07">July</option><option value="08">August</option><option value="09">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option>';
$dt.='</select>';
$dt.='</div>';
}
if ($allow_year == 'Y') {
$dt.='<div class="col-xs-3">';
$dt.='<select class="form-control" name="' . $year . '" id="' . $year . '">';
$dt.='<option value="">Year</option>';
for ($i = 1930; $i <= 2030; $i++) {
$dt.='<option value="' . $i . '">' . $i . '</option>';
}
$dt.='</select>';
$dt.='</div>';
} */

return $dt;
}


function DateInput_for_EndInput($value, $name, $title = '', $div = true, $allow_na = true) {
if (Preferences('HIDDEN') != 'Y')
$div = false;
Expand Down
41 changes: 34 additions & 7 deletions functions/ListOutputFnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -10475,13 +10475,40 @@ function ListOutputGrade($result, $column_names, $singular = '', $plural = '', $
$number_rec = 100;
if ($result_count > $number_rec) {
echo "<script language='javascript' type='text/javascript'>\n";
echo '$(function(){if($("#results").length>0){';

echo "var pager = new Pager('results',$number_rec);\n";
echo "pager.init();\n";
echo "pager.showPageNav('pager', 'pagerNavPosition');\n";
echo "pager.showPage(1);\n";
echo '}});';
echo "var table = $('#results').DataTable({"
. "dom: '<\"datatable-header\"ip><\"datatable-scroll\"t><\"datatable-footer\"ip>',"
. "language: {
search: '<span>Filter:</span> _INPUT_',
lengthMenu: '<span>Show:</span> _MENU_',
paginate: { 'first': 'First', 'last': 'Last', 'next': '&rarr;', 'previous': '&larr;' }
},
drawCallback: function () {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').addClass('dropup');
},
preDrawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').removeClass('dropup');
},
columnDefs: [
{
orderable: false,
targets: 0
}
],
aaSorting: [],
'iDisplayLength': " . $number_rec . ""
. "});";
echo "datatable.subscribe('checkboxClickEvent', function(oArgs) {
var elCheckbox = oArgs.target;
var newValue = elCheckbox.checked;
var record = this.getRecord(elCheckbox);
var column = this.getColumn(elCheckbox);
record.setData(column.key,newValue);
}); ";
echo "table.on('page', function () { $('#results thead tr th:first-child input[type=checkbox]').prop('checked',false); $('#results tbody tr td:first-child input[type=checkbox]').prop('checked',false); } );";
echo "$('.dataTables_length select').select2({
minimumResultsForSearch: Infinity,
width: 'auto'
});";
echo "</script>\n";
}
}
Expand Down
2 changes: 1 addition & 1 deletion functions/PdfStartFnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function PDFStart($options="--webpage --quiet -t pdf12 --jpeg --no-links --portr
{$_REQUEST['_openSIS_PDF'] = 1;
$pdfitems['options']=$options;
ob_start();
echo "<link rel='stylesheet' type='text/css' href='styles/Export.css'><body style=\" font-family:Arial; font-size:12px;\">";
echo "<link rel='stylesheet' type='text/css' href='assets/css/export_print.css'><body style=\" font-family:Arial;\">";
return $pdfitems;
}
?>
7 changes: 7 additions & 0 deletions functions/ProperDateFnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ function ProperDateMAvr($date='')
{
$month_array=array("jan"=>"01","feb"=>"02","mar"=>"03","apr"=>"04","may"=>"05","jun"=>"06","jul"=>"07","aug"=>"08","sep"=>"09","oct"=>"10","nov"=>"11","dec"=>"12");
$date=explode("-",$date);
if(is_numeric($date[1])){
$date=$date[0].'-'.$date[1].'-'.$date[2];
}
else
{
$date=$date[0].'-'.$month_array[strtolower($date[1])].'-'.$date[2];
}

return $date;
}
else
Expand Down
11 changes: 8 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,19 @@
if (isset($login_RET) && count($login_RET) > 0) {
if ($ad_f_cnt && $ad_f_cnt != 0 && $login_RET[1]['FAILED_LOGIN'] < $ad_f_cnt && $login_RET[1]['PROFILE'] != 'admin')
$error[] = "Either your account is inactive or your access permission has been revoked. Please contact the school administration.";
else
$error[] = "Due to excessive incorrect login attempts your account has been disabled. Contact the school administration to enable your account.";
else{
$check_acess=DBGet(DBQuery('SELECT OPENSIS_ACCESS FROM staff_school_info WHERE STAFF_ID='.$login_RET[1]['STAFF_ID']));
if($check_acess[1]['OPENSIS_ACCESS']=='N')
$error[] = "You do not have portal access. Contact the school administration to enable it.";
else
$error[] = "Your account has been disabled. Contact the school administration to enable your account.";
}
}
if (isset($student_RET) && count($student_RET) > 0) {
if ($ad_f_cnt && $ad_f_cnt != 0 && $student_RET[1]['FAILED_LOGIN'] < $ad_f_cnt)
$error[] = "Either your account is inactive or your access permission has been revoked. Please contact the school administration.";
else
$error[] = "Due to excessive incorrect login attempts your account has been disabled. Contact the school administration to enable your account.";
$error[] = "Your account has been disabled. Contact the school administration to enable your account.";
}
}
elseif ($student_RET) {
Expand Down
2 changes: 1 addition & 1 deletion install/OpensisSchemaMysqlInc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ CREATE VIEW enroll_grade AS
SELECT e.id, e.syear, e.school_id, e.student_id, e.start_date, e.end_date, sg.short_name, sg.title
FROM student_enrollment e, school_gradelevels sg WHERE (e.grade_id = sg.id);

CREATE VIEW transcript_grades AS
CREATE VIEW transcript_grades_new AS
SELECT s.id AS school_id, IF(mp.mp_source='history',(SELECT school_name FROM history_school WHERE student_id=rcg.student_id and marking_period_id=mp.marking_period_id),s.title) AS school_name,mp_source, mp.marking_period_id AS mp_id,
mp.title AS mp_name, mp.syear, mp.end_date AS posted, rcg.student_id,
sgc.grade_level_short AS gradelevel, rcg.grade_letter, rcg.unweighted_gp AS gp_value,
Expand Down
8 changes: 4 additions & 4 deletions install/SqlForClientSchoolAndSampleDataInc.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
--
INSERT INTO `app` (`name`, `value`) VALUES
('version', '7.1'),
('date', 'November 28, 2018'),
('build', '20181128001'),
('version', '7.2'),
('date', 'April 22, 2019'),
('build', '20190422001'),
('update', '0'),
('last_updated', 'November 28, 2018');
('last_updated', 'April 22, 2019');
--
-- Dumping data for table `attendance_calendar`
Expand Down
8 changes: 4 additions & 4 deletions install/SqlForClientSchoolInc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
INSERT INTO `app` (`name`, `value`) VALUES
('version', '7.1'),
('date', 'November 28, 2018'),
('build', '20181128001'),
('version', '7.2'),
('date', 'April 22, 2019'),
('build', '20190422001'),
('update', '0'),
('last_updated', 'November 28, 2018');
('last_updated', 'April 22, 2019');
--
-- Dumping data for table `address`
Expand Down
Loading

0 comments on commit 4a53c8c

Please sign in to comment.