Release 6.3.0: Core Functions

File Exists

etsis_file_exists($filename, $throw = true);

Checks if file exists, if not, throws exception if $throw is set to true (default).

Example

try {
    if(etsis_file_exists('/path/to/file/test.txt')) {
        include('/path/to/file/test.txt');
    }
} catch (app\src\Core\Exception\NotFoundException $e) {
    \Cascade\Cascade::getLogger('error')->error(sprintf('FILESTATE[%s]: File not found: %s', $e->getCode(), $e->getMessage()));
}

System Message Template

set_email_template($body);

Uses default template, but has a filter, so that you can set your own template.

Example

$app = \Liten\Liten::getInstance();

function set_my_message_template($body, $template)
{
    $template = _file_get_contents(APP_PATH . 'views/setting/tpl/my_email_alert.tpl');
    return str_replace('{content}', $body, $template);
}

$app->hook->{'add_filter'}('email_template', 'set_my_message_template', 2);

read more

Email Template in 6.3.0

This update summarizes the changes made based on issue #7. Default system messages have been enhanced to send out pretty emails instead of the straight text emails. The default email template is located at app/views/setting/tpl/email_alert.tpl. You can add your own template and override the default one with the following filter hook: email_template.

Updated Staff API 6.3.0

eduTrac SIS 6.3.0 will include an update to the staff api which will follow the same concept as get_person(), get_course_sec(), etc.

Examples

$staff = get_staff(2); echo "My name is: " . get_name($staff->staffID);

var_dump of $staff = get_staff(2); as an object

stdClass::__set_state(array(
'hireDate' => '2013-11-04',
'metaStartDate' => '2013-11-18',
'metaEndDate' => '0000-00-00',
'sMetaID' => '2',
'jobStatusCode' => 'FT',
'jobID' => '6',
'supervisorID' => '1',
'staffType' => 'FAC',
'approvedBy' => '1',
'LastLogin' => '2016-01-13 13:27:46',
'LastUpdate' => '2013-09-21 19:58:59',
'photo' => NULL,
'naeStatus' => 'A',
'approvedDate' => '2013-07-23 00:00:00',
'gender' => 'F',
'emergency_contact' => '',
'emergency_contact_phone' => '',
'ssn' => '205932934',
'dob' => '1981-07-05',
'veteran' => '1',
'ethnicity' => '',
'lname' => 'miller',
'mname' => '',
'email' => 'millerk@gmail.com',
'personType' => 'FAC',
'altID' => NULL,
'uname' => 'millerk',
'prefix' => 'Ms',
'fname' => 'Romaria',
'ID' => '1',
'staffID' => '2',
'staffStatus' => 'A',
'staffAddDate' => '2013-08-13',
'addressID' => '3',
'personID' => '2',
'address1' => '',
'address2' => '',
'city' => 'Elloree',
'state' => 'SC',
'zip' => '',
'country' => 'US',
'addressType' => 'P',
'startDate' => '2013-08-01',
'endDate' => '0000-00-00',
'addressStatus' => 'C',
'phone1' => '',
'phone2' => '',
'ext1' => '',
'ext2' => '',
'phoneType1' => '',
'phoneType2' => '',
'email1' => 'millerk@gmail.com',
'email2' => '',
'addDate' => '2013-08-03',
'addedBy' => '1',
'metaAddDate' => '2014-02-11',
))

read more

Dev: Release 6.2.12 Postponed

Hopefully you’ve been following the development of release 6.2.12. Due to the fact that the office will be closed for two weeks starting next Monday as well as other reasons, it would not be wise to do a release today if support would be limited. So the new date for the 6.2.12 release is Tuesday, December 6th.

Below is what’s currently being worked on now for the upcoming release.

  • #8: Better integration throughout the system to generate better logs. In some instances, the administrator will receive an email on critical issues.
  • #9: Fixes a bug where using a deprecated mysql_* function was a mistake. Should have been using PDO.
  • #10: Makes it easier for faculty, staff and students to contact the system administrator if they need their password reset.
  • #11: Enhanced security for logged in cookies.
  • #12: Three tables merged into one. This was long overdue.
  • #13: New Academic Level screen.
  • #6: Create business policies with business rules.

Before next Monday, you will have a chance to download and play with the development version of 6.2.12. This is only to be used for testing, so that you can use Github to post any issues, bugs or enhancements. Once it is available for download, an announcement will be posted to this site.

read more

System Snapshot Report

To help troubleshoot issues and see more clearly where those issues might generating from, release 6.2.11 will have a new screen called the System Snapshot Report. This report will give you some information on your etSIS install, PHP configuration and more. Below is a screenshot example of the System Snapshot Report.

System Snapshot Report

If anything shows in red, that is a warning that a particular setting is wrong and/or there are permission issues.

Preparing for Release 6.2.11

In order to make sure you are ready for release 6.2.11 when it comes out, there are two files you need to edit. You can edit them now, and it will not brick your install.

First file that must be edited is the config.php file. Make sure not to overwrite your database login credentials. If you do, make sure to add them back. Your config file muse look exactly like the one below because the database details are stationed where they need to be. After the Initial Installation Info, your config.php file should now look similar to this:

/**
 * If set to PROD, errors will be generated in the logs
 * directory (app/tmp/logs/*.txt). If set to DEV, then
 * errors will be displayed on the screen. For security
 * reasons, when made live to the world, this should be
 * set to PROD.
 */
