Skip to content

Commit

Permalink
Version 11.5 update
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Mar 15, 2024
1 parent 4f9c64f commit 25b164e
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 11 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT
@@ -1,6 +1,6 @@
/**
* @package RosarioSIS
* @version 11.4.4 - February, 2024
* @version 11.5 - March, 2024
* @copyright (C) 2004-2009 The Miller Group
* @copyright (C) 2006 Andrew Schmadeke (Discipline & Student Billing modules)
* @copyright (C) 2009 Glenn-Abbey Software
Expand Down
93 changes: 91 additions & 2 deletions ProgramFunctions/Update.fnc.php
Expand Up @@ -31,7 +31,7 @@ function Update()
* Prevent DB version update if new Update.fnc.php file has NOT been uploaded YET.
* Update must be run once both new Warehouse.php & Update.fnc.php files are uploaded.
*/
if ( version_compare( '11.4.4', ROSARIO_VERSION, '<' ) )
if ( version_compare( '11.5', ROSARIO_VERSION, '<' ) )
{
return false;
}
Expand Down Expand Up @@ -1166,7 +1166,96 @@ function _update1144()
return $return;
}

// TODO 11.4 Remove assets/FS_icons/, assets/AssignmentsFiles/ & assets/PortalNotesFiles/ dir
// if no files were uploaded.
// @deprecated since 11.4 Assignments Files upload path $AssignmentsFilesPath global var
// @deprecated since 11.4 Portal Notes Files upload path $PortalNotesFilesPath global var
// @deprecated since 11.4 Food Service Icons upload path $FS_IconsPath global var
// TODO 11.4 try to remove assets/FS_icons/, AssignmentsFiles/ & PortalNotesFiles/ only if default files in it.


if ( is_dir( 'assets/AssignmentsFiles/' )
// Check if dir has no subdir (apart from README).
&& ! glob( 'assets/AssignmentsFiles/*', GLOB_ONLYDIR )
&& is_writable( 'assets/AssignmentsFiles/' ) )
{
if ( file_exists( 'assets/AssignmentsFiles/README' ) )
{
@unlink( 'assets/AssignmentsFiles/README' );
}

if ( ! glob( 'assets/AssignmentsFiles/*' ) )
{
// Dir is empty, delete it.
rmdir( 'assets/AssignmentsFiles/' );
}
}

if ( is_dir( 'assets/PortalNotesFiles/' )
// Check if dir has no uploaded files (apart from README).
&& ! glob( 'assets/PortalNotesFiles/*.*' )
&& is_writable( 'assets/PortalNotesFiles/' ) )
{
if ( file_exists( 'assets/PortalNotesFiles/README' ) )
{
@unlink( 'assets/PortalNotesFiles/README' );
}

if ( ! glob( 'assets/PortalNotesFiles/*' ) )
{
// Dir is empty, delete it.
rmdir( 'assets/PortalNotesFiles/' );
}
}

global $FileUploadsPath;

if ( is_dir( 'assets/FileUploads/FS_icons/' )
&& is_dir( 'assets/FS_icons/' )
// Check if dir has files.
&& ( $fs_icons_files = glob( 'assets/FS_icons/*' ) ) )
{
$default_fs_icons_files = [
'assets/FS_icons/Cheese.png',
'assets/FS_icons/Chicken.png',
'assets/FS_icons/Coffee.png',
'assets/FS_icons/Drink.png',
'assets/FS_icons/Fruit.png',
'assets/FS_icons/Guest.png',
'assets/FS_icons/Iced-Tea.png',
'assets/FS_icons/Lunch.png',
'assets/FS_icons/Milk.png',
'assets/FS_icons/Piece-of-cake.png',
'assets/FS_icons/Pizza.png',
'assets/FS_icons/README',
'assets/FS_icons/Salad.png',
'assets/FS_icons/Sandwich.png',
'assets/FS_icons/Seafood.png',
];

if ( $fs_icons_files === $default_fs_icons_files )
{
// Files inside dir are default files: no files were uploaded, delete them
foreach ( (array) $fs_icons_files as $fs_icon_file )
{
@unlink( $fs_icon_file );
}
}
else
{
// Files inside dir are not default files: some files were uploaded, move them
foreach ( (array) $fs_icons_files as $fs_icon_file )
{
@rename(
$fs_icon_file,
str_replace( 'assets/FS_icons/', $FileUploadsPath . 'FS_icons/', $fs_icon_file )
);
}
}

if ( ! glob( 'assets/FS_icons/*' )
&& is_writable( 'assets/FS_icons/' ) )
{
// Dir is now empty, delete it.
rmdir( 'assets/FS_icons/' );
}
}
16 changes: 10 additions & 6 deletions Warehouse.php
Expand Up @@ -18,7 +18,7 @@
* @package RosarioSIS
*/

define( 'ROSARIO_VERSION', '11.4.4' );
define( 'ROSARIO_VERSION', '11.5' );

