Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Parker committed Jul 18, 2017
2 parents 0117bc0 + a0bcec7 commit 318b87f
Show file tree
Hide file tree
Showing 65 changed files with 3,045 additions and 4,668 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ location /sis {
## Resources.

* Take eduTrac SIS for a test drive by checking out the full featured [demo](http://demo.etsis.us/).
* Check out the [Youtube channel](https://www.youtube.com/channel/UC0Xg37nDDHh-_9bzCAUz6HQ/videos?view=0&sort=dd&shelf_id=0) for tips on using eduTrac SIS.
* [Online User's Manual](https://www.edutracsis.com/): everything you need to get eduTrac SIS installed and setup.
* Bug fixing: contribute by helping to squash [bugs](https://github.com/parkerj/eduTrac-SIS/issues)
* Handbook: majority of the classes, functions, methods and hooks are documented in the [developer's handbook](https://developer.edutracsis.com); contribute to it or use it to write plugins for the community.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.0
6.3.1
5 changes: 5 additions & 0 deletions app/dropins/system.dropin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
if (!Validate::table('php_encryption')->exists()) {
Node::dispense('php_encryption');
}

$email = Node::table('student_email');
if(!in_array('cc', $email->fields())) {
$email->addFields(['cc' => 'string', 'bcc' => 'string']);
}
} catch (NodeQException $e) {
Cascade::getLogger('error')->error(sprintf('NODEQSTATE[%s]: Unable to create Node: %s', $e->getCode(), $e->getMessage()));
} catch (Exception $e) {
Expand Down
3 changes: 2 additions & 1 deletion app/functions/core-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,8 @@ function get_screen($screen)
'TCRE' => 'crse/tcre',
'RLDE' => 'rlde',
'ACLV' => 'form/aclv',
'MRKT' => 'mrkt'
'MRKT' => 'mrkt',
'REST' => 'form/rest'
];
return $acronym[$screen];
}
Expand Down
25 changes: 17 additions & 8 deletions app/functions/course-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,24 @@ function etsis_prereq_rule($stuID, $crseID)
$rule = _escape($crse->rule);
if ($rule != null) {
$prrl = $app->db->query(
"SELECT v_sacp.stuID FROM v_sacp"
. " INNER JOIN stal ON v_sacp.stuID = stal.stuID AND v_sacp.prog = stal.acadProgCode"
. " INNER JOIN v_scrd ON v_sacp.stuID = v_scrd.stuID AND v_sacp.prog = v_scrd.prog"
. " WHERE v_sacp.stuID = ?"
. " AND $rule", [$stuID]
)
->findOne();
"SELECT v_sacp.stuID FROM v_sacp"
. " INNER JOIN stal ON v_sacp.stuID = stal.stuID AND v_sacp.prog = stal.acadProgCode"
. " WHERE $rule"
);

if (_h($prrl->stuID) <> $stuID) {
$q = $prrl->find(function ($data) {
$array = [];
foreach ($data as $d) {
$array[] = $d;
}
return $array;
});
$a = [];
foreach ($q as $row) {
$a[] = _escape($row['stuID']);
}

if (!in_array($stuID, $a)) {
return false;
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/functions/dependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ function remove_trailing_slash($string)
$app->asset->registerStyleCollection('elFinder', ['elfinder/css/elfinder.min.css', 'elfinder/css/theme.css']);
$app->asset->registerStyleCollection('jquery-ui', ['jquery-ui/jquery-ui.min.css']);
$app->asset->registerStyleCollection('bootstrap-datepicker', ['datepicker/bootstrap-datetimepicker.min.css']);
$app->asset->registerStyleCollection('selectize', ['querybuilder/selectize/css/selectize.default.css']);

$app->asset->registerScriptCollection('gridforms', ['admin/gridforms/gridforms.js']);
$app->asset->registerScriptCollection('select', ['admin/forms/elements/bootstrap-select/assets/lib/js/bootstrap-select.js', 'admin/forms/elements/bootstrap-select/assets/custom/js/bootstrap-select.init.js']);
Expand All @@ -673,10 +674,12 @@ function remove_trailing_slash($string)
$app->asset->registerScriptCollection('dashboard', ['admin/Highcharts/highcharts-conf.js']);
$app->asset->registerScriptCollection('opened', ['admin/Highcharts/campaign-opened.js']);
$app->asset->registerScriptCollection('clicked', ['admin/Highcharts/campaign-clicked.js']);
$app->asset->registerScriptCollection('attendance', ['admin/Highcharts/attendance.js']);
$app->asset->registerScriptCollection('bootstrap-datepicker', ['admin/datepicker/bootstrap-datetimepicker.min.js', 'admin/datepicker/custom.js']);
$app->asset->registerScriptCollection('jquery-ui', ['jquery-ui/jquery-ui.min.js']);
$app->asset->registerScriptCollection('momentjs', ['momentjs/moment.js']);
$app->asset->registerScriptCollection('elFinder', ['elfinder/js/elfinder.full.js', 'elfinder/js/tinymce.plugin.js']);
$app->asset->registerScriptCollection('checked', ['admin/forms/elements/fuelux-checkbox/fuelux-checkbox.js', 'admin/forms/elements/fuelux-radio/fuelux-radio.js']);

require( APP_PATH . 'functions' . DS . 'global-function.php' );
require( APP_PATH . 'functions' . DS . 'notify-function.php' );
Expand Down
17 changes: 12 additions & 5 deletions app/functions/nodeq-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,17 @@ function etsis_nodeq_student_email()
$from = get_person_by('email', _h($r->from));
$to = get_person_by('personID', _h($r->to));
$message = process_email_html(_escape($r->message), _h($r->subject));
$headers[] = sprintf("From: %s <auto-reply@%s>", _h(get_option('institution_name')), get_domain_name());
$headers[] = sprintf("Reply-to: %s", get_name(_h($from->personID)) . ' <' . _h($from->email) . '>');
$headers[] = sprintf("From: %s", _h($from->email) != '' ? _h($from->email) : 'no-reply@' . get_domain_name());
if (_h($r->cc) != '') {
$headers[] = sprintf("Cc: %s", _h($r->cc));
}
if (_h($r->bcc) != '') {
$headers[] = sprintf("Bcc: %s", _h($r->bcc));
}
$headers[] = sprintf("Reply-to: %s", _h($from->email));

try {
_etsis_email()->etsisMail(_h($to->email), _h($r->subject), $message, $headers, [_h($r->attachment)]);
_etsis_email()->etsisMail(_h($to->email), _h($r->subject), $message, $headers, _h($r->attachment) != '' ? [_h($r->attachment)] : []);
} catch (phpmailerException $e) {
Cascade::getLogger('system_email')->alert(sprintf('PHPMAILER[%s]: %s', $e->getCode(), $e->getMessage()));
} catch (Exception $e) {
Expand All @@ -474,8 +480,9 @@ function etsis_nodeq_student_email()
$upd->save();

if (++$i === $numItems) {
//Delete attachment from server.
unlink(_h($r->attachment));
if (file_exists(_h($r->attachment))) {
unlink(_h($r->attachment));
}
//If we reach the last item, send user a desktop notification.
etsis_push_notify('Student email.', 'Email sent.');
}
Expand Down
4 changes: 3 additions & 1 deletion app/functions/notify-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function etsis_desktop_notify($title, $message, $hide = 'true')
width: \"400px\",
type: \"notice\",
shadow: true,
auto_display: true,
hide: $hide,
delay: 200000,
desktop: {
Expand Down Expand Up @@ -110,7 +111,8 @@ function etsis_push_notify($title, $message)
$notification = (new Notification())
->setTitle($title)
->setBody($message)
->setIcon(BASE_PATH . 'static/assets/imgages/icon-success.png');
->setIcon(BASE_PATH . 'static/assets/images/icon-success.png')
->addOption('sound', $app->hook->apply_filter('desktop_push_notify_sound', 'Submarine'));

// Send it
return $app->hook->apply_filter('push_notify', $notifier->send($notification));
Expand Down
85 changes: 59 additions & 26 deletions app/functions/rules-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @since 6.3.0
*/
Node::dispense('rlde');

/**
* Creates alst node if it does not exist.
*
Expand Down Expand Up @@ -562,13 +562,24 @@ function etsis_alst_rule($stuID, $level)
$rlde = get_rule_by_code(_escape($alst->rule));
try {
$aclv = $app->db->query(
"SELECT v_scrd.stuID FROM $rlde->file"
. " WHERE v_scrd.stuID = ?"
. " AND v_scrd.acadLevel = ?"
. " AND $rlde->rule", [$stuID, _escape($alst->level)]
)
->findOne();
if (_escape($aclv->stuID) == $stuID) {
"SELECT v_scrd.stuID FROM $rlde->file"
. " WHERE v_scrd.acadLevel = ?"
. " AND $rlde->rule", [_escape($alst->level)]
);

$q = $aclv->find(function ($data) {
$array = [];
foreach ($data as $d) {
$array[] = $d;
}
return $array;
});
$a = [];
foreach ($q as $row) {
$a[] = _escape($row['stuID']);
}

if (in_array($stuID, $a)) {
return _escape($alst->value);
}
} catch (NotFoundException $e) {
Expand Down Expand Up @@ -612,14 +623,25 @@ function etsis_stld_rule($stuID, $creds, $level, $term)
$rlde = get_rule_by_code($stld->rule);
try {
$load = $app->db->query(
"SELECT sttr.stuID FROM $rlde->file"
. " INNER JOIN term ON sttr.termCode = term.termCode"
. " WHERE sttr.stuID = ?"
. " AND sttr.termCode = ?"
. " AND $rlde->rule", [$stuID, $term]
)
->findOne();
if (_escape($load->stuID) == $stuID) {
"SELECT sttr.stuID FROM $rlde->file"
. " INNER JOIN term ON sttr.termCode = term.termCode"
. " WHERE sttr.termCode = ?"
. " AND $rlde->rule", [$term]
);

$q = $load->find(function ($data) {
$array = [];
foreach ($data as $d) {
$array[] = $d;
}
return $array;
});
$a = [];
foreach ($q as $row) {
$a[] = _escape($row['stuID']);
}

if (in_array($stuID, $a)) {
return _escape($stld->value);
}
} catch (NotFoundException $e) {
Expand Down Expand Up @@ -658,16 +680,27 @@ function etsis_clvr_rule($stuID, $level)
$rlde = get_rule_by_code(_escape($clvr->rule));
try {
$clas = $app->db->query(
"SELECT v_scrd.stuID FROM $rlde->file"
. " INNER JOIN stal ON v_scrd.stuID = stal.stuID AND v_scrd.acadLevel = stal.acadLevelCode"
. " WHERE v_scrd.stuID = ?"
. " AND v_scrd.acadLevel = ?"
. " AND $rlde->rule"
. " AND (stal.endDate IS NULL"
. " OR stal.endDate <= '0000-00-00')", [$stuID, _escape($clvr->level)]
)
->findOne();
if (_escape($clas->stuID) == $stuID) {
"SELECT v_scrd.stuID FROM $rlde->file"
. " INNER JOIN stal ON v_scrd.stuID = stal.stuID AND v_scrd.acadLevel = stal.acadLevelCode"
. " WHERE v_scrd.acadLevel = ?"
. " AND $rlde->rule"
. " AND (stal.endDate IS NULL"
. " OR stal.endDate <= '0000-00-00')", [_escape($clvr->level)]
);

$q = $clas->find(function ($data) {
$array = [];
foreach ($data as $d) {
$array[] = $d;
}
return $array;
});
$a = [];
foreach ($q as $row) {
$a[] = _escape($row['stuID']);
}

if (in_array($stuID, $a)) {
return _escape($clvr->value);
}
} catch (NotFoundException $e) {
Expand Down
Loading

0 comments on commit 318b87f

Please sign in to comment.