defined('APP_ENV') or define('APP_ENV', 'PROD');

/**
 * Application path.
 */
defined('APP_PATH') or define('APP_PATH', BASE_PATH . 'app' . DS);

/**
 * Dropins Path.
 */
defined('ETSIS_DROPIN_DIR') or define('ETSIS_DROPIN_DIR', APP_PATH . 'dropins' . DS);

/**
 * Plugins path.
 */
defined('ETSIS_PLUGIN_DIR') or define('ETSIS_PLUGIN_DIR', APP_PATH . 'plugins' . DS);

/**
 * Old Dropins path for backwards compatibility.
 */
defined('DROPINS_DIR') or define('DROPINS_DIR', ETSIS_DROPIN_DIR);

/**
 * Old Plugins path for backwards compatibility.
 */
defined('PLUGINS_DIR') or define('PLUGINS_DIR', ETSIS_PLUGIN_DIR);

/**
 * Cache path.
 */
defined('CACHE_PATH') or define('CACHE_PATH', APP_PATH . 'tmp' . DS . 'cache' . DS);

/**
 * Image path for .pdf's.
 */
defined('K_PATH_IMAGES') or define('K_PATH_IMAGES', BASE_PATH . 'static' . DS . 'images' . DS);

/**
 * Set for low ram cache.
 */
defined('ETSIS_FILE_CACHE_LOW_RAM') or define('ETSIS_FILE_CACHE_LOW_RAM', '');

/**
 * Instantiate a Liten application
 *
 * You can update
 */
$subdomain = '';
$domain_parts = explode('.', $_SERVER['SERVER_NAME']);
if (count($domain_parts) == 3) {
    $subdomain = $domain_parts[0];
} else {
    $subdomain = 'www';
}
$app = new \Liten\Liten(
    [
    'cookies.lifetime' => '86400',
    'cookies.savepath' => ini_get('session.save_path') . DS . $subdomain . DS,
    'file.savepath' => ini_get('session.save_path') . DS . $subdomain . DS . 'files' . DS
    ]
);

/**
 * Database details
 */
defined('DB_HOST') or define('DB_HOST', '');
defined('DB_NAME') or define('DB_NAME', '');
defined('DB_USER') or define('DB_USER', '');
defined('DB_PASS') or define('DB_PASS', '');

/**
 * NodeQ noSQL details.
 */
defined('NODEQ_PATH') or define('NODEQ_PATH', $app->config('cookies.savepath') . 'nodes' . DS);
defined('ETSIS_NODEQ_PATH') or define('ETSIS_NODEQ_PATH', NODEQ_PATH . 'etsis' . DS);

/**
 * Do not edit anything from this point on.
 */

$app->inst->singleton('db', function () {
    $pdo = new \PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS, [\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"]);
    $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
    $pdo->query('SET CHARACTER SET utf8');
    return new \Liten\Orm($pdo);
});

/**
 * Require a functions file
 *
 * A functions file may include any dependency injections
 * or preliminary functions for your application.
 */
require( APP_PATH . 'functions.php' );
require( APP_PATH . 'functions' . DS . 'dependency.php' );
require( APP_PATH . 'functions' . DS . 'hook-function.php' );
require( APP_PATH . 'application.php' );

/**
 * Include the routers needed
 *
 * Lazy load the routers. A router is loaded
 * only when it is needed.
 */
include(APP_PATH . 'routers.php');

/**
 * Initialize benchmark.
 */
benchmark_init();

/**
 * Set the timezone for the application.
 */
date_default_timezone_set((get_option('system_timezone') !== NULL) ? get_option('system_timezone') : 'America/New_York');

/**
 * Autoload Dropins
 *
 * Dropins can be plugins and / or routers that
 * should be autoloaded. This is useful when you want to
 * add your own customized screens without needing to touch
 * the core.
 */
$dropins = glob(APP_PATH . 'dropins' . DS . '*.php');
if (is_array($dropins)) {
 foreach ($dropins as $dropin) {
 if (file_exists($dropin))
 include($dropin);
 }
}

/**
 * Run the Liten application
 *
 * This method should be called last. This executes the Liten application
 * and returns the HTTP response to the HTTP client.
 */
$app->run();

read more

Dev: Release 6.2.11

The development for release 6.2.11 is underway. If this site and Trac is not on your radar. It is time to put it at the top of the list. Especially if you are actively using eduTrac SIS (etSIS). It’s open source and any changes made affects you. Some changes are needed and beyond control and others can be negotiated. Therefore, your opinions matter. Below is what’s currently being worked on now for the upcoming release.

#61: Desktop notifications is a cool new feature and is needed now that some processes will be pushed to a queue. #62: The new logger API will tremendously help developers with troubleshooting. #63: NodeQ will help with background processes. #64

read more

Cast Your Vote: New Form Design

Even though the Degree Audit plugin is still top priority, there are some small changes that are being considered and will implemented here and there. One such change under consideration at the moment is the look and functionality of the form screens. This includes all screens where information is inputed onto a form.

Below are screenshots of the NAE (Name and Address) screen. The first screenshot is how it looks now (non-grid), and the second screenshot is how it will look after (grid) the change is implemented. The grid form will function just as same as the non-grid form but will only look differently. Therefore, cast your vote.

read more