/**
* Include config.inc.php file.
Expand Down Expand Up @@ -557,6 +557,7 @@ function _LoadAddons( $addons, $folder )
* @since 3.8 Warehouse footer hook
* @since 4.4 Warehouse header hook
* @since 6.0 Warehouse Header Javascripts
* @since 12.0 HTML Use `<main>` tag for #body TODO test in IE11!
*
* @global $_ROSARIO Uses $_ROSARIO['ProgramLoaded'] & $_ROSARIO['page']
*
Expand Down Expand Up @@ -619,7 +620,10 @@ function Warehouse( $mode )
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="assets/themes/<?php echo Preferences( 'THEME' ); ?>/stylesheet.css?v=<?php echo ROSARIO_VERSION; ?>">
<style>.highlight,.highlight-hover:hover{background-color:<?php echo Preferences( 'HIGHLIGHT' ); ?> !important;}</style>
<style>
span.multilang[lang|="<?php echo $lang_2_chars; ?>"]{display: initial;}
.highlight,.highlight-hover:hover{background-color:<?php echo Preferences( 'HIGHLIGHT' ); ?> !important;}
</style>
<?php

if ( $_ROSARIO['page'] === 'modules'
Expand Down Expand Up @@ -671,7 +675,7 @@ function Warehouse( $mode )
endif;

?>
<div id="body" tabindex="0" role="main" class="mod">
<main id="body" tabindex="0" class="mod">
<?php
/**
* Hook.
Expand Down Expand Up @@ -717,7 +721,7 @@ function Warehouse( $mode )
// If not AJAX request.
if ( ! isAJAX() ):
?>
</div><!-- #body -->
</main><!-- #body -->
<div class="ajax-error"></div>
<?php

Expand Down Expand Up @@ -750,7 +754,7 @@ function Warehouse( $mode )
elseif ( ! isAJAX() ): // Other pages (not modules).

?>
</div><!-- #body -->
</main><!-- #body -->
</body></html>
<?php
endif;
Expand All @@ -776,7 +780,7 @@ function WarehouseHeaderJS()
$lang_2_chars = mb_substr( $_SESSION['locale'], 0, 2 );

?>
<script src="assets/js/jquery.js?v=2.2.4"></script>
<script src="assets/js/jquery.js?v=3.7.1"></script>
<script src="assets/js/plugins.min.js?v=<?php echo ROSARIO_VERSION; ?>"></script>
<script src="assets/js/jscalendar/lang/calendar-<?php echo file_exists( 'assets/js/jscalendar/lang/calendar-' . $lang_2_chars . '.js' ) ? $lang_2_chars : 'en'; ?>.js"></script>
<?php
Expand Down
2 changes: 1 addition & 1 deletion rosariosis.sql
Expand Up @@ -2265,7 +2265,7 @@ INSERT INTO attendance_codes VALUES (NEXTVAL('attendance_codes_id_seq'), 2023, 1
--

INSERT INTO config VALUES (0, 'LOGIN', 'No');
INSERT INTO config VALUES (0, 'VERSION', '11.4.4');
INSERT INTO config VALUES (0, 'VERSION', '11.5');
INSERT INTO config VALUES (0, 'TITLE', 'Rosario Student Information System');
INSERT INTO config VALUES (0, 'NAME', 'RosarioSIS');
INSERT INTO config VALUES (0, 'MODULES', 'a:13:{s:12:"School_Setup";b:1;s:8:"Students";b:1;s:5:"Users";b:1;s:10:"Scheduling";b:1;s:6:"Grades";b:1;s:10:"Attendance";b:1;s:11:"Eligibility";b:1;s:10:"Discipline";b:1;s:10:"Accounting";b:1;s:15:"Student_Billing";b:1;s:12:"Food_Service";b:1;s:9:"Resources";b:1;s:6:"Custom";b:1;}');
Expand Down
2 changes: 1 addition & 1 deletion rosariosis_mysql.sql
Expand Up @@ -2285,7 +2285,7 @@ INSERT INTO attendance_codes VALUES (NULL, 2023, 1, 'Excused Absence', 'E', 'off
--

INSERT INTO config VALUES (0, 'LOGIN', 'No', NULL, NULL);
INSERT INTO config VALUES (0, 'VERSION', '11.4.4', NULL, NULL);
INSERT INTO config VALUES (0, 'VERSION', '11.5', NULL, NULL);
INSERT INTO config VALUES (0, 'TITLE', 'Rosario Student Information System', NULL, NULL);
INSERT INTO config VALUES (0, 'NAME', 'RosarioSIS', NULL, NULL);
INSERT INTO config VALUES (0, 'MODULES', 'a:13:{s:12:"School_Setup";b:1;s:8:"Students";b:1;s:5:"Users";b:1;s:10:"Scheduling";b:1;s:6:"Grades";b:1;s:10:"Attendance";b:1;s:11:"Eligibility";b:1;s:10:"Discipline";b:1;s:10:"Accounting";b:1;s:15:"Student_Billing";b:1;s:12:"Food_Service";b:1;s:9:"Resources";b:1;s:6:"Custom";b:1;}', NULL, NULL);
Expand Down

0 comments on commit 25b164e

Please sign in to comment.