mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Compare commits
426 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82c2652148 | |||
| a128d57c60 | |||
| 29c91a1cda | |||
| a0b368683e | |||
| 932f5efb5c | |||
| 5d668791f9 | |||
| 9c801d2723 | |||
| dce81d614e | |||
| f325daab43 | |||
| 326b53544a | |||
| 1a3d651759 | |||
| 995b3ecb18 | |||
| 5226da2652 | |||
| 15049640c6 | |||
| 0d5a7aee35 | |||
| cfa71c852c | |||
| 9527fd006f | |||
| cff3cab075 | |||
| 55e47d8b62 | |||
| f72da812d7 | |||
| 17adaf79b0 | |||
| 84b1f1c81a | |||
| b827d8cbea | |||
| 4787159071 | |||
| 71e8742cc8 | |||
| 813cca99e2 | |||
| de1ae7e46c | |||
| 9c1d58c447 | |||
| e67e7309cb | |||
| 6e1c602658 | |||
| d8ab7036a6 | |||
| 4899c62863 | |||
| 81f279964c | |||
| 9830025853 | |||
| 18d760886a | |||
| 265244c5af | |||
| 4ceaffa617 | |||
| 08fffa5009 | |||
| d06efc15a6 | |||
| 58c3fba33a | |||
| bf6d0aca38 | |||
| c411b826d9 | |||
| 90a518a70d | |||
| 7bbada7e63 | |||
| 012e7b9691 | |||
| fd39312de6 | |||
| 01a020d196 | |||
| 90ada0aaf8 | |||
| dee4af2fb8 | |||
| 88dee31289 | |||
| 4d85d42a79 | |||
| accccbd362 | |||
| de81a5abbd | |||
| 0fdf943085 | |||
| feb14a9f39 | |||
| ab5e656069 | |||
| 8d3a9d86f3 | |||
| 3f5c6c4ee5 | |||
| 97023c547c | |||
| 947cc3beff | |||
| 151e9d2ca3 | |||
| 381db6a93f | |||
| 7f97a58baa | |||
| 8ef07fd9b2 | |||
| 569c8c929e | |||
| ba76ced168 | |||
| 0347ad9b10 | |||
| 990bffeb2c | |||
| 78a66bfc74 | |||
| 9c349d9f1b | |||
| 51b5cb8620 | |||
| 366aca2b1c | |||
| de5b701532 | |||
| b17c6e29e5 | |||
| fd0eed8558 | |||
| e6269b121b | |||
| 5441024c75 | |||
| f46ff9c97a | |||
| 0cfcb58a58 | |||
| 92fb2f40cd | |||
| 858ab16bc7 | |||
| b2e148d330 | |||
| 463c6bd97a | |||
| 2fdd136aa9 | |||
| 6643fae82c | |||
| 94854592fb | |||
| b60e0b712f | |||
| 2b3842df29 | |||
| e019faabe4 | |||
| 3293a75a79 | |||
| c8df6633af | |||
| c136a0afdb | |||
| 7eda91d0a2 | |||
| 50070bd2ad | |||
| a9e235678c | |||
| 0401821422 | |||
| c8fb2080da | |||
| 73dc39b9d8 | |||
| 194d141539 | |||
| 04584fdec9 | |||
| f0b1c14ea4 | |||
| 3fb20cf61e | |||
| f15e89c451 | |||
| f52c9ed3c2 | |||
| c1b40608c1 | |||
| 2ca9f29c0d | |||
| 9c40452562 | |||
| 6d05df876b | |||
| b8e973c313 | |||
| 514205c171 | |||
| 19ebe3cfa8 | |||
| 103b93a2b8 | |||
| 9070a81f25 | |||
| 08ebcf591a | |||
| 00446cdb33 | |||
| 48ee451a38 | |||
| 090345d6c0 | |||
| db53de363c | |||
| 603abd5458 | |||
| cb9eaa7694 | |||
| 7c17ac4ea7 | |||
| ad19e0ed75 | |||
| 46f7fc2883 | |||
| 77361fc5f1 | |||
| ac4b815596 | |||
| 579eda8680 | |||
| 911035d5ad | |||
| 41eaee41af | |||
| d24bc36bf7 | |||
| 6215786565 | |||
| 7d1267732f | |||
| d1ac2e0424 | |||
| 381fa2ed7e | |||
| d1a8ec7490 | |||
| a2f65373cd | |||
| 33eb1cb6af | |||
| 37cbe5e8f7 | |||
| 37ec8d84e5 | |||
| 817d2842cc | |||
| 9d43279089 | |||
| 60a651c220 | |||
| 462e77d27d | |||
| 920fcc0e42 | |||
| 9f8d9f1df6 | |||
| 7cd4eaf5a2 | |||
| 5e1ed8fa14 | |||
| 3c99d627e1 | |||
| fec45f7b75 | |||
| 7ef7b86d30 | |||
| 82b9f595c3 | |||
| d84f53e5c3 | |||
| 763b0bb756 | |||
| ac370197e1 | |||
| ab95544f9f | |||
| 6e6406fb2b | |||
| 00fb8366b3 | |||
| 8e72b83448 | |||
| 98ec75dc94 | |||
| 9601ac5116 | |||
| d70c0dcae3 | |||
| 8bbbd8cb8d | |||
| 048c164394 | |||
| 6c918be121 | |||
| 2c743cb37b | |||
| 471242cb97 | |||
| 7df9576481 | |||
| ddfb3cdb4e | |||
| 119a521913 | |||
| b69e79685d | |||
| 7558614145 | |||
| f0b36610b7 | |||
| f72afe473c | |||
| f766f36095 | |||
| 74fb245757 | |||
| 4e3e425491 | |||
| 29809b6bf1 | |||
| 83b38b999d | |||
| 8df802b74a | |||
| a9d065044d | |||
| 50bf478f0b | |||
| 317a1f87fa | |||
| ebb3a6de1f | |||
| 4dd983c105 | |||
| 35b23bcba4 | |||
| 71c953bac7 | |||
| ffec6a5422 | |||
| a8f6ca1670 | |||
| 651a4a97e7 | |||
| 50b19161b9 | |||
| 5d847ccd38 | |||
| c47d2c93fe | |||
| 1c0b21cb74 | |||
| 15b2c469e2 | |||
| 771395cbbf | |||
| f0fd071e31 | |||
| 989a7b8720 | |||
| 556e58e78e | |||
| f7bd49b408 | |||
| c9aba38803 | |||
| 4518eab1a8 | |||
| 9192befce1 | |||
| 572e53f554 | |||
| b3ce06cb90 | |||
| 73dd6e6dc1 | |||
| 5e9b5b2ce5 | |||
| bf8aa6c4ac | |||
| 50ab6ae5e9 | |||
| 7a1f36cb5e | |||
| 53dc6b3c63 | |||
| 1609543a31 | |||
| aadd6b0d92 | |||
| 0bd7d6f7c6 | |||
| 336f32bee0 | |||
| c96baac859 | |||
| 235f15e9f7 | |||
| 4480b6ce57 | |||
| 23b228c085 | |||
| 4f71a274e2 | |||
| 458117fced | |||
| 382da823e4 | |||
| bfb24320d7 | |||
| 2504c91cd9 | |||
| c7c0bbfb49 | |||
| 492562efdf | |||
| 65c6466465 | |||
| 30fbeda1ba | |||
| 08a58b919a | |||
| ba5fb29d13 | |||
| aead693675 | |||
| f2f960fd43 | |||
| fb5656833a | |||
| b067c97beb | |||
| 18cdbb8f6d | |||
| 7d3a12fd1c | |||
| 36b4964d53 | |||
| 11a208de55 | |||
| 2f5e9d80da | |||
| ae42051f15 | |||
| 32493c1b9d | |||
| 03d6955ec4 | |||
| 21d3d40171 | |||
| 8fe346f6be | |||
| fb70ba3da5 | |||
| 5f8a530857 | |||
| d82426cd91 | |||
| b293673ee9 | |||
| edd310351b | |||
| c31ab4874d | |||
| 2a060ace25 | |||
| 5670f931ef | |||
| b28e780aa6 | |||
| aee25c5252 | |||
| ae26c4d1ee | |||
| f8d3337481 | |||
| 5b46722913 | |||
| 9d3d84e7ea | |||
| ae4bf1feb1 | |||
| b4d86744f2 | |||
| 889f8370e1 | |||
| 0d605158a5 | |||
| eee43fe921 | |||
| 7c02f21582 | |||
| 23ec0d6344 | |||
| 1241a05ed3 | |||
| 9bae6bb0a4 | |||
| 2c475f8bde | |||
| cb5c11a6ab | |||
| e4590909e2 | |||
| f9e33a1779 | |||
| c1df686edc | |||
| 921b1d337d | |||
| bf216e6505 | |||
| 225b3b7c6e | |||
| edb69498e5 | |||
| 5d1e99a222 | |||
| 0643b99e86 | |||
| 85338b8477 | |||
| de667990a3 | |||
| 3570b2c04d | |||
| aa217a42d4 | |||
| a27ad33e0e | |||
| 4d44bbb79c | |||
| 07a1d7ecb2 | |||
| 926180f5da | |||
| 40d8edebef | |||
| d5eff7d615 | |||
| 450b0b6433 | |||
| 0d03689f57 | |||
| 7252bc1e6f | |||
| f91d3ad75f | |||
| 02481a4119 | |||
| 604592cdd1 | |||
| 2056150917 | |||
| bcaff5b276 | |||
| 625b3c74c4 | |||
| 1f7fd6989e | |||
| 10ce6128de | |||
| 259f9d29d5 | |||
| b53f3a1170 | |||
| b8d1c61b83 | |||
| 619924eff8 | |||
| 477a7dd588 | |||
| 6bdbe91dd9 | |||
| 8670ab18f8 | |||
| cc33502ab3 | |||
| 537ce0940c | |||
| 824a148b92 | |||
| ed9f6e0c9b | |||
| a2bacae6d7 | |||
| 92762c5dc2 | |||
| 2ff067193d | |||
| 1d408b9d65 | |||
| 60d675f22b | |||
| 2125fdc219 | |||
| 1d5d5e4a84 | |||
| a1622d8b74 | |||
| 82d7891f3c | |||
| 282b46d54e | |||
| 238810b5a8 | |||
| b0ffbea9a5 | |||
| 5af4f7a405 | |||
| 3138ac3e25 | |||
| 582cb20b72 | |||
| c9eb60aade | |||
| a0e2d7e37d | |||
| 075e8ede0a | |||
| 7b95ca4b92 | |||
| a3c9d75617 | |||
| 7dd48b2350 | |||
| 492014db3a | |||
| dd38765237 | |||
| 5ea46ece47 | |||
| 2e00f30e71 | |||
| 73c516cbed | |||
| 08b1047b09 | |||
| 1103bb7aa1 | |||
| d95cbb39e3 | |||
| d7fb91371e | |||
| f85dd2fd2e | |||
| c6aa3c7d9b | |||
| fabdb70d72 | |||
| e39bb1ea8a | |||
| 7499a7f90a | |||
| 6d81e36e68 | |||
| b912ca9a06 | |||
| 1ee0e8eeb9 | |||
| 53a3417c8e | |||
| d81b205c05 | |||
| 6b4b3bad6a | |||
| 267f5b2972 | |||
| de07d1f340 | |||
| e433affcc3 | |||
| 4dab69cb15 | |||
| 8b8515ee03 | |||
| 137af3ef71 | |||
| ae70dbcb64 | |||
| f7e057d7db | |||
| c400641754 | |||
| 6ce7068ead | |||
| 790f2bb130 | |||
| 3f07aa172c | |||
| 76db7bd53a | |||
| a780338367 | |||
| 946ccc33d5 | |||
| eb2b738133 | |||
| abcb575ef0 | |||
| 8c8623ce4f | |||
| 17322283f5 | |||
| 5896a75a44 | |||
| 26eb77f030 | |||
| b53add9e67 | |||
| 198c6baf3d | |||
| cfe7c6b9a4 | |||
| aac21c9fda | |||
| 9d6d759fd0 | |||
| 8ab83a0baa | |||
| 4e201f1002 | |||
| 2f1d5f157f | |||
| 647b2a9f45 | |||
| 39520d32fd | |||
| f5df010884 | |||
| f7c394547e | |||
| 19273003ee | |||
| 6c618c9a20 | |||
| 74b0fc5662 | |||
| fe6a6c5da3 | |||
| ce9aa4c388 | |||
| 2927682dae | |||
| 60b3be3d64 | |||
| 5c94e33f24 | |||
| 2e4085c8de | |||
| 35426251cb | |||
| cf7ad022a7 | |||
| 60cbb8bd8c | |||
| 32daed2ad2 | |||
| f85225cc4e | |||
| 091307680b | |||
| 796c09999f | |||
| ad30cc862e | |||
| 797cabccb9 | |||
| bcaa560a46 | |||
| 2a298dc6d1 | |||
| 47f7c03075 | |||
| 147ab92bae | |||
| 24b78454d3 | |||
| 9e48ba09d8 | |||
| c87aee0ddf | |||
| 618a62425b | |||
| f3fe3aa099 | |||
| 29002124cc | |||
| 061780a0d2 | |||
| a603081544 | |||
| 1871dcc332 | |||
| 3d0bdcf95a | |||
| 704b32c76c | |||
| 58d252b5b7 | |||
| d7e4d7ebde | |||
| b6cc084799 | |||
| 9bf20dd7a4 | |||
| d3c30af9f7 | |||
| 6d1c926ec0 | |||
| e50cc27a89 | |||
| db49f2b1e7 | |||
| 6f14b5cec5 | |||
| 2fb4be0e55 | |||
| ab59c265d4 |
@@ -24,6 +24,7 @@ application/logs/
|
||||
application/models/extensions/
|
||||
application/views/extensions/
|
||||
application/widgets/extensions/
|
||||
application/components/extensions/
|
||||
|
||||
public/extensions/
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
$filterCmptArray = array(
|
||||
'app' => 'core',
|
||||
'datasetName' => 'logs',
|
||||
//'filterKurzbz' => 'jobs48hours', // REMOVE ME
|
||||
'query' => '
|
||||
SELECT wsl.webservicelog_id AS "LogId",
|
||||
wsl.request_id AS "RequestId",
|
||||
wsl.execute_time AS "ExecutionTime",
|
||||
wsl.execute_user AS "ExecutedBy",
|
||||
wsl.beschreibung AS "Description",
|
||||
wsl.request_data AS "Data",
|
||||
wsl.webservicetyp_kurzbz AS "WebserviceType"
|
||||
FROM system.tbl_webservicelog wsl
|
||||
ORDER BY wsl.execute_time DESC
|
||||
',
|
||||
'requiredPermissions' => 'admin'
|
||||
);
|
||||
|
||||
@@ -10,26 +10,26 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
| Used to indicate the conditions under which the script is exit()ing.
|
||||
|
|
||||
*/
|
||||
define('EXIT_SUCCESS', 0); // no errors
|
||||
define('EXIT_ERROR', 1); // generic error
|
||||
define('EXIT_MODEL', 2); // model error
|
||||
define('EXIT_CONFIG', 3); // configuration error
|
||||
define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
define('EXIT_UNKNOWN_METHOD', 6); // unknown class method
|
||||
define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
define('EXIT_DATABASE', 8); // database error
|
||||
define('EXIT_VALIDATION_UDF', 10); // UDF validation has been failed
|
||||
define('EXIT_SUCCESS', 0); // no errors
|
||||
define('EXIT_ERROR', 1); // generic error
|
||||
define('EXIT_MODEL', 2); // model error
|
||||
define('EXIT_CONFIG', 3); // configuration error
|
||||
define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
define('EXIT_UNKNOWN_METHOD', 6); // unknown class method
|
||||
define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
define('EXIT_DATABASE', 8); // database error
|
||||
define('EXIT_VALIDATION_UDF', 10); // UDF validation has been failed
|
||||
define('EXIT_VALIDATION_UDF_MIN_VALUE', 11); // UDF validation has been failed -> MIN VALUE
|
||||
define('EXIT_VALIDATION_UDF_MAX_VALUE', 12); // UDF validation has been failed -> MAX VALUE
|
||||
define('EXIT_VALIDATION_UDF_MIN_LENGTH', 13); // UDF validation has been failed -> MIN LENGTH
|
||||
define('EXIT_VALIDATION_UDF_MAX_LENGTH', 14); // UDF validation has been failed -> MAX LENGTH
|
||||
define('EXIT_VALIDATION_UDF_REGEX', 15); // UDF validation has been failed -> REGEX
|
||||
define('EXIT_VALIDATION_UDF_REGEX', 15); // UDF validation has been failed -> REGEX
|
||||
define('EXIT_VALIDATION_UDF_REQUIRED', 16); // UDF validation has been failed -> REQUIRED
|
||||
define('EXIT_VALIDATION_UDF_NOT_VALID_VAL', 17); // UDF validation has been failed -> Not valid value, object or array
|
||||
|
||||
define('EXIT_AUTO_MIN', 1000); // lowest automatically-assigned error code
|
||||
define('EXIT_AUTO_MAX', 2000); // highest automatically-assigned error code
|
||||
define('EXIT_AUTO_MIN', 1000); // lowest automatically-assigned error code
|
||||
define('EXIT_AUTO_MAX', 2000); // highest automatically-assigned error code
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -45,7 +45,7 @@ define('BEGINNING_OF_TIME', '1970-01-01');
|
||||
*/
|
||||
// Foreign authentication methods
|
||||
define('AUTH_HBALDAP', 'httpBasicAuthLDAP');
|
||||
define('AUTH_BT', 'bewerbung');
|
||||
define('AUTH_BT', 'bewerbung');
|
||||
|
||||
// Login methods
|
||||
define('AUTH_LDAP', 'ldap');
|
||||
@@ -53,7 +53,7 @@ define('AUTH_DB', 'database');
|
||||
define('AUTH_SSO', 'sso');
|
||||
|
||||
// Authentication return codes
|
||||
define('AUTH_SUCCESS', 0);
|
||||
define('AUTH_SUCCESS', 0);
|
||||
define('AUTH_NOT_AUTHENTICATED', 1);
|
||||
define('AUTH_INVALID_CREDENTIALS', 2);
|
||||
|
||||
@@ -112,7 +112,7 @@ define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
|
||||
| of this setting
|
||||
|
|
||||
*/
|
||||
define('SHOW_DEBUG_BACKTRACE', TRUE);
|
||||
define('SHOW_DEBUG_BACKTRACE', true);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -127,24 +127,25 @@ define('EMAIL_CONFIG_INDEX', 'mail');
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
// Message statuses
|
||||
define('MSG_STATUS_UNREAD', 0);
|
||||
define('MSG_STATUS_READ', 1);
|
||||
define('MSG_STATUS_UNREAD', 0);
|
||||
define('MSG_STATUS_READ', 1);
|
||||
define('MSG_STATUS_ARCHIVED', 2);
|
||||
define('MSG_STATUS_DELETED', 3);
|
||||
|
||||
// Message priorities
|
||||
define('MSG_PRIORITY_LOW', 1);
|
||||
define('MSG_PRIORITY_LOW', 1);
|
||||
define('MSG_PRIORITY_NORMAL', 2);
|
||||
define('MSG_PRIORITY_HIGH', 3);
|
||||
define('MSG_PRIORITY_HIGH', 3);
|
||||
define('MSG_PRIORITY_URGENT', 4);
|
||||
|
||||
// Message error status
|
||||
define('MSG_ERR_INVALID_SUBJECT', 40);
|
||||
define('MSG_ERR_INVALID_BODY', 41);
|
||||
define('MSG_ERR_INVALID_TEMPLATE', 42);
|
||||
define('MSG_ERR_INVALID_MSG_ID', 43);
|
||||
define('MSG_ERR_INVALID_STATUS_ID', 44);
|
||||
define('MSG_ERR_INVALID_SENDER', 45);
|
||||
define('MSG_ERR_INVALID_SUBJECT', 40);
|
||||
define('MSG_ERR_INVALID_BODY', 41);
|
||||
define('MSG_ERR_INVALID_TEMPLATE', 42);
|
||||
define('MSG_ERR_INVALID_MSG_ID', 43);
|
||||
define('MSG_ERR_INVALID_STATUS_ID', 44);
|
||||
define('MSG_ERR_INVALID_SENDER', 45);
|
||||
define('MSG_ERR_INVALID_RECIPIENTS', 46);
|
||||
define('MSG_ERR_INVALID_OU', 47);
|
||||
define('MSG_ERR_INVALID_TOKEN', 48);
|
||||
define('MSG_ERR_INVALID_OU', 47);
|
||||
define('MSG_ERR_INVALID_TOKEN', 48);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ $config['navigation_header'] = array(
|
||||
'description' => 'Organisation',
|
||||
'sort' => 20,
|
||||
'requiredPermissions' => 'basis/vilesci:r',
|
||||
'children'=> array(
|
||||
'children' => array(
|
||||
'vilesci' => array(
|
||||
'link' => base_url('vilesci'),
|
||||
'icon' => '',
|
||||
@@ -40,7 +40,7 @@ $config['navigation_header'] = array(
|
||||
'description' => 'Lehre',
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'basis/vilesci:r',
|
||||
'children'=> array(
|
||||
'children' => array(
|
||||
'cis' => array(
|
||||
'link' => CIS_ROOT,
|
||||
'icon' => '',
|
||||
@@ -71,16 +71,16 @@ $config['navigation_header'] = array(
|
||||
'lehre/lehrauftrag_erteilen:r'
|
||||
)
|
||||
),
|
||||
'zverfueg' => array(
|
||||
'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'),
|
||||
'description' => 'Zeitverfügbarkeit',
|
||||
'expand' => true,
|
||||
'sort' => 45,
|
||||
'requiredPermissions' => array(
|
||||
'lehre/zeitverfuegbarkeit:rw',
|
||||
'lehre/zeitverfuegbarkeit:rw'
|
||||
)
|
||||
),
|
||||
'zverfueg' => array(
|
||||
'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'),
|
||||
'description' => 'Zeitverfügbarkeit',
|
||||
'expand' => true,
|
||||
'sort' => 45,
|
||||
'requiredPermissions' => array(
|
||||
'lehre/zeitverfuegbarkeit:rw',
|
||||
'lehre/zeitverfuegbarkeit:rw'
|
||||
)
|
||||
),
|
||||
'zgvueberpruefung' => array(
|
||||
'link' => site_url('system/infocenter/ZGVUeberpruefung'),
|
||||
'description' => 'ZGV Überprüfung',
|
||||
@@ -98,7 +98,7 @@ $config['navigation_header'] = array(
|
||||
'description' => 'Personen',
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'basis/vilesci:r',
|
||||
'children'=> array(
|
||||
'children' => array(
|
||||
'messages' => array(
|
||||
'link' => site_url('system/messages/MessageClient/read'),
|
||||
'icon' => '',
|
||||
@@ -120,11 +120,18 @@ $config['navigation_header'] = array(
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'system/issues_verwalten:r'
|
||||
),
|
||||
'plausichecks' => array(
|
||||
'link' => site_url('system/issues/Plausichecks'),
|
||||
'description' => 'Plausichecks',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'system/issues_verwalten:r'
|
||||
),
|
||||
'gruppenmanagement' => array(
|
||||
'link' => site_url('person/Gruppenmanagement'),
|
||||
'description' => 'Gruppenmanagement',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'sort' => 50,
|
||||
'requiredPermissions' => 'lehre/gruppenmanager:r'
|
||||
)
|
||||
)
|
||||
@@ -136,7 +143,7 @@ $config['navigation_header'] = array(
|
||||
'expand' => false,
|
||||
'sort' => 50,
|
||||
'requiredPermissions' => 'admin:r',
|
||||
'children'=> array(
|
||||
'children' => array(
|
||||
'extensions' => array(
|
||||
'link' => site_url('system/extensions/Manager'),
|
||||
'description' => 'Extensions Manager',
|
||||
@@ -201,7 +208,8 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array(
|
||||
'icon' => 'dashboard',
|
||||
'sort' => 1,
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r')
|
||||
),'lehrauftragBestellen' => array(
|
||||
),
|
||||
'lehrauftragBestellen' => array(
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag'),
|
||||
'description' => 'Lehrauftrag bestellen',
|
||||
'icon' => '',
|
||||
@@ -223,6 +231,7 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array(
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r')
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array(
|
||||
'lehrauftragDashboard' => array(
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
@@ -230,7 +239,8 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array(
|
||||
'icon' => 'dashboard',
|
||||
'sort' => 1,
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r')
|
||||
),'lehrauftragBestellen' => array(
|
||||
),
|
||||
'lehrauftragBestellen' => array(
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag'),
|
||||
'description' => 'Lehrauftrag bestellen',
|
||||
'icon' => '',
|
||||
@@ -263,3 +273,4 @@ $config['navigation_menu']['system/issues/Issues/*'] = array(
|
||||
'requiredPermissions' => array('admin:rw')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -60,3 +60,26 @@ $route['api/v1/organisation/[G|g]eschaeftsjahr/(:any)'] = 'api/v1/organisation/g
|
||||
$route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1';
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
$dirlist = scandir($subdir);
|
||||
|
||||
if ($dirlist)
|
||||
{
|
||||
$files = array_diff($dirlist, array('.','..'));
|
||||
|
||||
foreach ($files as &$item)
|
||||
{
|
||||
if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
|
||||
{
|
||||
$routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
|
||||
|
||||
if (file_exists($routes_file))
|
||||
{
|
||||
require($routes_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the FilterCmptLib (back-end)
|
||||
* Provides data to the ajax get calls about the filter component
|
||||
* Listens to ajax post calls to change the filter data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterCmpt has its
|
||||
* own permissions check
|
||||
*/
|
||||
class Filter extends FHC_Controller
|
||||
{
|
||||
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter cmpt unique id (mandatory)
|
||||
const FILTER_TYPE = 'filterType'; // The filter type (PHP filter definition) used (mandatory)
|
||||
const FILTER_ID = 'filterId'; // The id of the used filter (optional)
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FilterCmptLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads authentication library and starts authentication
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Loads the FilterCmptLib with HTTP GET/POST parameters
|
||||
$this->_startFilterCmptLib();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Retrieves data about the current filter from the session and will be written on the output in JSON format
|
||||
*/
|
||||
public function getFilter()
|
||||
{
|
||||
$this->outputJsonSuccess($this->filtercmptlib->getSession());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an applied filter (SQL where condition) from the current filter
|
||||
*/
|
||||
public function removeFilterField()
|
||||
{
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
if (property_exists($request, 'filterField')
|
||||
&& $this->filtercmptlib->removeFilterField($request->filterField) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Field removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Error occurred');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a filter (SQL where clause) to be applied to the current filter
|
||||
*/
|
||||
public function addFilterField()
|
||||
{
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
if (property_exists($request, 'filterField')
|
||||
&& $this->filtercmptlib->addFilterField($request->filterField) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Field added');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Error occurred');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the filter changes
|
||||
*/
|
||||
public function applyFilterFields()
|
||||
{
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
if (property_exists($request, 'filterFields')
|
||||
&& $this->filtercmptlib->applyFilterFields($request->filterFields) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Applied');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Error occurred');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the current filter as a custom filter for this user with the given description
|
||||
*/
|
||||
public function saveCustomFilter()
|
||||
{
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
if (property_exists($request, 'customFilterName')
|
||||
&& $this->filtercmptlib->saveCustomFilter($request->customFilterName) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Saved');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('An error occurred while saving a custom filter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a custom filter by its filterId
|
||||
*/
|
||||
public function removeCustomFilter()
|
||||
{
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
if (property_exists($request, 'filterId')
|
||||
&& $this->filtercmptlib->removeCustomFilter($request->filterId) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the dataset
|
||||
*/
|
||||
public function reloadDataset()
|
||||
{
|
||||
$this->filtercmptlib->reloadDataset();
|
||||
|
||||
$this->outputJsonSuccess('Success');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter
|
||||
* If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and
|
||||
* an error message is printed
|
||||
*/
|
||||
private function _startFilterCmptLib()
|
||||
{
|
||||
$filterUniqueId = null;
|
||||
$filterType = null;
|
||||
$filterId = null;
|
||||
|
||||
// Try to get the POSTed JSON
|
||||
$postJSON = $this->getPostJSON();
|
||||
|
||||
// POSTed JSON
|
||||
if ($postJSON != null)
|
||||
{
|
||||
// If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided
|
||||
if (property_exists($postJSON, self::FILTER_UNIQUE_ID) && property_exists($postJSON, self::FILTER_TYPE))
|
||||
{
|
||||
// Retrives them from the POSTed JSON
|
||||
$filterUniqueId = $postJSON->{self::FILTER_UNIQUE_ID};
|
||||
$filterType = $postJSON->{self::FILTER_TYPE};
|
||||
}
|
||||
|
||||
// If the optional parameter FILTER_ID has been provided
|
||||
if (property_exists($postJSON, self::FILTER_ID)) $filterId = $postJSON->{self::FILTER_ID};
|
||||
}
|
||||
else // otherwise it is an HTTP GET call
|
||||
{
|
||||
// If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided
|
||||
if (isset($_GET[self::FILTER_UNIQUE_ID]) && isset($_GET[self::FILTER_TYPE]))
|
||||
{
|
||||
// Retrives them from the HTTP GET
|
||||
$filterUniqueId = $this->input->get(self::FILTER_UNIQUE_ID);
|
||||
$filterType = $this->input->get(self::FILTER_TYPE);
|
||||
}
|
||||
|
||||
// If the optional parameter FILTER_ID has been provided
|
||||
if (isset($_GET[self::FILTER_ID])) $filterId = $filterId = $this->input->get(self::FILTER_ID);
|
||||
}
|
||||
|
||||
// If the mandatory parameters have _not_ been provided, then terminate the execution and return an error
|
||||
if ($filterUniqueId == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_UNIQUE_ID.'" not provided!');
|
||||
if ($filterType == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_TYPE.'" not provided!');
|
||||
|
||||
// Loads the FilterCmptLib that contains all the used logic
|
||||
$this->load->library(
|
||||
'FilterCmptLib',
|
||||
array(
|
||||
'filterUniqueId' => $filterUniqueId,
|
||||
'filterType' => $filterType,
|
||||
'filterId' => $filterId
|
||||
)
|
||||
);
|
||||
|
||||
// Start the component
|
||||
$this->filtercmptlib->start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class SearchBar extends FHC_Controller
|
||||
{
|
||||
const SEARCHSTR_PARAM = 'searchstr';
|
||||
const TYPES_PARAM = 'types';
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load the library SearchBarLib
|
||||
$this->load->library('SearchBarLib');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$json = json_decode($this->input->raw_input_stream);
|
||||
|
||||
// Checks if the searchstr and the types parameters are in the POSTed JSON
|
||||
if (isset($json->{self::SEARCHSTR_PARAM}) && isset($json->{self::TYPES_PARAM}))
|
||||
{
|
||||
// Convert to json the result from searchbarlib->search
|
||||
$this->outputJson(
|
||||
$this->searchbarlib->search(
|
||||
$json->{self::SEARCHSTR_PARAM},
|
||||
$json->{self::TYPES_PARAM}
|
||||
)
|
||||
);
|
||||
}
|
||||
else // otherwise return an error in JSON format
|
||||
{
|
||||
$this->outputJsonError(SearchBarLib::ERROR_WRONG_JSON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,33 @@ class IssueResolver extends IssueResolver_Controller
|
||||
'CORE_INOUT_0003' => 'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004' => 'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005' => 'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006'
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006',
|
||||
'CORE_INOUT_0007' => 'CORE_INOUT_0007',
|
||||
'CORE_INOUT_0008' => 'CORE_INOUT_0008',
|
||||
'CORE_INOUT_0009' => 'CORE_INOUT_0009',
|
||||
'CORE_STG_0001' => 'CORE_STG_0001',
|
||||
'CORE_STG_0002' => 'CORE_STG_0002',
|
||||
'CORE_STG_0003' => 'CORE_STG_0003',
|
||||
'CORE_STG_0004' => 'CORE_STG_0004',
|
||||
'CORE_STUDENTSTATUS_0001' => 'CORE_STUDENTSTATUS_0001',
|
||||
'CORE_STUDENTSTATUS_0002' => 'CORE_STUDENTSTATUS_0002',
|
||||
'CORE_STUDENTSTATUS_0003' => 'CORE_STUDENTSTATUS_0003',
|
||||
'CORE_STUDENTSTATUS_0004' => 'CORE_STUDENTSTATUS_0004',
|
||||
'CORE_STUDENTSTATUS_0005' => 'CORE_STUDENTSTATUS_0005',
|
||||
'CORE_STUDENTSTATUS_0006' => 'CORE_STUDENTSTATUS_0006',
|
||||
'CORE_STUDENTSTATUS_0007' => 'CORE_STUDENTSTATUS_0007',
|
||||
'CORE_STUDENTSTATUS_0008' => 'CORE_STUDENTSTATUS_0008',
|
||||
'CORE_STUDENTSTATUS_0009' => 'CORE_STUDENTSTATUS_0009',
|
||||
'CORE_STUDENTSTATUS_0010' => 'CORE_STUDENTSTATUS_0010',
|
||||
'CORE_STUDENTSTATUS_0011' => 'CORE_STUDENTSTATUS_0011',
|
||||
'CORE_STUDENTSTATUS_0012' => 'CORE_STUDENTSTATUS_0012',
|
||||
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
|
||||
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
|
||||
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
|
||||
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
|
||||
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
|
||||
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
|
||||
'CORE_PERSON_0004' => 'CORE_PERSON_0004'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for producing Plausicheck issues
|
||||
*/
|
||||
class PlausiIssueProducer extends JOB_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs issue production job.
|
||||
* @param studiensemester_kurzbz string job is run for students of a certain semester.
|
||||
* @param studiengang_kz int job is run for students of certain Studiengang.
|
||||
*/
|
||||
public function run($studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
{
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// execute the check
|
||||
$this->logInfo("Checking " . $fehler_kurzbz . "...");
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($plausicheckRes)) $this->logError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$this->logError(getError($addIssueRes));
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job stopped");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2023 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
use \DateTime as DateTime;
|
||||
use \DB_Model as DB_Model;
|
||||
|
||||
class ReihungstestJob extends JOB_Controller
|
||||
{
|
||||
// OE used to as sender for the test deadline reminder
|
||||
const OU_SENDER_TEST_REMINDER = 'infocenter';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -21,6 +45,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
// Loads CLMessagesModel
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +91,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
'ReihungstestJob',
|
||||
$content_data_arr,
|
||||
MAIL_INFOCENTER,
|
||||
'Support für die Reihungstest-Verwaltung');
|
||||
'Support für die Reihungstest-Verwaltung'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +141,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
|
||||
foreach ($reachedRegistration_rt_arr as $reihungstest)
|
||||
{
|
||||
$reihungstestDatum = date_format(date_create($reihungstest->datum), 'd.m.Y');
|
||||
|
||||
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTestForCronjob($reihungstest->reihungstest_id);
|
||||
|
||||
if (hasData($applicants))
|
||||
@@ -153,14 +183,22 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
if ($applicantCounter == 0)
|
||||
{
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><b>Für den Studiengang '.$studiengang_kuerzel.' nehmen keine InteressentInnen an diesem Reihungstest teil</b></p>';
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' .
|
||||
$reihungstestDatum . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><b>Für den Studiengang '.
|
||||
$studiengang_kuerzel.
|
||||
' nehmen keine InteressentInnen an diesem Reihungstest teil</b></p>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' .
|
||||
$reihungstestDatum .
|
||||
' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
|
||||
$mailcontent .= '
|
||||
<p style="font-family: verdana, sans-serif;"><b>' . $applicantCounter . '</b> InteressentIn(nen) des Studiengangs ' . $studiengang_kuerzel . ' nehmen daran teil:</p>
|
||||
<p style="font-family: verdana, sans-serif;"><b>' . $applicantCounter . '</b> InteressentIn(nen) des Studiengangs ' .
|
||||
$studiengang_kuerzel . ' nehmen daran teil:</p>
|
||||
<p style="font-family: verdana, sans-serif;">
|
||||
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$reihungstest->reihungstest_id.'&studiengang='.$bachelorStudiengang->studiengang_kz.'" target="_blank">
|
||||
Liste der Anmeldungen
|
||||
@@ -176,12 +214,13 @@ class ReihungstestJob extends JOB_Controller
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
$mailcontent_data_arr,
|
||||
$bachelorStudiengang->email,
|
||||
'Anmeldeschluss Reihungstest ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' ' . $reihungstest->uhrzeit . ' Uhr',
|
||||
'Anmeldeschluss Reihungstest ' . $reihungstestDatum . ' ' . $reihungstest->uhrzeit . ' Uhr',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg',
|
||||
$from,
|
||||
'',
|
||||
$bcc);
|
||||
$bcc
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,7 +268,6 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
|
||||
$studiengang = '';
|
||||
$mailReceipients = ''; // String with all mailadresses
|
||||
$mailcontent_data_arr = array();
|
||||
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
|
||||
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
|
||||
@@ -248,10 +286,10 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '</tbody></table>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
|
||||
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
|
||||
Liste der Anmeldungen
|
||||
</a>
|
||||
</p>';
|
||||
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
|
||||
Liste der Anmeldungen
|
||||
</a>
|
||||
</p>';
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
sendSanchoMail(
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
@@ -262,12 +300,15 @@ class ReihungstestJob extends JOB_Controller
|
||||
'sancho_footer_min_bw.jpg',
|
||||
$from,
|
||||
'',
|
||||
$bcc);
|
||||
$bcc
|
||||
);
|
||||
$applicants_list = '';
|
||||
$mailcontent_data_arr = array();
|
||||
}
|
||||
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Folgende InteressentInnen wurden <b>nach</b> der Anmeldefrist zu einem Reihungstest hinzugefügt.<br>Details siehe Link</p>';
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">
|
||||
Folgende InteressentInnen wurden <b>nach</b> der Anmeldefrist zu einem Reihungstest hinzugefügt.<br>Details siehe Link
|
||||
</p>';
|
||||
$mailcontent .= '
|
||||
<table width="100%" style="cellpadding: 3px; font-family: verdana, sans-serif; border: 1px solid #000000;">
|
||||
<thead>
|
||||
@@ -283,7 +324,6 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
|
||||
$studiengang = $applicant->studiengang_kz;
|
||||
$mailReceipients .= $applicant->email . ';';
|
||||
$applicants_list .= '
|
||||
<tr ' . $rowstyle . '>
|
||||
<td>' . date_format(date_create($applicant->datum), 'd.m.Y') . '</td>
|
||||
@@ -299,10 +339,10 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '</tbody></table>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
|
||||
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
|
||||
Liste der Anmeldungen
|
||||
</a>
|
||||
</p>';
|
||||
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
|
||||
Liste der Anmeldungen
|
||||
</a>
|
||||
</p>';
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
sendSanchoMail(
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
@@ -313,7 +353,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
'sancho_footer_min_bw.jpg',
|
||||
$from,
|
||||
'',
|
||||
$bcc);
|
||||
$bcc
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +387,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
|
||||
// Get placement tests with testdate within the next 2 weeks
|
||||
$resultNextTestDates = $this->ReihungstestModel->getNextPlacementtests($degreeProgram, 14);
|
||||
|
||||
if (hasData($resultNextTestDates))
|
||||
{
|
||||
$nextTestDates = $resultNextTestDates->retval;
|
||||
@@ -357,7 +399,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
$testsOndate = array();
|
||||
|
||||
// Deduct days till 2 working days are reached
|
||||
for ($i = 1; ; $i++)
|
||||
// NOTE: the condition is to avoid a never ending loop
|
||||
for ($i = 1; $workingdays < 10; $i++)
|
||||
{
|
||||
if (isDateWorkingDay($testDates->datum, $i) === true)
|
||||
{
|
||||
@@ -393,7 +436,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
{
|
||||
foreach ($testsOndate as $reihungstest)
|
||||
{
|
||||
// Loads applicants of a test
|
||||
// Loads applicants of a test with prestudent ID
|
||||
$applicants_arr = '';
|
||||
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTest($reihungstest->reihungstest_id);
|
||||
|
||||
if (hasData($applicants))
|
||||
@@ -405,34 +449,35 @@ class ReihungstestJob extends JOB_Controller
|
||||
show_error(getError($applicants));
|
||||
}
|
||||
|
||||
foreach ($applicants_arr as $applicant)
|
||||
if (!empty($applicants_arr))
|
||||
{
|
||||
$mailcontent_data_arr = array();
|
||||
$mailcontent_data_arr['anrede'] = $applicant->anrede;
|
||||
$mailcontent_data_arr['nachname'] = $applicant->nachname;
|
||||
$mailcontent_data_arr['vorname'] = $applicant->vorname;
|
||||
$mailcontent_data_arr['rt_datum'] = date_format(date_create($reihungstest->datum), 'd.m.Y');
|
||||
$mailcontent_data_arr['rt_uhrzeit'] = date_format(date_create($reihungstest->uhrzeit), 'H:i');
|
||||
$mailcontent_data_arr['rt_raum'] = $applicant->planbezeichnung;
|
||||
if ($applicant->lageplan == '')
|
||||
foreach ($applicants_arr as $applicant)
|
||||
{
|
||||
$mailcontent_data_arr['wegbeschreibung'] = 'Für diesen Raum liegt noch keine Wegbeschreibung vor.<br><br>No directions were found for this room';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailcontent_data_arr['wegbeschreibung'] = $applicant->lageplan;
|
||||
}
|
||||
$mailcontent_data_arr = array();
|
||||
$mailcontent_data_arr['anrede'] = $applicant->anrede;
|
||||
$mailcontent_data_arr['nachname'] = $applicant->nachname;
|
||||
$mailcontent_data_arr['vorname'] = $applicant->vorname;
|
||||
$mailcontent_data_arr['rt_datum'] = date_format(date_create($reihungstest->datum), 'd.m.Y');
|
||||
$mailcontent_data_arr['rt_uhrzeit'] = date_format(date_create($reihungstest->uhrzeit), 'H:i');
|
||||
$mailcontent_data_arr['rt_raum'] = $applicant->planbezeichnung;
|
||||
if ($applicant->lageplan == '')
|
||||
{
|
||||
$mailcontent_data_arr['wegbeschreibung'] = 'Für diesen Raum liegt noch keine Wegbeschreibung vor.
|
||||
<br><br>No directions were found for this room';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailcontent_data_arr['wegbeschreibung'] = $applicant->lageplan;
|
||||
}
|
||||
|
||||
sendSanchoMail(
|
||||
'Sancho_RemindApplicantsOfTest',
|
||||
$mailcontent_data_arr,
|
||||
$applicant->email,
|
||||
'Ihre Anmeldung zum Reihungstest - Reminder / Your registration for the placement test - Reminder',
|
||||
DEFAULT_SANCHO_HEADER_IMG,
|
||||
DEFAULT_SANCHO_FOOTER_IMG,
|
||||
$from,
|
||||
'',
|
||||
$bcc);
|
||||
$this->CLMessagesModel->sendExplicitTemplateSenderId(
|
||||
$this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID),
|
||||
$applicant->prestudent_id,
|
||||
self::OU_SENDER_TEST_REMINDER,
|
||||
'Sancho_RemindApplicantsOfTest',
|
||||
$mailcontent_data_arr
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,7 +539,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
person_id,
|
||||
tbl_reihungstest.studiensemester_kurzbz,
|
||||
tbl_reihungstest.reihungstest_id,
|
||||
(SELECT(tbl_reihungstest.datum::text || \' \' || tbl_reihungstest.uhrzeit::text)::timestamp) AS reihungstest_timestamp
|
||||
(SELECT(tbl_reihungstest.datum::text || \' \' || tbl_reihungstest.uhrzeit::text)::timestamp) as reihungstest_timestamp
|
||||
');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengangstyp', 'typ');
|
||||
@@ -540,11 +585,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
|
||||
// Sort by STG. This is important to send the mails clustered by STG to the different STG assistances.
|
||||
usort($result_arr, function ($a, $b)
|
||||
{
|
||||
if ($a->studiengang_kz == $b->studiengang_kz) {
|
||||
return 0;
|
||||
}
|
||||
usort($result_arr, function ($a, $b) {
|
||||
if ($a->studiengang_kz == $b->studiengang_kz) return 0;
|
||||
|
||||
return ($a->studiengang_kz < $b->studiengang_kz) ? -1 : 1;
|
||||
});
|
||||
|
||||
@@ -687,6 +730,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
|
||||
// Set associative array with the prepared HTML tables and URL be used by the template's variables
|
||||
$content_data_arr = array();
|
||||
$content_data_arr['studienplan_list'] = $studienplan_list;
|
||||
$content_data_arr['freie_plaetze_list'] = $freie_plaetze_list;
|
||||
$content_data_arr['link'] = site_url('/organisation/Reihungstest');
|
||||
@@ -709,7 +753,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$content_data_arr = array();
|
||||
$content_data_arr['link'] = $content;
|
||||
|
||||
return $content_data_arr;
|
||||
}
|
||||
|
||||
@@ -808,13 +854,13 @@ class ReihungstestJob extends JOB_Controller
|
||||
return;
|
||||
}
|
||||
|
||||
$qry = "WITH prst AS (
|
||||
$qry = "WITH prst as (
|
||||
SELECT DISTINCT
|
||||
get_rolle_prestudent (tbl_prestudent.prestudent_id, ?) AS laststatus,
|
||||
get_rolle_prestudent (tbl_prestudent.prestudent_id, ?) as laststatus,
|
||||
tbl_prestudentstatus.studiensemester_kurzbz,
|
||||
tbl_prestudentstatus.datum AS prestudenstatus_datum,
|
||||
tbl_prestudentstatus.datum as prestudenstatus_datum,
|
||||
tbl_prestudent.*,
|
||||
tbl_studiengang.typ AS studiengang_typ
|
||||
tbl_studiengang.typ as studiengang_typ
|
||||
FROM PUBLIC.tbl_person
|
||||
JOIN PUBLIC.tbl_prestudent USING (person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
@@ -822,16 +868,26 @@ class ReihungstestJob extends JOB_Controller
|
||||
JOIN lehre.tbl_studienordnung USING (studienordnung_id)
|
||||
JOIN PUBLIC.tbl_studiengang ON (tbl_studienordnung.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE get_rolle_prestudent (tbl_prestudent.prestudent_id, ?) IN ('Aufgenommener','Bewerber','Wartender','Abgewiesener')
|
||||
AND studiensemester_kurzbz = ?
|
||||
AND studiensemester_kurzbz = ?
|
||||
AND tbl_studiengang.typ IN ('b', 'm')
|
||||
)
|
||||
SELECT * FROM prst
|
||||
WHERE prestudenstatus_datum >= (SELECT CURRENT_DATE - 1)
|
||||
AND (studiengang_typ = 'b' OR (studiengang_typ = 'm' AND EXISTS (SELECT 1 /* Master Studiengänge berücksichtigen wenn auch Bachelor im gleichen Semester */
|
||||
FROM prst prstb
|
||||
WHERE studiengang_typ = 'b'
|
||||
AND laststatus != 'Abgewiesener'
|
||||
AND prstb.person_id = prst.person_id )))
|
||||
AND (
|
||||
studiengang_typ = 'b'
|
||||
OR
|
||||
(
|
||||
studiengang_typ = 'm'
|
||||
AND
|
||||
EXISTS (
|
||||
SELECT 1 /* Master Studiengänge berücksichtigen wenn auch Bachelor im gleichen Semester */
|
||||
FROM prst prstb
|
||||
WHERE studiengang_typ = 'b'
|
||||
AND laststatus != 'Abgewiesener'
|
||||
AND prstb.person_id = prst.person_id
|
||||
)
|
||||
)
|
||||
)
|
||||
ORDER BY studiengang_kz, laststatus";
|
||||
|
||||
// Encode Params
|
||||
@@ -863,12 +919,12 @@ class ReihungstestJob extends JOB_Controller
|
||||
// Alle niedrigeren Prios laden
|
||||
$qryNiedrPrios = "
|
||||
SELECT DISTINCT
|
||||
get_rolle_prestudent (tbl_prestudent.prestudent_id, '".$row_ps->studiensemester_kurzbz."') AS laststatus,
|
||||
get_rolle_prestudent (tbl_prestudent.prestudent_id, '".$row_ps->studiensemester_kurzbz."') as laststatus,
|
||||
tbl_studienplan.orgform_kurzbz,
|
||||
tbl_person.nachname,
|
||||
tbl_person.vorname,
|
||||
tbl_prestudent.*,
|
||||
tbl_studiengang.typ AS studiengang_typ
|
||||
tbl_studiengang.typ as studiengang_typ
|
||||
FROM PUBLIC.tbl_person
|
||||
JOIN PUBLIC.tbl_prestudent USING (person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
@@ -876,7 +932,10 @@ class ReihungstestJob extends JOB_Controller
|
||||
JOIN PUBLIC.tbl_studiengang ON (tbl_prestudent.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE tbl_prestudent.person_id = ".$row_ps->person_id."
|
||||
AND tbl_prestudent.prestudent_id != ".$row_ps->prestudent_id."
|
||||
AND get_rolle_prestudent (tbl_prestudent.prestudent_id, '".$row_ps->studiensemester_kurzbz."') IN ('Aufgenommener','Bewerber','Wartender')
|
||||
AND get_rolle_prestudent(
|
||||
tbl_prestudent.prestudent_id,
|
||||
'".$row_ps->studiensemester_kurzbz."'
|
||||
) IN ('Aufgenommener','Bewerber','Wartender')
|
||||
AND studiensemester_kurzbz = '".$row_ps->studiensemester_kurzbz."'
|
||||
AND tbl_studiengang.typ IN ('b', 'm')
|
||||
AND priorisierung > ".$row_ps->priorisierung."
|
||||
@@ -1019,12 +1078,12 @@ class ReihungstestJob extends JOB_Controller
|
||||
// Mails senden
|
||||
if (!isEmptyArray($mailArray))
|
||||
{
|
||||
foreach ($mailArray AS $stg=>$orgform)
|
||||
foreach ($mailArray as $stg => $orgform)
|
||||
{
|
||||
$studiengang = $this->StudiengangModel->load($stg);
|
||||
$mailcontent = '';
|
||||
|
||||
foreach ($orgform AS $art=>$value)
|
||||
foreach ($orgform as $art => $value)
|
||||
{
|
||||
// Orgform nur dazu schreiben, wenn es mehr als Eine gibt
|
||||
if (count($orgform) > 1)
|
||||
@@ -1034,12 +1093,12 @@ class ReihungstestJob extends JOB_Controller
|
||||
if (isset($value['AbgewiesenGesetztWartender']) && !isEmptyArray($value['AbgewiesenGesetztWartender']))
|
||||
{
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
|
||||
Folgende Personen auf der Warteliste wurden in einem höher priorisierten Studiengang aufgenommen und haben deshalb einen Status "Abgewiesen" erhalten:</p>';
|
||||
Folgende Personen auf der Warteliste wurden in einem höher priorisierten Studiengang aufgenommen und haben deshalb einen Status "Abgewiesen" erhalten:
|
||||
</p>';
|
||||
$mailcontent .= '<table style="border-collapse: collapse; border: 1px solid grey;">';
|
||||
//$mailcontent .= '<thead><th style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px; text-align: left">Zuvor Warteliste</th></thead>';
|
||||
$mailcontent .= ' <tbody>';
|
||||
sort($value['AbgewiesenGesetztWartender']);
|
||||
foreach ($value['AbgewiesenGesetztWartender'] AS $key=>$bewerber)
|
||||
foreach ($value['AbgewiesenGesetztWartender'] as $key => $bewerber)
|
||||
{
|
||||
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
|
||||
}
|
||||
@@ -1050,10 +1109,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
|
||||
Folgende Aufgenommene wurden in einem höher priorisierten Studiengang aufgenommen:</p>';
|
||||
$mailcontent .= '<table style="border-collapse: collapse; border: 1px solid grey;">';
|
||||
//$mailcontent .= '<thead><th style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px; text-align: left">Aufgenommene</th></thead>';
|
||||
$mailcontent .= ' <tbody>';
|
||||
sort($value['AufnahmeHoeherePrio']);
|
||||
foreach ($value['AufnahmeHoeherePrio'] AS $key=>$bewerber)
|
||||
foreach ($value['AufnahmeHoeherePrio'] as $key => $bewerber)
|
||||
{
|
||||
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
|
||||
}
|
||||
@@ -1066,7 +1124,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailcontent .= '<table style="border-collapse: collapse; border: 1px solid grey;">';
|
||||
$mailcontent .= ' <tbody>';
|
||||
sort($value['AbgewiesenHoeherePrio']);
|
||||
foreach ($value['AbgewiesenHoeherePrio'] AS $key=>$bewerber)
|
||||
foreach ($value['AbgewiesenHoeherePrio'] as $key => $bewerber)
|
||||
{
|
||||
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
|
||||
}
|
||||
@@ -1077,10 +1135,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
|
||||
Folgende BewerberInnen wurden zu Abgewiesenen gemacht:</p>';
|
||||
$mailcontent .= '<table style="border-collapse: collapse; border: 1px solid grey;">';
|
||||
//$mailcontent .= '<thead><th style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px; text-align: left">Aufgenommene</th></thead>';
|
||||
$mailcontent .= ' <tbody>';
|
||||
sort($value['AbgewiesenWeilBewerber']);
|
||||
foreach ($value['AbgewiesenWeilBewerber'] AS $key => $bewerber)
|
||||
foreach ($value['AbgewiesenWeilBewerber'] as $key => $bewerber)
|
||||
{
|
||||
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
|
||||
}
|
||||
@@ -1088,6 +1145,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$mailcontent_data_arr = array();
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
|
||||
// Send email in Sancho design
|
||||
@@ -1102,7 +1160,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
'sancho_footer_min_bw.jpg',
|
||||
$from,
|
||||
'',
|
||||
$bcc);
|
||||
$bcc
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ class Gruppenmanagement extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Benutzer assigned to a Gruppe
|
||||
*/
|
||||
* Gets Benutzer assigned to a Gruppe
|
||||
*/
|
||||
public function getBenutzer()
|
||||
{
|
||||
$gruppe_kurzbz = $this->input->get('gruppe_kurzbz');
|
||||
@@ -93,8 +93,8 @@ class Gruppenmanagement extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all Benutzer for assignment to Gruppe
|
||||
*/
|
||||
* Gets all Benutzer for assignment to Gruppe
|
||||
*/
|
||||
public function getAllBenutzer()
|
||||
{
|
||||
$this->BenutzerModel->addSelect('uid, vorname, nachname');
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Test Search Vue Component
|
||||
*/
|
||||
class TestSearch extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'system/developer:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads WidgetLib
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'filter'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/logs/testSearch.php');
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,8 @@ class InfoCenter extends Auth_Controller
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'infocenter:r',
|
||||
'freigegeben' => 'infocenter:r',
|
||||
@@ -121,6 +121,7 @@ class InfoCenter extends Auth_Controller
|
||||
'unlockPerson' => 'infocenter:rw',
|
||||
'saveFormalGeprueft' => 'infocenter:rw',
|
||||
'saveDocTyp' => 'infocenter:rw',
|
||||
'updateStammdaten' => 'infocenter:rw',
|
||||
'saveNachreichung' => 'infocenter:rw',
|
||||
'getPrestudentData' => 'infocenter:r',
|
||||
'getLastPrestudentWithZgvJson' => 'infocenter:r',
|
||||
@@ -165,18 +166,23 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel');
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
$this->load->model('system/PersonLock_model', 'PersonLockModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('codex/Zgv_model', 'ZgvModel');
|
||||
$this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel');
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Geschlecht_model', 'GeschlechtModel');
|
||||
$this->load->model('person/adresse_model', 'AdresseModel');
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
|
||||
// Loads libraries
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->load->config('infocenter');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
@@ -193,7 +199,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
@@ -401,7 +407,7 @@ class InfoCenter extends Auth_Controller
|
||||
'saveformalgep',
|
||||
array(
|
||||
isEmptyString($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
|
||||
is_null($timestamp) ? 'NULL' : $timestamp
|
||||
is_null($timestamp) ? 'null' : $timestamp
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -602,7 +608,8 @@ class InfoCenter extends Auth_Controller
|
||||
/**
|
||||
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
|
||||
*/
|
||||
private function sendZgvMail($mail, $typ, $person){
|
||||
private function sendZgvMail($mail, $typ, $person)
|
||||
{
|
||||
$data = array(
|
||||
'vorname' => $person->vorname,
|
||||
'nachname' => $person->nachname,
|
||||
@@ -686,7 +693,6 @@ class InfoCenter extends Auth_Controller
|
||||
'openZgv' => $openZgv
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -860,7 +866,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$person_id = $logdata['person_id'];
|
||||
|
||||
$akteresult = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'formal_geprueft_amum !=' => NULL));
|
||||
$akteresult = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'formal_geprueft_amum !=' => null));
|
||||
|
||||
if (hasData($lastStatus) && isSuccess($akteresult))
|
||||
{
|
||||
@@ -1079,8 +1085,23 @@ class InfoCenter extends Auth_Controller
|
||||
*/
|
||||
public function reloadMessages($person_id)
|
||||
{
|
||||
$messages = $this->MessageModel->getMessagesOfPerson($person_id, 1);
|
||||
$this->load->view('system/infocenter/messageList.php', array('messages' => $messages->retval));
|
||||
$messages = $this->CLMessagesModel->getReceivedAndSentMessages($person_id);
|
||||
|
||||
// If there are messages
|
||||
if (hasData($messages))
|
||||
{
|
||||
$personexists = $this->PersonModel->load($person_id);
|
||||
|
||||
if (isError($personexists)) show_error(getError($personexists));
|
||||
|
||||
if (!hasData($personexists)) show_error('Person does not exist!');
|
||||
|
||||
$this->load->view('system/infocenter/messageList.php', getData($messages));
|
||||
}
|
||||
elseif (isError($messages)) // Otherwise if an error occurred
|
||||
{
|
||||
show_error(getError($messages));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1111,14 +1132,14 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
public function reloadDoks($person_id)
|
||||
{
|
||||
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
|
||||
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false);
|
||||
|
||||
$this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval));
|
||||
}
|
||||
|
||||
public function reloadUebersichtDoks($person_id)
|
||||
{
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false);
|
||||
|
||||
$this->DokumentModel->addOrder('bezeichnung');
|
||||
$dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load())));
|
||||
@@ -1222,7 +1243,9 @@ class InfoCenter extends Auth_Controller
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('onholddate');
|
||||
|
||||
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
$result = $this->personloglib->setOnHold(
|
||||
$person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid
|
||||
);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
@@ -1320,10 +1343,129 @@ class InfoCenter extends Auth_Controller
|
||||
$this->outputJsonSuccess('success');
|
||||
}
|
||||
|
||||
public function updateStammdaten()
|
||||
{
|
||||
if (isEmptyString($this->input->post('nachname')) ||
|
||||
isEmptyString($this->input->post('geschlecht')) ||
|
||||
isEmptyString($this->input->post('gebdatum')))
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('infocenter', 'stammdatenFeldFehlt'));
|
||||
}
|
||||
|
||||
$datum = explode('.', $this->input->post('gebdatum'));
|
||||
|
||||
if (!checkdate($datum[1], $datum[0], $datum[2]))
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig'));
|
||||
}
|
||||
|
||||
$person_id = $this->input->post('personid');
|
||||
|
||||
$update = $this->PersonModel->update(
|
||||
array
|
||||
(
|
||||
'person_id' => $person_id
|
||||
),
|
||||
array
|
||||
(
|
||||
'titelpre' => isEmptyString($this->input->post('titelpre')) ? null : $this->input->post('titelpre'),
|
||||
'vorname' => isEmptyString($this->input->post('vorname')) ? null : $this->input->post('vorname'),
|
||||
'nachname' => $this->input->post('nachname'),
|
||||
'titelpost' => isEmptyString($this->input->post('titelpost')) ? null : $this->input->post('titelpost'),
|
||||
'gebdatum' => isEmptyString($this->input->post('gebdatum')) ? null : date("Y-m-d", strtotime($this->input->post('gebdatum'))),
|
||||
'svnr' => isEmptyString($this->input->post('svnr')) ? null : $this->input->post('svnr'),
|
||||
'staatsbuergerschaft' => isEmptyString($this->input->post('buergerschaft')) ? null : $this->input->post('buergerschaft'),
|
||||
'geschlecht' => $this->input->post('geschlecht'),
|
||||
'geburtsnation' => isEmptyString($this->input->post('gebnation')) ? null : $this->input->post('gebnation'),
|
||||
'gebort' => isEmptyString($this->input->post('gebort')) ? null : $this->input->post('gebort'),
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_uid
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($update))
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
|
||||
|
||||
$kontakte = $this->input->post('kontakt');
|
||||
foreach ($kontakte as $kontakt)
|
||||
{
|
||||
$kontaktExists = $this->KontaktModel->loadWhere(array(
|
||||
'kontakt_id' => $kontakt['id'],
|
||||
'person_id' => $person_id,
|
||||
));
|
||||
|
||||
if (hasData($kontaktExists))
|
||||
{
|
||||
$kontaktExists = getData($kontaktExists)[0];
|
||||
|
||||
if ($kontaktExists->kontakt === $kontakt['value'])
|
||||
continue;
|
||||
|
||||
$update = $this->KontaktModel->update(
|
||||
array
|
||||
(
|
||||
'kontakt_id' => $kontakt['id']
|
||||
),
|
||||
array
|
||||
(
|
||||
'kontakt' => isEmptyString($kontakt['value']) ? null : $kontakt['value'],
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_uid
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($update))
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
|
||||
}
|
||||
}
|
||||
|
||||
$adressen = $this->input->post('adresse');
|
||||
|
||||
foreach ($adressen as $adresse)
|
||||
{
|
||||
$adresseExists = $this->AdresseModel->loadWhere(array(
|
||||
'adresse_id' => $adresse['id'],
|
||||
'person_id' => $person_id,
|
||||
));
|
||||
|
||||
if (hasData($adresseExists))
|
||||
{
|
||||
$adresse = $adresse['value'];
|
||||
$adresseExists = getData($adresseExists)[0];
|
||||
if ($adresseExists->strasse !== $adresse['strasse'] ||
|
||||
$adresseExists->plz !== $adresse['plz'] ||
|
||||
$adresseExists->ort !== $adresse['ort'] ||
|
||||
$adresseExists->nation !== $adresse['nation'])
|
||||
{
|
||||
$update = $this->AdresseModel->update(
|
||||
array
|
||||
(
|
||||
'adresse_id' => $adresseExists->adresse_id
|
||||
),
|
||||
array
|
||||
(
|
||||
'strasse' => isEmptyString($adresse['strasse']) ? null : $adresse['strasse'],
|
||||
'plz' => isEmptyString($adresse['plz']) ? null : $adresse['plz'],
|
||||
'ort' => isEmptyString($adresse['ort']) ? null : $adresse['ort'],
|
||||
'nation' => isEmptyString($adresse['nation']) ? null : $adresse['nation'],
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_uid
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($update))
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess('Success');
|
||||
}
|
||||
|
||||
public function saveNachreichung($person_id)
|
||||
{
|
||||
$nachreichungAm = $this->input->post('nachreichungAm');
|
||||
$nachreichungAnmerkung = empty($this->input->post('nachreichungAnmerkung')) ? NULL : $this->input->post('nachreichungAnmerkung');
|
||||
$nachreichungAnmerkung = empty($this->input->post('nachreichungAnmerkung')) ? null : $this->input->post('nachreichungAnmerkung');
|
||||
$typ = $this->input->post('typ');
|
||||
|
||||
$allowedTypes = [
|
||||
@@ -1380,14 +1522,14 @@ class InfoCenter extends Auth_Controller
|
||||
array(
|
||||
'dokument_kurzbz' => $allowedTypes[$typ],
|
||||
'person_id' => $person_id,
|
||||
'erstelltam' => NULL,
|
||||
'erstelltam' => null,
|
||||
'gedruckt' => false,
|
||||
'anmerkung' => $nachreichungAnmerkung,
|
||||
'updateamum' => $today,
|
||||
'updatevon' => get_uid(),
|
||||
'insertamum' => $today,
|
||||
'insertvon' => get_uid(),
|
||||
'uid' => NULL,
|
||||
'uid' => null,
|
||||
'nachgereicht' => true,
|
||||
'nachgereicht_am' => $nachreichungAm
|
||||
)
|
||||
@@ -1396,6 +1538,78 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$this->outputJsonSuccess("Done!");
|
||||
}
|
||||
|
||||
/**
|
||||
* One day I'll be given some nice comment
|
||||
*/
|
||||
public function getAbsageData()
|
||||
{
|
||||
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
|
||||
|
||||
if (!is_null($stg_typ))
|
||||
{
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* One day I'll be given some nice comment
|
||||
*/
|
||||
public function getStudienArtBerechtigung($typ = null)
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
|
||||
/**
|
||||
* One day I'll be given some nice comment
|
||||
*/
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
|
||||
}
|
||||
|
||||
/**
|
||||
* One day I'll be given some nice comment
|
||||
*/
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -1794,21 +2008,21 @@ class InfoCenter extends Auth_Controller
|
||||
if (!isset($stammdaten->retval))
|
||||
return null;
|
||||
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false);
|
||||
|
||||
if (isError($dokumente))
|
||||
{
|
||||
show_error(getError($dokumente));
|
||||
}
|
||||
|
||||
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
|
||||
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false);
|
||||
|
||||
if (isError($dokumente_nachgereicht))
|
||||
{
|
||||
show_error(getError($dokumente_nachgereicht));
|
||||
}
|
||||
|
||||
$messages = $this->MessageModel->getMessagesOfPerson($person_id, 1);
|
||||
$messages = $this->CLMessagesModel->getReceivedAndSentMessages($person_id);
|
||||
|
||||
if (isError($messages))
|
||||
{
|
||||
@@ -1841,13 +2055,13 @@ class InfoCenter extends Auth_Controller
|
||||
$data = array (
|
||||
'lockedby' => $lockedby,
|
||||
'lockedbyother' => $lockedbyother,
|
||||
'stammdaten' => $stammdaten->retval,
|
||||
'dokumente' => $dokumente->retval,
|
||||
'dokumente_nachgereicht' => $dokumente_nachgereicht->retval,
|
||||
'messages' => $messages->retval,
|
||||
'stammdaten' => getData($stammdaten),
|
||||
'dokumente' => getData($dokumente),
|
||||
'dokumente_nachgereicht' => getData($dokumente_nachgereicht),
|
||||
'messages' => getData($messages) == null ? array() : getData($messages),
|
||||
'logs' => $logs,
|
||||
'notizen' => $notizen->retval,
|
||||
'notizenbewerbung' => $notizen_bewerbung->retval
|
||||
'notizen' => getData($notizen),
|
||||
'notizenbewerbung' => getData($notizen_bewerbung)
|
||||
);
|
||||
|
||||
return $data;
|
||||
@@ -1885,15 +2099,21 @@ class InfoCenter extends Auth_Controller
|
||||
//get orgform for german and english
|
||||
if (isset($zgvpruefung->prestudentstatus->bezeichnung_orgform) && is_array($zgvpruefung->prestudentstatus->bezeichnung_orgform))
|
||||
{
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform_german = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'German');
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform_english = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'English');
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform_german = getPhraseByLanguage(
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform, 'German'
|
||||
);
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform_english = getPhraseByLanguage(
|
||||
$zgvpruefung->prestudentstatus->bezeichnung_orgform, 'English'
|
||||
);
|
||||
}
|
||||
|
||||
$position = strpos($zgvpruefung->prestudentstatus->anmerkung, 'Alt:');
|
||||
|
||||
//parse Anmerkung for Alternative (Prio is given in orgform and sprache anyway)
|
||||
$zgvpruefung->prestudentstatus->alternative = is_numeric($position) ? substr($zgvpruefung->prestudentstatus->anmerkung, $position) : null;
|
||||
$zgvpruefung->prestudentstatus->alternative = is_numeric($position) ?
|
||||
substr($zgvpruefung->prestudentstatus->anmerkung, $position) : null;
|
||||
}
|
||||
|
||||
//if prestudent is not interessent or is already bestaetigt, then show only as information, non-editable
|
||||
$zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus)
|
||||
|| isset($zgvpruefung->prestudentstatus->bestaetigtam)
|
||||
@@ -1904,15 +2124,21 @@ class InfoCenter extends Auth_Controller
|
||||
//wether prestudent was freigegeben for RT/Stg
|
||||
$zgvpruefung->isRtFreigegeben = false;
|
||||
$zgvpruefung->isStgFreigegeben = false;
|
||||
$zgvpruefung->sendStgFreigabeMsg = true;//wether Stgudiengangfreigabemessage can be sent (for "exceptions", Studiengänge with no message sending)
|
||||
// Wether Stgudiengangfreigabemessage can be sent (for "exceptions", Studiengänge with no message sending)
|
||||
$zgvpruefung->sendStgFreigabeMsg = true;
|
||||
|
||||
$isFreigegeben = null;
|
||||
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
|
||||
{
|
||||
$this->PrestudentstatusModel->addSelect('bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund');
|
||||
$this->PrestudentstatusModel->addSelect(
|
||||
'bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund'
|
||||
);
|
||||
$this->PrestudentstatusModel->addJoin('public.tbl_status_grund', 'statusgrund_id', 'LEFT');
|
||||
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array('studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
|
||||
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS, 'prestudent_id' => $prestudent->prestudent_id));
|
||||
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array(
|
||||
'studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
|
||||
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS,
|
||||
'prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
|
||||
if (hasData($isFreigegeben))
|
||||
@@ -1921,11 +2147,14 @@ class InfoCenter extends Auth_Controller
|
||||
{
|
||||
if (isset($prestudentstatus->bestaetigtam))
|
||||
{
|
||||
//if statusgrund set - freigegeben for Studiengang, otherwise freigegeben for RT
|
||||
// If statusgrund set - freigegeben for Studiengang, otherwise freigegeben for RT
|
||||
if (isset($prestudentstatus->statusgrund_id))
|
||||
{
|
||||
if (isset($prestudentstatus->bezeichnung_statusgrund[0])
|
||||
&& in_array($prestudentstatus->bezeichnung_statusgrund[0], $this->_statusgruendeNoStgFreigabeMessage))
|
||||
&& in_array(
|
||||
$prestudentstatus->bezeichnung_statusgrund[0],
|
||||
$this->_statusgruendeNoStgFreigabeMessage)
|
||||
)
|
||||
$zgvpruefung->sendStgFreigabeMsg = false;
|
||||
else
|
||||
$zgvpruefung->isStgFreigegeben = true;
|
||||
@@ -1935,43 +2164,52 @@ class InfoCenter extends Auth_Controller
|
||||
$zgvpruefung->isRtFreigegeben = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//application priority change possible?
|
||||
$zgvpruefung->changeup = false;
|
||||
$zgvpruefung->changedown = false;
|
||||
$zgvpruefung->hasBewerber = false;
|
||||
|
||||
if (isset($zgvpruefung->prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz == self::INTERESSENTSTATUS)
|
||||
{
|
||||
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester = $zgvpruefung->prestudentstatus->studiensemester_kurzbz;
|
||||
//show warning if there is already another bewerber (RT result already exists)
|
||||
$bewerber = $this->PersonModel->hasBewerber($person_id, $studiensemester, 'b');
|
||||
|
||||
if (hasData($bewerber))
|
||||
{
|
||||
$bewerbercnt = getData($bewerber);
|
||||
|
||||
if (is_numeric($bewerbercnt[0]->anzahl_bewerber) && $bewerbercnt[0]->anzahl_bewerber > 0)
|
||||
{
|
||||
$zgvpruefung->hasBewerber = true;
|
||||
}
|
||||
}
|
||||
|
||||
$zgvpruefung->changeup = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, -1);
|
||||
$zgvpruefung->changedown = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, 1);
|
||||
}
|
||||
}
|
||||
// Application priority change possible?
|
||||
$zgvpruefung->changeup = false;
|
||||
$zgvpruefung->changedown = false;
|
||||
$zgvpruefung->hasBewerber = false;
|
||||
|
||||
if (isset($zgvpruefung->prestudentstatus->status_kurzbz)
|
||||
&& $zgvpruefung->prestudentstatus->status_kurzbz == self::INTERESSENTSTATUS)
|
||||
{
|
||||
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester = $zgvpruefung->prestudentstatus->studiensemester_kurzbz;
|
||||
//show warning if there is already another bewerber (RT result already exists)
|
||||
$bewerber = $this->PersonModel->hasBewerber($person_id, $studiensemester, 'b');
|
||||
|
||||
if (hasData($bewerber))
|
||||
{
|
||||
$bewerbercnt = getData($bewerber);
|
||||
|
||||
if (is_numeric($bewerbercnt[0]->anzahl_bewerber) && $bewerbercnt[0]->anzahl_bewerber > 0)
|
||||
{
|
||||
$zgvpruefung->hasBewerber = true;
|
||||
}
|
||||
}
|
||||
|
||||
$zgvpruefung->changeup = $this->PrestudentModel->checkPrioChange(
|
||||
$zgvpruefung->prestudent_id, $studiensemester, -1
|
||||
);
|
||||
$zgvpruefung->changedown = $this->PrestudentModel->checkPrioChange(
|
||||
$zgvpruefung->prestudent_id, $studiensemester, 1
|
||||
);
|
||||
}
|
||||
}
|
||||
$zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $zgvpruefung->prestudent_id));
|
||||
|
||||
if (isSuccess($zgvExist) && hasData($zgvExist))
|
||||
if (isSuccess($zgvExist) && hasData($zgvExist))
|
||||
{
|
||||
$this->ZGVPruefungStatusModel->addOrder('datum', 'DESC');
|
||||
$this->ZGVPruefungStatusModel->addLimit(1);
|
||||
|
||||
$statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id));
|
||||
$statusZGV = $this->ZGVPruefungStatusModel->loadWhere(
|
||||
array(
|
||||
'zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id
|
||||
)
|
||||
);
|
||||
|
||||
if (isSuccess($statusZGV) && hasData($statusZGV))
|
||||
$zgvpruefung->statusZGV = $statusZGV->retval[0]->status;
|
||||
@@ -1996,7 +2234,13 @@ class InfoCenter extends Auth_Controller
|
||||
$this->NationModel->addOrder('langtext');
|
||||
$allNations = getData($this->NationModel->load());
|
||||
|
||||
$data = array (
|
||||
|
||||
$additional_stg = explode(',', ($this->config->item('infocenter_studiengang_kz')));
|
||||
|
||||
$this->GeschlechtModel->addOrder('sort');
|
||||
$allGenders = getData($this->GeschlechtModel->load());
|
||||
|
||||
$data = array(
|
||||
'zgvpruefungen' => $zgvpruefungen,
|
||||
'abwstatusgruende' => $abwstatusgruende,
|
||||
'intstatusgruende' => $intstatusgruende,
|
||||
@@ -2004,6 +2248,8 @@ class InfoCenter extends Auth_Controller
|
||||
'all_zgvs' => $allZGVs,
|
||||
'all_zgvs_master' => $allZGVsMaster,
|
||||
'all_nations' => $allNations,
|
||||
'additional_stg' => $additional_stg,
|
||||
'all_genders' => $allGenders
|
||||
);
|
||||
|
||||
return $data;
|
||||
@@ -2017,7 +2263,7 @@ class InfoCenter extends Auth_Controller
|
||||
{
|
||||
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
@usort($zgvpruefungen, function ($a, $b) {
|
||||
@usort($zgvpruefungen, function($a, $b) {
|
||||
//sort:
|
||||
// 1: Studiensemester
|
||||
if (isset($a->prestudentstatus->studiensemester_kurzbz) || isset($b->prestudentstatus->studiensemester_kurzbz))
|
||||
@@ -2118,7 +2364,13 @@ class InfoCenter extends Auth_Controller
|
||||
$studiengang_mail = $prestudentdata->studiengangmail;
|
||||
$studiengang_typ = $prestudentdata->studiengangtyp;
|
||||
|
||||
return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail, 'studiengang_typ' => $studiengang_typ);
|
||||
return array(
|
||||
'person_id' => $person_id,
|
||||
'studiengang_kurzbz' => $studiengang_kurzbz,
|
||||
'studiengang_bezeichnung' => $studiengang_bezeichnung,
|
||||
'studiengang_mail' => $studiengang_mail,
|
||||
'studiengang_typ' => $studiengang_typ
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2164,8 +2416,8 @@ class InfoCenter extends Auth_Controller
|
||||
$prestudentstatus = $prestudent->prestudentstatus;
|
||||
$person_id = $prestudent->person_id;
|
||||
$person = $this->PersonModel->getPersonStammdaten($person_id, true)->retval;
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false)->retval;
|
||||
$dokumenteNachzureichen = $this->AkteModel->getAktenWithDokInfo($person_id, null, true)->retval;
|
||||
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false)->retval;
|
||||
$dokumenteNachzureichen = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false)->retval;
|
||||
|
||||
//fill mail variables
|
||||
$interessentbez = $person->geschlecht == 'm' ? 'Ein Interessent' : 'Eine Interessentin';
|
||||
@@ -2194,8 +2446,13 @@ class InfoCenter extends Auth_Controller
|
||||
foreach ($dokumenteNachzureichen as $dokument)
|
||||
{
|
||||
$anmerkung = !isEmptyString($dokument->anmerkung) ? ' | Anmerkung: '.$dokument->anmerkung : '';
|
||||
$nachgereichtam = !isEmptyString($dokument->nachgereicht_am) ? ' | wird nachgereicht bis '.date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : '';
|
||||
$dokumenteNachzureichenMail[] = array('dokument_bezeichnung' => $dokument->dokument_bezeichnung, 'anmerkung' => $anmerkung, 'nachgereicht_am' => $nachgereichtam);
|
||||
$nachgereichtam = !isEmptyString($dokument->nachgereicht_am) ?
|
||||
' | wird nachgereicht bis '.date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : '';
|
||||
$dokumenteNachzureichenMail[] = array(
|
||||
'dokument_bezeichnung' => $dokument->dokument_bezeichnung,
|
||||
'anmerkung' => $anmerkung,
|
||||
'nachgereicht_am' => $nachgereichtam
|
||||
);
|
||||
}
|
||||
|
||||
$notizenBewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung')->retval;
|
||||
@@ -2224,11 +2481,6 @@ class InfoCenter extends Auth_Controller
|
||||
'nachname' => $person->nachname,
|
||||
'prestudentid' => $prestudent_id,
|
||||
'statusgrund' => $statusgrund,
|
||||
/*'zgvbez' => $prestudent->zgv_bez,
|
||||
'zgvort' => $zgvort,
|
||||
'zgvdatum' => $zgvdatum,
|
||||
'zgvnation' => $zgvnation,
|
||||
*/
|
||||
'notizentext' => $notizentext,
|
||||
'dokumente' => $dokumenteMail,
|
||||
'dokumente_nachgereicht' => $dokumenteNachzureichenMail,
|
||||
@@ -2238,7 +2490,11 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->library('LogLib');
|
||||
$this->load->helper('hlp_sancho');
|
||||
|
||||
$subject = ($person->geschlecht == 'm' ? 'Interessent ' : 'Interessentin ').$person->vorname.' '.$person->nachname.' für '.$prestudentstatus->studiengangbezeichnung.$orgform.' freigegeben';
|
||||
$subject = ($person->geschlecht == 'm' ? 'Interessent ' : 'Interessentin ').
|
||||
$person->vorname.' '.
|
||||
$person->nachname.' für '.
|
||||
$prestudentstatus->studiengangbezeichnung.
|
||||
$orgform.' freigegeben';
|
||||
|
||||
$receiver = $prestudent->studiengangmail;
|
||||
|
||||
@@ -2259,64 +2515,5 @@ class InfoCenter extends Auth_Controller
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
|
||||
public function getAbsageData()
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']);
|
||||
|
||||
if (hasData($stg_typ))
|
||||
{
|
||||
$stg_typ = getData($stg_typ);
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
public function getStudienArtBerechtigung()
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung());
|
||||
}
|
||||
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Plausichecks extends Auth_Controller
|
||||
{
|
||||
const GENERIC_ISSUE_OCCURED_TEXT = 'Issue aufgetreten';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => array('system/issues_verwalten:r'),
|
||||
'runChecks' => array('system/issues_verwalten:r')
|
||||
)
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/*
|
||||
* Get data for filtering the plausichecks and load the view.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$filterData = $this->_getFilterData();
|
||||
$this->load->view('system/issues/plausichecks', $filterData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate plausichecks run.
|
||||
*/
|
||||
public function runChecks()
|
||||
{
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$fehler_kurzbz = $this->input->get('fehler_kurzbz');
|
||||
|
||||
// issues array for passing issue texts
|
||||
$issueTexts = array();
|
||||
// all fehler kurzbz which are going to be checked
|
||||
$fehlerKurzbz = !isEmptyString($fehler_kurzbz) ? array($fehler_kurzbz) : $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
// set Studiengang to null if not passed
|
||||
if (isEmptyString($studiengang_kz)) $studiengang_kz = null;
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// execute the check
|
||||
$issueTexts[$fehler_kurzbz] = array();
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($plausicheckRes)) $this->terminateWithJsonError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// get Text of the Fehler
|
||||
$this->FehlerModel->addSelect('fehlertext');
|
||||
$fehlerRes = $this->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (isError($fehlerRes)) $this->outputJsonError(getError($fehlerRes));
|
||||
|
||||
// optionally replace fehler parameters in text, output the fehlertext
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
// use issue fehler text from database if present
|
||||
$fehlerText = getData($fehlerRes)[0]->fehlertext;
|
||||
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
// replace placeholder with params, if present
|
||||
if (count($fehlertext_params) != substr_count($fehlerText, '%s'))
|
||||
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz);
|
||||
|
||||
$fehlerText = vsprintf($fehlerText, $fehlertext_params);
|
||||
}
|
||||
}
|
||||
else // if no issue text found, use generic text
|
||||
{
|
||||
$fehlerText = self::GENERIC_ISSUE_OCCURED_TEXT;
|
||||
}
|
||||
|
||||
// add generic parameters to issue text
|
||||
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
|
||||
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
|
||||
$issueTexts[$fehler_kurzbz][] = $fehlerText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($issueTexts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data needed for filtering for limiting checks.
|
||||
*/
|
||||
private function _getFilterData()
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$studiensemesterRes = $this->StudiensemesterModel->load();
|
||||
|
||||
if (isError($studiensemesterRes)) show_error(getError($studiensemesterRes));
|
||||
|
||||
$currSemRes = $this->StudiensemesterModel->getAkt();
|
||||
|
||||
if (isError($currSemRes)) show_error(getError($currSemRes));
|
||||
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, tbl_studiengang.bezeichnung, tbl_studiengang.typ,
|
||||
tbl_studiengangstyp.bezeichnung AS typbezeichnung, UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel');
|
||||
$this->StudiengangModel->addJoin('public.tbl_studiengangstyp', 'typ');
|
||||
$this->StudiengangModel->addOrder('kuerzel, tbl_studiengang.bezeichnung, studiengang_kz');
|
||||
$studiengaengeRes = $this->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaengeRes)) show_error(getError($studiengaengeRes));
|
||||
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
|
||||
return array(
|
||||
'semester' => hasData($studiensemesterRes) ? getData($studiensemesterRes) : array(),
|
||||
'currsemester' => hasData($currSemRes) ? getData($currSemRes) : array(),
|
||||
'studiengaenge' => hasData($studiengaengeRes) ? getData($studiengaengeRes) : array(),
|
||||
'fehler' => $fehlerKurzbz
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,15 @@ abstract class FHC_Controller extends CI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the JSON decoded HTTP POST request
|
||||
* If the request is not in JSON format then a null value is returned
|
||||
*/
|
||||
protected function getPostJSON()
|
||||
{
|
||||
return json_decode($this->input->raw_input_stream);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -185,3 +194,4 @@ abstract class FHC_Controller extends CI_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface defining method to implement for issue producer (from core and extensions)
|
||||
*/
|
||||
interface IIssueExistsChecker
|
||||
{
|
||||
/**
|
||||
* Checks if an issue exists.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
public function checkIfIssueExists($paramsForChecking);
|
||||
|
||||
/**
|
||||
* Produces an issue.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
//public function produceIssue($person_id, $oe_kurzbz, $paramsForProducing);
|
||||
}
|
||||
@@ -5,7 +5,8 @@
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const ISSUES_FOLDER = 'issues';
|
||||
const CI_PATH = 'application';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
protected $_codeLibMappings;
|
||||
@@ -43,71 +44,68 @@ abstract class IssueResolver_Controller extends JOB_Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$openIssues = getData($openIssuesRes);
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
// ignore if Fehlercode is not in libmappings (shouldn't be checked)
|
||||
if (!isset($this->_codeLibMappings[$issue->fehlercode])) continue;
|
||||
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH . '/' . $libRootPath . 'libraries/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
// load library connected to fehlercode
|
||||
$this->load->library($issuesLibPath . $libName);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php';
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->load->library(
|
||||
$issuesLibPath . $libName
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in libary class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* FHC Helper
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @subpackage Helpers
|
||||
* @category Helpers
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
@@ -42,15 +41,19 @@ function generateToken($length = 64)
|
||||
{
|
||||
$firstGeneratedToken = random_bytes($length); // try to generates cryptographically secure pseudo-random bytes...
|
||||
}
|
||||
catch (Exception $e) { $firstGeneratedToken = null; } // if fails $firstGeneratedToken is set to null
|
||||
catch (Exception $e)
|
||||
{
|
||||
// If fails $firstGeneratedToken is set to null
|
||||
$firstGeneratedToken = null;
|
||||
}
|
||||
}
|
||||
// For PHP >= 5.3 and < 7 and openssl is available
|
||||
elseif (function_exists('openssl_random_pseudo_bytes'))
|
||||
{
|
||||
$firstGeneratedToken = openssl_random_pseudo_bytes($length, $strong);
|
||||
// If the token generation ended with errors OR the generated token is NOT strong enough
|
||||
if ($firstGeneratedToken == false || $strong == false) $firstGeneratedToken = null; // $firstGeneratedToken is set to null
|
||||
}
|
||||
if ($firstGeneratedToken == false || $strong == false) $firstGeneratedToken = null; // $firstGeneratedToken is set to null
|
||||
}
|
||||
|
||||
if ($firstGeneratedToken != null) // If everything was fine
|
||||
{
|
||||
@@ -107,10 +110,7 @@ function var_dump_to_error_log($parameter)
|
||||
function loadResource($path, $resources = null, $subdir = false)
|
||||
{
|
||||
// Place a / character at the and of the string if not present
|
||||
if (strrpos($path, '/') < strlen($path) - 1)
|
||||
{
|
||||
$path .= '/';
|
||||
}
|
||||
if (strrpos($path, '/') < strlen($path) - 1) $path .= '/';
|
||||
|
||||
// Loads in $tmpResources all the given resources
|
||||
$tmpResources = $resources;
|
||||
@@ -125,28 +125,36 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
|
||||
// Loads in $tmpPaths path and eventually the subdirectories
|
||||
$tmpPaths = array($path);
|
||||
// NOTE: Used @ to prevent ugly error messages
|
||||
if (is_dir($path) && ($dirHandler = @opendir($path)) !== false)
|
||||
|
||||
// If path is a directory
|
||||
if (is_dir($path))
|
||||
{
|
||||
// Reads all file system entries present in path
|
||||
while (($entry = readdir($dirHandler)) !== false)
|
||||
// NOTE: Used @ to prevent ugly error messages
|
||||
$dirHandler = @opendir($path);
|
||||
|
||||
// Successfully opened
|
||||
if ($dirHandler !== false)
|
||||
{
|
||||
// If entry is a directory but not the current and subdirectories should be loaded
|
||||
if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($entry))
|
||||
// Reads all file system entries present in path
|
||||
while (($entry = readdir($dirHandler)) !== false)
|
||||
{
|
||||
$tmpPaths[] = $entry;
|
||||
}
|
||||
// If no resources are specified and the current file system entry is a file
|
||||
if ($resources == null && is_file($path.$entry))
|
||||
{
|
||||
// If the current entry is a php file store the name without extension
|
||||
if ($entry != ($tmpName = str_replace('.php', '', $entry)))
|
||||
// If entry is a directory but not the current and subdirectories should be loaded
|
||||
if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($path.$entry))
|
||||
{
|
||||
$tmpResources[] = $tmpName;
|
||||
$tmpPaths[] = $path.$entry.'/';
|
||||
}
|
||||
// If no resources are specified and the current file system entry is a file
|
||||
if ($resources == null && is_file($path.$entry))
|
||||
{
|
||||
// Name without php extension
|
||||
$tmpName = str_replace('.php', '', $entry);
|
||||
|
||||
// If the current entry is a php file store the name without extension
|
||||
if ($entry != $tmpName) $tmpResources[] = $tmpName;
|
||||
}
|
||||
}
|
||||
closedir($dirHandler);
|
||||
}
|
||||
closedir($dirHandler);
|
||||
}
|
||||
|
||||
// Loops through the resources
|
||||
@@ -156,10 +164,7 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
foreach ($tmpPaths as $tmpPath)
|
||||
{
|
||||
$fileName = $tmpPath.$tmpResource.'.php'; // Php extension
|
||||
if (file_exists($fileName))
|
||||
{
|
||||
include_once($fileName);
|
||||
}
|
||||
if (file_exists($fileName)) include_once($fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -351,3 +356,52 @@ function sanitizeProblemChars($str)
|
||||
|
||||
return preg_replace($acentos, array_keys($acentos), htmlentities($str, ENT_NOQUOTES | ENT_HTML5, $enc));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function findResource($path, $resource, $subdir = false, $extraDir = null)
|
||||
{
|
||||
// Place a / character at the and of the string if not present
|
||||
if (strrpos($path, '/') < strlen($path) - 1) $path .= '/';
|
||||
|
||||
// Loads in $tmpPaths path and eventually the subdirectories
|
||||
$tmpPaths = array($path);
|
||||
if (is_dir($path))
|
||||
{
|
||||
// NOTE: Used @ to prevent ugly error messages
|
||||
$dirHandler = @opendir($path);
|
||||
|
||||
// Successfully opened
|
||||
if ($dirHandler !== false)
|
||||
{
|
||||
// Reads all file system entries present in path
|
||||
while (($entry = readdir($dirHandler)) !== false)
|
||||
{
|
||||
// If entry is a directory but not the current and subdirectories should be loaded
|
||||
if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($path.$entry))
|
||||
{
|
||||
if ($extraDir == null)
|
||||
{
|
||||
$tmpPaths[] = $path.$entry.'/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpPaths[] = $path.$entry.'/'.$extraDir.'/';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dirHandler);
|
||||
}
|
||||
}
|
||||
|
||||
// Loops through the paths
|
||||
foreach ($tmpPaths as $tmpPath)
|
||||
{
|
||||
$fileName = $tmpPath.$resource.'.php'; // Php extension
|
||||
if (file_exists($fileName)) return $fileName;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,31 @@ function generateJSsInclude($JSs)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the javascript modules you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
function generateJSModulesInclude($JSModules)
|
||||
{
|
||||
$jsInclude = '<script type="module" src="%s"></script>';
|
||||
|
||||
$ci =& get_instance();
|
||||
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
|
||||
|
||||
if (isset($JSModules))
|
||||
{
|
||||
$tmpJSs = is_array($JSModules) ? $JSModules : array($JSModules);
|
||||
|
||||
for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++)
|
||||
{
|
||||
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL;
|
||||
|
||||
if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;
|
||||
|
||||
echo $toPrint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates all the includes needed by the Addons
|
||||
*/
|
||||
@@ -156,16 +181,26 @@ function generateAddonsJSsInclude($calledFrom)
|
||||
{
|
||||
$aktive_addons = array_filter(explode(";", ACTIVE_ADDONS));
|
||||
|
||||
// For each active addon
|
||||
foreach ($aktive_addons as $addon)
|
||||
{
|
||||
// Build the path to the hook file
|
||||
$hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php';
|
||||
|
||||
// If the hook file exists
|
||||
if (file_exists($hookfile))
|
||||
{
|
||||
include($hookfile);
|
||||
$js_hooks = array(); // default value
|
||||
|
||||
include($hookfile); // include the hook file where the array js_hooks should be setup
|
||||
|
||||
// If it contains the provided key calledFrom
|
||||
if (key_exists($calledFrom, $js_hooks))
|
||||
{
|
||||
foreach ($js_hooks[$calledFrom] as $js_file)
|
||||
{
|
||||
generateJSsInclude('addons/'.$addon.'/'.$js_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,3 +215,4 @@ function generateBackwardCompatibleJSMsIe($js)
|
||||
echo ' <script type="text/javascript" src="'.$js.'"></script>'."\n";
|
||||
echo "<![endif]-->\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
/* Copyright (C) 2022 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../vendor/nategood/httpful/bootstrap.php');
|
||||
|
||||
use \ZipArchive as ZipArchive;
|
||||
|
||||
/**
|
||||
* Simple client to convert documents using Docsbox
|
||||
*/
|
||||
class DocsboxLib
|
||||
{
|
||||
const ERROR = 1;
|
||||
const SUCCESS = 0;
|
||||
const STATUS_FINISHED = 'finished'; // Docsbox status when a document conversion ended
|
||||
const STATUS_QUEUED = 'queued'; // Docsbox status when a file has been queued for the conversion
|
||||
const STATUS_STARTED = 'started'; // Docsbox status when a file has started being worked
|
||||
const STATUS_WORKING = 'working'; // Docsbox status when a file is being converted
|
||||
const OUTPUT_FILENAME = 'out.zip.pdf'; // File name used by docsbox to save a converted document
|
||||
|
||||
const DEFAULT_FORMAT = 'pdf'; // Default supported format
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Public static methods
|
||||
|
||||
/**
|
||||
* Static method used to convert a document using a Docsbox installation (local/remote) over the network
|
||||
* It return 0 on success and any other integer on error
|
||||
* NOTE: currently format is not supported
|
||||
*/
|
||||
public static function convert($inputFileName, $outputFileName, $format)
|
||||
{
|
||||
// If a format has not been given
|
||||
if (($format == null) || ($format != null && ctype_space($format) === true)) $format = self::DEFAULT_FORMAT;
|
||||
|
||||
// Posts the file to docsbox
|
||||
$queueId = self::_postFile($inputFileName);
|
||||
// If an error occurred
|
||||
if ($queueId == null) return self::ERROR;
|
||||
|
||||
// Checks and waits if the file has been converted
|
||||
$resultUrl = self::_checkConvertion($queueId);
|
||||
// If an error occurred
|
||||
if ($resultUrl == null) return self::ERROR;
|
||||
|
||||
// Download and rename the converted file
|
||||
$downloaded = self::_downloadFile($resultUrl, $outputFileName);
|
||||
// If an error occurred
|
||||
if (!$downloaded) return self::ERROR;
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Private static methods
|
||||
|
||||
/**
|
||||
* Posts the given file to a Docsboxserver and checks the response to return a valid queue id
|
||||
* On failure it returns a null value
|
||||
*/
|
||||
private static function _postFile($inputFileName)
|
||||
{
|
||||
$queueId = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Posts the given file and expects a response in JSON format
|
||||
$postFileResponse = \Httpful\Request::post(DOCSBOX_SERVER.DOCSBOX_PATH_API)
|
||||
->attach(array('file' => $inputFileName))
|
||||
->expectsJson()
|
||||
->send();
|
||||
|
||||
// Checks that:
|
||||
// - the response is not empty
|
||||
// - the reponse body has the property id
|
||||
// - the property id is a valid string
|
||||
// - the reponse body has the property status
|
||||
// - docsbox queued the conversion of the posted file
|
||||
if (is_object($postFileResponse)
|
||||
&& isset($postFileResponse->body)
|
||||
&& isset($postFileResponse->body->id)
|
||||
&& $postFileResponse->body->id != '' && $postFileResponse->body->id != null
|
||||
&& isset($postFileResponse->body->status)
|
||||
&& $postFileResponse->body->status == self::STATUS_QUEUED)
|
||||
{
|
||||
$queueId = $postFileResponse->body->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If docsbox refused to convert the posted file
|
||||
if (isset($postFileResponse->body->status)
|
||||
&& $postFileResponse->body->status != self::STATUS_QUEUED)
|
||||
{
|
||||
error_log(
|
||||
'Docsbox did not queue the posted file. Returned status: '.
|
||||
$postFileResponse->body->status
|
||||
);
|
||||
}
|
||||
else // any other generic error
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while posting to docsbox. Response: '.
|
||||
print_r($postFileResponse, 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
return $queueId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the status of the file convertion identified by the given queue element id
|
||||
* A URL is returned with the path where it is possible to download the converted file
|
||||
* If an error occurred then a null value is returned
|
||||
*/
|
||||
private static function _checkConvertion($queueId)
|
||||
{
|
||||
$resultUrl = null;
|
||||
$startConvertionsTime = time(); // time when the file conversion has started
|
||||
|
||||
// Until a timeout has occurred
|
||||
while (time() - $startConvertionsTime <= DOCSBOX_CONVERSION_TIMEOUT)
|
||||
{
|
||||
sleep(DOCSBOX_WAITING_SLEEP_TIME); // takes a nap on every round
|
||||
|
||||
try
|
||||
{
|
||||
// Calls the docsbox server to check the status of the
|
||||
// file conversion using the provided queue id
|
||||
// it expects a response in JSON format
|
||||
$getStatusResponse = \Httpful\Request::get(DOCSBOX_SERVER.DOCSBOX_PATH_API.$queueId)
|
||||
->expectsJson()
|
||||
->send();
|
||||
|
||||
// Checks that:
|
||||
// - the response is not empty
|
||||
// - the reponse body has the property id
|
||||
// - the property id is a valid string
|
||||
// - the reponse body has the property status
|
||||
// - docsbox is working the conversion of the posted file
|
||||
if (is_object($getStatusResponse)
|
||||
&& isset($getStatusResponse->body->id)
|
||||
&& $getStatusResponse->body->id != '' && $getStatusResponse->body->id != null
|
||||
&& isset($getStatusResponse->body->status))
|
||||
{
|
||||
// Checks that docsbox has finished working on the file conversion
|
||||
// and that there is a valid resultUrl property
|
||||
if ($getStatusResponse->body->status == self::STATUS_FINISHED
|
||||
&& isset($getStatusResponse->body->result_url)
|
||||
&& $getStatusResponse->body->result_url != ''
|
||||
&& $getStatusResponse->body->result_url != null)
|
||||
{
|
||||
$resultUrl = $getStatusResponse->body->result_url;
|
||||
break;
|
||||
}
|
||||
// Just started or still working on it
|
||||
elseif ($getStatusResponse->body->status == self::STATUS_WORKING
|
||||
|| $getStatusResponse->body->status == self::STATUS_STARTED)
|
||||
{
|
||||
// go on!
|
||||
}
|
||||
else // any other status is abnormal
|
||||
{
|
||||
error_log(
|
||||
'Not valid status for queue element: '.$queueId.'. Response: '.
|
||||
print_r($getStatusResponse, 1)
|
||||
);
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
else // if the response from the docsbox server is not valid
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while checking the docsbox activity. Response: '.
|
||||
print_r($getStatusResponse, 1)
|
||||
);
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
|
||||
return $resultUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the converted file using the provided URL, unzip it, and renames it into the provided file name
|
||||
*/
|
||||
private static function _downloadFile($resultUrl, $outputFileName)
|
||||
{
|
||||
$downloaded = false; // pessimistic assumption
|
||||
|
||||
try
|
||||
{
|
||||
// Download the file
|
||||
$getFileResponse = \Httpful\Request::get(DOCSBOX_SERVER.$resultUrl)->send();
|
||||
|
||||
// If the downloaded file content is valid and not empty
|
||||
if (isset($getFileResponse->body)
|
||||
&& $getFileResponse->body != null
|
||||
&& $getFileResponse->body != '')
|
||||
{
|
||||
// Output directory where to unzip the downloaded zip file
|
||||
$outputDirectory = dirname($outputFileName);
|
||||
// The path and name of the downloaded zip file
|
||||
$temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl);
|
||||
|
||||
// Write the file content into a temporary directory and file
|
||||
if (file_put_contents($temporaryDownloadedZip, $getFileResponse->body) != false)
|
||||
{
|
||||
$zipArchive = new ZipArchive;
|
||||
|
||||
// Open and extract the dowloaded zip file into the directory of the output file
|
||||
if ($zipArchive->open($temporaryDownloadedZip) === true
|
||||
&& $zipArchive->extractTo($outputDirectory) === true
|
||||
&& $zipArchive->close() === true)
|
||||
{
|
||||
// Opened, extracted and closed!
|
||||
|
||||
// Rename the extracted file to the given output file name
|
||||
if (rename($outputDirectory.'/'.self::OUTPUT_FILENAME, $outputFileName))
|
||||
{
|
||||
$downloaded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while renaming the extracted file: '.
|
||||
$outputDirectory.'/'.self::OUTPUT_FILENAME.' into: '.
|
||||
$outputFileName
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while working the dowloaded zip file: '.
|
||||
$temporaryDownloadedZip
|
||||
);
|
||||
}
|
||||
}
|
||||
else // if an error occurred while writing
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while writing the file content to: '.
|
||||
$temporaryDownloadedZip
|
||||
);
|
||||
}
|
||||
}
|
||||
else // if the downloaded file is not valid
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while downloading the file from the docsbox server: '.
|
||||
print_r($getFileResponse, 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee)
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
return $downloaded;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,20 +14,28 @@ class DocumentLib
|
||||
// Gets CI instance
|
||||
$this->ci =& get_instance();
|
||||
|
||||
exec('unoconv --version', $ret_arr);
|
||||
|
||||
if(isset($ret_arr[0]))
|
||||
// Which document converter has to be used
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error('Could not get Unoconv Version');
|
||||
// Use docsbox!!
|
||||
}
|
||||
else
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
{
|
||||
exec('unoconv --version', $ret_arr);
|
||||
|
||||
if(isset($ret_arr[0]))
|
||||
{
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error('Could not get Unoconv Version');
|
||||
}
|
||||
else
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,9 +65,16 @@ class DocumentLib
|
||||
case 'application/vnd.ms-word':
|
||||
case 'application/vnd.oasis.opendocument.text':
|
||||
case 'text/plain':
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
// Use docsbox
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
}
|
||||
|
||||
$ret = $this->convert($filename, $outFile, 'pdf');
|
||||
if(isSuccess($ret))
|
||||
@@ -105,6 +120,7 @@ class DocumentLib
|
||||
|
||||
finfo_close($finfo);
|
||||
|
||||
$out = null;
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
@@ -123,13 +139,26 @@ class DocumentLib
|
||||
*/
|
||||
public function convert($inFile, $outFile, $format)
|
||||
{
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
$command = sprintf($command, $format, $outFile, $inFile);
|
||||
$ret = 0;
|
||||
|
||||
exec($command, $out, $ret);
|
||||
// If it is set to use docsbox
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php');
|
||||
|
||||
$ret = DocsboxLib::convert($inFile, $outFile, $format);
|
||||
}
|
||||
else // otherwise use unoconv
|
||||
{
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
$command = sprintf($command, $format, $outFile, $inFile);
|
||||
|
||||
$out = null;
|
||||
exec($command, $out, $ret);
|
||||
}
|
||||
|
||||
if ($ret != 0)
|
||||
{
|
||||
@@ -191,6 +220,7 @@ class DocumentLib
|
||||
$cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> ';
|
||||
$cmd .= 'setpagedevice viewJPEG"';
|
||||
|
||||
$out = null;
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
* Library to manage core extensions
|
||||
*/
|
||||
@@ -23,7 +41,7 @@ class ExtensionsLib
|
||||
|
||||
// Directories that are part of the extension archive
|
||||
private $SOFTLINK_TARGET_DIRECTORIES = array(
|
||||
APPPATH => array('config', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'),
|
||||
APPPATH => array('config', 'components', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'),
|
||||
DOC_ROOT => array('public')
|
||||
);
|
||||
|
||||
@@ -181,17 +199,15 @@ class ExtensionsLib
|
||||
// Select all the version of this extension
|
||||
$this->_ci->ExtensionsModel->addSelect('extension_id');
|
||||
$result = $this->_ci->ExtensionsModel->loadWhere(array('name' => $extensionName));
|
||||
if (hasData($result)) // if something was found
|
||||
// If something was found
|
||||
if (hasData($result))
|
||||
{
|
||||
$extsArray = array();
|
||||
foreach ($result->retval as $key => $extension) // loops on them
|
||||
// Loops on them
|
||||
foreach ($result->retval as $extension)
|
||||
{
|
||||
// Remove them all
|
||||
$result = $this->_ci->ExtensionsModel->delete($extension->extension_id);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$delExtension = true;
|
||||
}
|
||||
if (isSuccess($result)) $delExtension = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,9 +448,13 @@ class ExtensionsLib
|
||||
// If no errors occurred
|
||||
if ($extensionJson != null)
|
||||
{
|
||||
// Default value
|
||||
$fhcomplete_version = 0;
|
||||
|
||||
require_once('version.php'); // get the core version
|
||||
|
||||
// Checks if the required core version of the extension is the same of this system
|
||||
if (isset($extensionJson->core_version) && $extensionJson->core_version == $fhcomplete_version)
|
||||
if (isset($extensionJson->core_version) && version_compare($extensionJson->core_version, $fhcomplete_version,'<='))
|
||||
{
|
||||
$this->_printMessage('Required core version: '.$extensionJson->core_version);
|
||||
$this->_printMessage('Current core version: '.$fhcomplete_version);
|
||||
@@ -587,18 +607,22 @@ class ExtensionsLib
|
||||
for ($sqlDir = $startVersion; $sqlDir <= $extensionJson->version; $sqlDir++)
|
||||
{
|
||||
// If a directory with the same value of the version is present in the sql scripts directory
|
||||
if (($files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION)) != false)
|
||||
{
|
||||
$files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION);
|
||||
if ($files != false)
|
||||
{
|
||||
// Loads every sql files
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$sql = file_get_contents($file); // gets the entire content of the file
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$sql = file_get_contents($file); // gets the entire content of the file
|
||||
|
||||
$this->_printMessage('Executing query:');
|
||||
$this->_printMessage($sql);
|
||||
|
||||
// Try to execute that
|
||||
if (!isSuccess($result = @$this->_ci->ExtensionsModel->executeQuery($sql)))
|
||||
$resultQuery = @$this->_ci->ExtensionsModel->executeQuery($sql);
|
||||
|
||||
// If _not_ a success
|
||||
if (!isSuccess($resultQuery))
|
||||
{
|
||||
$this->_errorOccurred = true;
|
||||
$this->_printFailure(' error occurred while executing the query');
|
||||
@@ -608,11 +632,11 @@ class ExtensionsLib
|
||||
else
|
||||
{
|
||||
$this->_printMessage('Query result:');
|
||||
var_dump($result->retval); // KEEP IT!!!
|
||||
var_dump(getData($resultQuery)); // KEEP IT!!!
|
||||
$this->_ci->eprintflib->printEOL();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_printSuccess(!$this->_errorOccurred);
|
||||
@@ -673,7 +697,7 @@ class ExtensionsLib
|
||||
|
||||
foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories)
|
||||
{
|
||||
foreach ($targetDirectories as $key => $targetDirectory)
|
||||
foreach ($targetDirectories as $targetDirectory)
|
||||
{
|
||||
if (file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName))
|
||||
{
|
||||
@@ -727,7 +751,7 @@ class ExtensionsLib
|
||||
// For every target directory
|
||||
foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories)
|
||||
{
|
||||
foreach ($targetDirectories as $key => $targetDirectory)
|
||||
foreach ($targetDirectories as $targetDirectory)
|
||||
{
|
||||
// If destination of the symlink does not exist
|
||||
if (!file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -169,6 +169,9 @@ class IssuesLib
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Changes status of an issue.
|
||||
* @param int $issue_id
|
||||
@@ -215,8 +218,15 @@ class IssuesLib
|
||||
* @param string $inhalt_extern
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
{
|
||||
private function _addIssue(
|
||||
$fehlercode,
|
||||
$person_id = null,
|
||||
$oe_kurzbz = null,
|
||||
$fehlertext_params = null,
|
||||
$resolution_params = null,
|
||||
$fehlercode_extern = null,
|
||||
$inhalt_extern = null
|
||||
) {
|
||||
if (isEmptyString($person_id) && isEmptyString($oe_kurzbz))
|
||||
return error("Person_id or oe_kurzbz must be set.");
|
||||
|
||||
@@ -226,7 +236,15 @@ class IssuesLib
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlertextVorlage = getData($fehlerRes)[0]->fehlertext;
|
||||
$fehlertext = isEmptyArray($fehlertext_params) ? $fehlertextVorlage : vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
|
||||
$fehlertext = $fehlertextVorlage;
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
if (count($fehlertext_params) != substr_count($fehlertextVorlage, '%s'))
|
||||
return error('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehlercode);
|
||||
|
||||
$fehlertext = vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
}
|
||||
|
||||
$openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount($fehlercode, $person_id, $oe_kurzbz, $fehlercode_extern);
|
||||
|
||||
@@ -252,6 +270,7 @@ class IssuesLib
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
// insert new issue
|
||||
return $this->_ci->IssueModel->insert(
|
||||
array(
|
||||
'fehlercode' => $fehlercode,
|
||||
@@ -267,8 +286,8 @@ class IssuesLib
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
return success($openIssueCount);
|
||||
else // return success if issue already exists
|
||||
return success("Issue already exists");
|
||||
}
|
||||
else
|
||||
return error("Number of open issues could not be determined");
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
@@ -37,7 +53,7 @@ class NavigationLib
|
||||
// Loads library ExtensionsLib
|
||||
$this->_ci->load->library('ExtensionsLib');
|
||||
|
||||
$this->_navigationPage = $this->_getNavigationtPage($params); // sets the id for the related navigation widget
|
||||
$this->_navigationPage = $this->_getNavigationPage($params); // sets the id for the related navigation widget
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -67,9 +83,19 @@ class NavigationLib
|
||||
* Returns the structure for one level of the menu
|
||||
*/
|
||||
public function oneLevel(
|
||||
$description, $link = '#', $children = null, $icon = '', $expand = false,
|
||||
$subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null, $target = '',
|
||||
$sort = null, $requiredPermissions = null, $subscriptLinkHref = '#')
|
||||
$description,
|
||||
$link = '#',
|
||||
$children = null,
|
||||
$icon = '',
|
||||
$expand = false,
|
||||
$subscriptDescription = null,
|
||||
$subscriptLinkClass = null,
|
||||
$subscriptLinkValue = null,
|
||||
$target = '',
|
||||
$sort = null,
|
||||
$requiredPermissions = null,
|
||||
$subscriptLinkHref = '#'
|
||||
)
|
||||
{
|
||||
return array(
|
||||
'description' => $description,
|
||||
@@ -223,7 +249,8 @@ class NavigationLib
|
||||
$filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
|
||||
if (file_exists($filename))
|
||||
{
|
||||
unset($config);
|
||||
$config = array(); // default value
|
||||
|
||||
include($filename);
|
||||
|
||||
if (isset($config[$configName]) && is_array($config[$configName]))
|
||||
@@ -278,7 +305,7 @@ class NavigationLib
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($navigationArray as $key=>$row)
|
||||
foreach ($navigationArray as $key => $row)
|
||||
{
|
||||
// Search for * Entries
|
||||
if (mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1)
|
||||
@@ -300,7 +327,7 @@ class NavigationLib
|
||||
* Return an unique string that identify this navigation widget
|
||||
* NOTE: The default value is the URI where the NavigationWidget is called
|
||||
*/
|
||||
private function _getNavigationtPage($params)
|
||||
private function _getNavigationPage($params)
|
||||
{
|
||||
if ($params != null
|
||||
&& is_array($params)
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class SearchBarLib
|
||||
{
|
||||
// Error constats
|
||||
const ERROR_WRONG_JSON = 'ERR001';
|
||||
const ERROR_WRONG_SEARCHSTR = 'ERR002';
|
||||
const ERROR_NO_TYPES = 'ERR003';
|
||||
const ERROR_WRONG_TYPES = 'ERR004';
|
||||
|
||||
// List of allowed types of search
|
||||
const ALLOWED_TYPES = ['mitarbeiter', 'organisationunit', 'raum', 'person', 'student', 'prestudent', 'document', 'cms'];
|
||||
|
||||
const PHOTO_IMG_URL = '/cis/public/bild.php?src=person&person_id=';
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
|
||||
/**
|
||||
* Gets the CI instance and loads model
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// It is loaded only to have the DB_Model available
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* It performes the search of the given search string using the specified search types
|
||||
*/
|
||||
public function search($searchstr, $types)
|
||||
{
|
||||
// Checks if the given parameters are fine
|
||||
$search = $this->_checkParameters($searchstr, $types);
|
||||
|
||||
// If the check was successful then perform the search
|
||||
if (isSuccess($search)) $search = $this->_search($searchstr, $types);
|
||||
|
||||
return $search; // return the result
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Checks:
|
||||
* - The given searchstr is a not empty string
|
||||
* - The given types is a not empty array and contains allowed search types
|
||||
*/
|
||||
private function _checkParameters($searchstr, $types)
|
||||
{
|
||||
// If searchstr is empty
|
||||
if (isEmptyString($searchstr)) return error(self::ERROR_WRONG_SEARCHSTR);
|
||||
|
||||
// If types is not an array or it is empty
|
||||
if (isEmptyArray($types)) return error(self::ERROR_NO_TYPES);
|
||||
|
||||
// If all the elements in types are allowed search types
|
||||
if (!isEmptyArray(array_diff($types, self::ALLOWED_TYPES))) return error(self::ERROR_WRONG_TYPES);
|
||||
|
||||
return success(); // The check is fine!
|
||||
}
|
||||
|
||||
/**
|
||||
* Loops on types and perform the search of that type using searchstr
|
||||
* Then it collects all the returned data into an array as property of an object
|
||||
*/
|
||||
private function _search($searchstr, $types)
|
||||
{
|
||||
// Object to be returned
|
||||
$result = new stdClass();
|
||||
$result->data = array();
|
||||
|
||||
// For each search type
|
||||
foreach ($types as $type)
|
||||
{
|
||||
// Perform the search and then add the result to data
|
||||
$result->data = array_merge($result->data, $this->{'_'.$type}($searchstr, $type));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for employees
|
||||
*/
|
||||
private function _mitarbeiter($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$employees = $dbModel->execReadOnlyQuery('
|
||||
SELECT
|
||||
\''.$type.'\' AS type,
|
||||
b.uid AS uid,
|
||||
p.person_id AS person_id,
|
||||
p.vorname || \' \' || p.nachname AS name,
|
||||
ARRAY_AGG(DISTINCT(org.bezeichnung)) AS organisationunit_name,
|
||||
COALESCE(b.alias, b.uid) || \''.'@'.DOMAIN.'\' AS email,
|
||||
TRIM(COALESCE(k.kontakt, \'\') || \' \' || COALESCE(m.telefonklappe, \'\')) AS phone,
|
||||
\''.base_url(self::PHOTO_IMG_URL).'\' || p.person_id AS photo_url,
|
||||
ARRAY_AGG(DISTINCT(stdkst.bezeichnung)) AS standardkostenstelle
|
||||
FROM public.tbl_mitarbeiter m
|
||||
JOIN public.tbl_benutzer b ON(b.uid = m.mitarbeiter_uid)
|
||||
JOIN (
|
||||
SELECT o.bezeichnung, bf.uid
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
WHERE bf.funktion_kurzbz = \'kstzuordnung\'
|
||||
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
|
||||
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
|
||||
GROUP BY o.bezeichnung, bf.uid
|
||||
) stdkst ON stdkst.uid = b.uid
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
JOIN (
|
||||
SELECT o.bezeichnung, bf.uid
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
WHERE bf.funktion_kurzbz = \'oezuordnung\'
|
||||
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
|
||||
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
|
||||
GROUP BY o.bezeichnung, bf.uid
|
||||
) org ON org.uid = b.uid
|
||||
LEFT JOIN (
|
||||
SELECT kontakt, standort_id
|
||||
FROM public.tbl_kontakt
|
||||
WHERE kontakttyp = \'telefon\'
|
||||
) k ON(k.standort_id = m.standort_id)
|
||||
WHERE b.uid ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
OR p.vorname ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
OR p.nachname ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
OR org.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
OR stdkst.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
GROUP BY type, b.uid, p.person_id, name, email, m.telefonklappe, phone
|
||||
');
|
||||
|
||||
// If something has been found then return it
|
||||
if (hasData($employees)) return getData($employees);
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Seach for organisation units
|
||||
*/
|
||||
private function _organisationunit($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$ous = $dbModel->execReadOnlyQuery('
|
||||
SELECT
|
||||
\''.$type.'\' AS type,
|
||||
o.oe_kurzbz AS oe_kurzbz,
|
||||
o.bezeichnung AS name,
|
||||
oParent.oe_kurzbz AS parentoe_kurzbz,
|
||||
oParent.bezeichnung AS parentoe_name,
|
||||
ARRAY_AGG(DISTINCT(bfLeader.uid)) AS leader_uid,
|
||||
ARRAY_AGG(DISTINCT(bfLeader.vorname || \' \' || bfLeader.nachname)) AS leader_name,
|
||||
COUNT(bfCount.benutzerfunktion_id) AS number_of_people,
|
||||
(CASE WHEN o.mailverteiler = TRUE THEN o.oe_kurzbz || \''.'@'.DOMAIN.'\' END) AS mailgroup
|
||||
FROM public.tbl_organisationseinheit o
|
||||
LEFT JOIN public.tbl_organisationseinheit oParent ON(oParent.oe_kurzbz = o.oe_parent_kurzbz)
|
||||
LEFT JOIN (
|
||||
SELECT benutzerfunktion_id, oe_kurzbz
|
||||
FROM public.tbl_benutzerfunktion
|
||||
WHERE funktion_kurzbz = \'oezuordnung\'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
) bfCount ON(bfCount.oe_kurzbz = o.oe_kurzbz)
|
||||
LEFT JOIN (
|
||||
SELECT bf.oe_kurzbz, bf.uid, p.vorname, p.nachname
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_benutzer b USING(uid)
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
WHERE funktion_kurzbz = \'Leitung\'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND b.aktiv = TRUE
|
||||
) bfLeader ON(bfLeader.oe_kurzbz = o.oe_kurzbz)
|
||||
WHERE o.oe_kurzbz ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
OR o.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\'
|
||||
GROUP BY type, o.oe_kurzbz, o.bezeichnung, oParent.oe_kurzbz, oParent.bezeichnung
|
||||
');
|
||||
|
||||
// If something has been found
|
||||
if (hasData($ous))
|
||||
{
|
||||
// Loop through the returned dataset
|
||||
foreach (getData($ous) as $ou)
|
||||
{
|
||||
// Create the new property leaders as an empty array
|
||||
$ou->leaders = array();
|
||||
|
||||
// Loop through the found leaders for this organisation unit
|
||||
for ($i = 0; $i < count($ou->leader_uid); $i++)
|
||||
{
|
||||
// If a leader exists for this organisationunit and has a name :D
|
||||
if (!isEmptyString($ou->leader_uid[$i]) && !isEmptyString($ou->leader_name[$i]))
|
||||
{
|
||||
// Empty object that will contains the leader uid and name
|
||||
$leader = new stdClass();
|
||||
// Set the properties name and uid
|
||||
$leader->uid = $ou->leader_uid[$i];
|
||||
$leader->name = $ou->leader_name[$i];
|
||||
// Add the leader object to the leaders array
|
||||
$ou->leaders[] = $leader;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the not needed properties leader_uid and leader_name
|
||||
unset($ou->leader_uid);
|
||||
unset($ou->leader_name);
|
||||
}
|
||||
|
||||
// Returns the changed dataset
|
||||
return getData($ous);
|
||||
}
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for persons
|
||||
*/
|
||||
private function _person($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for students
|
||||
*/
|
||||
private function _student($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for prestudents
|
||||
*/
|
||||
private function _prestudent($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for documents
|
||||
*/
|
||||
private function _document($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for CMSs
|
||||
*/
|
||||
private function _cms($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for rooms
|
||||
*/
|
||||
private function _raum($searchstr, $type)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PlausicheckProducerLib
|
||||
{
|
||||
const CI_LIBRARY_PATH = 'application/libraries';
|
||||
const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks';
|
||||
const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck';
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_currentStudiensemester; // current Studiensemester
|
||||
|
||||
// set fehler which can be produced by the job
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
private $_fehlerLibMappings = array(
|
||||
'AbbrecherAktiv' => 'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt' => 'AbschlussstatusFehlt',
|
||||
'AktSemesterNull' => 'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus',
|
||||
'AktiverStudentstatusOhneKontobuchung' => 'AktiverStudentstatusOhneKontobuchung',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten',
|
||||
'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt' => 'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen' => 'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen' => 'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck' => 'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
|
||||
//'StudienplanUngueltig' => 'StudienplanUngueltig'
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// load models
|
||||
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// get current Studiensemester
|
||||
$studiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
if (hasData($studiensemesterRes)) $this->_currentStudiensemester = getData($studiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes check for a fehler_kurzbz, returns the result.
|
||||
* @param $fehler_kurzbz string
|
||||
* @param $studiensemester_kurzbz string optionally needed for issue production
|
||||
* @param $studiengang_kz int optionally needed for issue production
|
||||
*/
|
||||
public function producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
{
|
||||
$libName = $this->_fehlerLibMappings[$fehler_kurzbz];
|
||||
|
||||
// get Studiensemester
|
||||
if (isEmptyString($studiensemester_kurzbz)) $studiensemester_kurzbz = $this->_currentStudiensemester;
|
||||
|
||||
// get path of library for issue to be produced
|
||||
$issuesLibPath = DOC_ROOT . self::CI_LIBRARY_PATH . '/' . self::PLAUSI_ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = $issuesLibPath . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library(self::PLAUSI_ISSUES_FOLDER . '/'.$libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::EXECUTE_PLAUSI_CHECK_METHOD_NAME)))
|
||||
return error("Method " . self::EXECUTE_PLAUSI_CHECK_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
|
||||
// pass the data needed for issue check
|
||||
$paramsForCheck = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
);
|
||||
|
||||
// call the function for checking for issue production
|
||||
return $this->_ci->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}($paramsForCheck);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerKurzbz()
|
||||
{
|
||||
return array_keys($this->_fehlerLibMappings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AbbrecherAktiv extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbbrecherAktiv($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AbschlussstatusFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AktSemesterNull extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AktiverStudentOhneStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with negative or zero value.
|
||||
*/
|
||||
class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktiverStudentstatusOhneKontobuchung($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'status_ausbildungssemester' => $prestudent->status_ausbildungssemester,
|
||||
'student_ausbildungssemester' => $prestudent->student_ausbildungssemester,
|
||||
'student_uid' => $prestudent->student_uid,
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz,
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'abschlusspruefung_id' => $prestudent->abschlusspruefung_id
|
||||
),
|
||||
'resolution_params' => array('abschlusspruefung_id' => $prestudent->abschlusspruefung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumSponsionFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumSponsionFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'abschlusspruefung_id' => $prestudent->abschlusspruefung_id
|
||||
),
|
||||
'resolution_params' => array('abschlusspruefung_id' => $prestudent->abschlusspruefung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlHeimatadressen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlZustelladressen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class GbDatumWeitZurueck extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingHeimatNationOesterreich extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id, 'studiensemester_kurzbz' => $studiensemester_kurzbz)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'datum_bismeldung' => date_format(date_create($prestudent->datum_bismeldung), 'd.m.Y'),
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class NationNichtOesterreichAberGemeinde extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde($studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'fehlertext_params' => array('gemeinde' => $person->gemeinde, 'adresse_id' => $person->adresse_id),
|
||||
'resolution_params' => array('adresse_id' => $person->adresse_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'student_studiengang' => $prestudent->student_studiengang,
|
||||
'student_orgform' => $prestudent->student_orgform,
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class defining ressources and method to use for plausicheck issue producer
|
||||
*/
|
||||
abstract class PlausiChecker
|
||||
{
|
||||
protected $_ci; // code igniter instance
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// load libraries
|
||||
$this->_ci->load->library('issues/PlausicheckLib'); // load plausicheck library
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a plausi check.
|
||||
* @param $paramsForChecking array parameters needed for executing the check
|
||||
* @return array with objects which failed the plausi check
|
||||
*/
|
||||
abstract public function executePlausiCheck($paramsForChecking);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class PrestudentMischformOhneOrgform extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgPrestudentUngleichStgStudent extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgPrestudentUngleichStgStudienplan extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id, 'studienplan' => $prestudent->studienplan),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id, 'studienordnung_id' => $prestudent->studienordnung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StudentstatusNachAbbrecher extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StudienplanUngueltig extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudienplanUngueltig($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'studienplan' => $prestudent->studienplan,
|
||||
'ausbildungssemester' => $prestudent->ausbildungssemester,
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
-1
@@ -15,7 +15,6 @@ class CORE_INOUT_0006 implements IIssueResolvedChecker
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
//$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_erworben');
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_INOUT_0007 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
|
||||
return error('Person Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($params['studiensemester_kurzbz'], null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_INOUT_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming or external GS student should not be foerderrelevant.
|
||||
*/
|
||||
class CORE_INOUT_0009 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
|
||||
return error('Person Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
|
||||
return error('Person Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde(null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
|
||||
return error('Person Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
|
||||
return error('Person Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studienordnung_id']) || !is_numeric($params['studienordnung_id']))
|
||||
return error('Studienordnung Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan(null, $params['prestudent_id'], $params['studienordnung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbbrecherAktiv(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0006 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0007 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudienplanUngueltig($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0009 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0010 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['abschlusspruefung_id']) || !is_numeric($params['abschlusspruefung_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0011 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['abschlusspruefung_id']) || !is_numeric($params['abschlusspruefung_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumSponsionFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0012 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0013 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktSemesterNull($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0014 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with negative or zero value.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0015 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktiverStudentstatusOhneKontobuchung(
|
||||
$params['studiensemester_kurzbz'],
|
||||
null,
|
||||
$params['prestudent_id']
|
||||
);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2023 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use \stdClass as stdClass;
|
||||
use \DateTime as DateTime;
|
||||
|
||||
/**
|
||||
* Messages GUI logic
|
||||
@@ -27,6 +46,7 @@ class Messages_model extends CI_Model
|
||||
const TYPE_PRESTUDENTS = 'prestudents';
|
||||
|
||||
const ALT_OE = 'infocenter'; // alternative organisation unit when no one is found for a presetudent
|
||||
const SYSTEM_SENDER_NAME = 'System sender';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -50,7 +70,11 @@ class Messages_model extends CI_Model
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
// Loads model Benutzer_model
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
|
||||
// Loads model Studiengang_model
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
// Loads model Organisationseinheitsmodel
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -128,8 +152,8 @@ class Messages_model extends CI_Model
|
||||
{
|
||||
$ouOptions .= sprintf(
|
||||
"\n".'<option value="%s">%s</option>',
|
||||
is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE,
|
||||
$ou->bezeichnung . (is_numeric($ou->prestudent_id) ? '' : ' *')
|
||||
($ou->typ === 'l' ? $ou->oe_kurzbz : (is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE)),
|
||||
$ou->bezeichnung . ((is_numeric($ou->prestudent_id) || $ou->typ === 'l' ) ? '' : ' *')
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -201,12 +225,23 @@ class Messages_model extends CI_Model
|
||||
$jsonRecord->message_id = $receivedMessage->message_id;
|
||||
$jsonRecord->subject = $receivedMessage->subject;
|
||||
$jsonRecord->body = $receivedMessage->body;
|
||||
$jsonRecord->from = $receivedMessage->vorname.' '.$receivedMessage->nachname;
|
||||
$sentDate = new DateTime($receivedMessage->sent);
|
||||
$jsonRecord->sent = $sentDate->format('d/m/Y H:i:s');
|
||||
$jsonRecord->status = $receivedMessage->status;
|
||||
$jsonRecord->statusPersonId = $receivedMessage->statuspersonid;
|
||||
$jsonRecord->status = $receivedMessage->lastStatus;
|
||||
$jsonRecord->statusPersonId = $receivedMessage->senderPersonId;
|
||||
$jsonRecord->token = $receivedMessage->token;
|
||||
$jsonRecord->from = self::SYSTEM_SENDER_NAME; // default fallback
|
||||
|
||||
// If the sender id is the system sender then use the organisation unit
|
||||
if ($receivedMessage->senderPersonId == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
|
||||
{
|
||||
// If the oe exists
|
||||
if (!isEmptyString($receivedMessage->oe)) $jsonRecord->from = $receivedMessage->oe;
|
||||
}
|
||||
else // otherwise use the name and surname of the person sender
|
||||
{
|
||||
$jsonRecord->from = $receivedMessage->senderName.' '.$receivedMessage->senderSurname;
|
||||
}
|
||||
|
||||
$jsonArray[] = $jsonRecord;
|
||||
}
|
||||
@@ -240,17 +275,20 @@ class Messages_model extends CI_Model
|
||||
$jsonRecord->body = $sentMessage->body;
|
||||
$sentDate = new DateTime($sentMessage->sent);
|
||||
$jsonRecord->sent = $sentDate->format('d/m/Y H:i:s');
|
||||
$jsonRecord->status = $sentMessage->status;
|
||||
$jsonRecord->statusPersonId = $sentMessage->statuspersonid;
|
||||
$jsonRecord->status = $sentMessage->lastStatus;
|
||||
$jsonRecord->statusPersonId = $sentMessage->senderPersonId;
|
||||
$jsonRecord->token = $sentMessage->token;
|
||||
$jsonRecord->to = self::SYSTEM_SENDER_NAME; // default fallback
|
||||
|
||||
if ($sentMessage->person_id == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
|
||||
// If the recipient id is the system sender then use the organisation unit
|
||||
if ($sentMessage->recipientPersonId == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
|
||||
{
|
||||
$jsonRecord->to = $sentMessage->oe;
|
||||
// If the oe exists
|
||||
if (!isEmptyString($sentMessage->oe)) $jsonRecord->to = $sentMessage->oe;
|
||||
}
|
||||
else
|
||||
else // otherwise use the name and surname of the person recipient
|
||||
{
|
||||
$jsonRecord->to = $sentMessage->vorname.' '.$sentMessage->nachname;
|
||||
$jsonRecord->to = $sentMessage->recipientName.' '.$sentMessage->recipientSurname;
|
||||
}
|
||||
|
||||
$jsonArray[] = $jsonRecord;
|
||||
@@ -280,18 +318,42 @@ class Messages_model extends CI_Model
|
||||
$srmsbtResult = $this->MessageTokenModel->setReadMessageStatusByToken($token);
|
||||
if (isError($srmsbtResult)) show_error(getError($srmsbtResult));
|
||||
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($message->sender_id);
|
||||
if (isError($senderResult)) show_error(getError($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
// Sender name
|
||||
$sender = self::SYSTEM_SENDER_NAME; // default fallback
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
// If the sender is a person
|
||||
if ($message->sender_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
|
||||
{
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($message->sender_id);
|
||||
if (isError($senderResult)) show_error(getError($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
|
||||
// If the sender is not the system sender and the receiver is not the system sender
|
||||
// and are present configurations to reply
|
||||
$sender = getData($senderResult)[0]->vorname.' '.getData($senderResult)[0]->nachname;
|
||||
}
|
||||
else // otherwise if the sender is an organization unit (degree program)
|
||||
{
|
||||
// Looks into the degree programs
|
||||
$ouResult = $this->StudiengangModel->loadWhere(array('oe_kurzbz' => $message->oe_kurzbz));
|
||||
|
||||
if (isError($ouResult)) show_error(getError($ouResult));
|
||||
|
||||
// If not found here
|
||||
if (!hasData($ouResult))
|
||||
{
|
||||
// Then looks into the organisation units
|
||||
$ouResult = $this->OrganisationseinheitModel->loadWhere(array('oe_kurzbz' => $message->oe_kurzbz));
|
||||
|
||||
if (isError($ouResult)) show_error(getError($ouResult));
|
||||
}
|
||||
|
||||
// If found then set it, otherwise the fallback is used
|
||||
if (hasData($ouResult)) $sender = getData($ouResult)[0]->bezeichnung;
|
||||
}
|
||||
|
||||
// If the sender is not the system sender and configurations to reply exist
|
||||
$hrefReply = '';
|
||||
if ($message->sender_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
|
||||
&& $message->receiver_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
|
||||
&& !isEmptyString($this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL)))
|
||||
{
|
||||
$hrefReply = $this->config->item(MessageLib::CFG_MESSAGE_SERVER).
|
||||
@@ -407,7 +469,7 @@ class Messages_model extends CI_Model
|
||||
{
|
||||
// Merge receivers data with logged in user data
|
||||
$msgVarsDataArray = $this->_addMsgVarsDataOfLoggedInUser($receiver);
|
||||
|
||||
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)getData($msgVarsDataArray)[0]); // replaces array keys
|
||||
$parsedSubject = parseText($subject, $msgVarsDataArray);
|
||||
$parsedBody = parseText($body, $msgVarsDataArray);
|
||||
@@ -446,7 +508,7 @@ class Messages_model extends CI_Model
|
||||
|
||||
return success('Messages sent successfully');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper method for sendExplicitTemplateSenderId
|
||||
* The sender id is retrieved from the authentication session, if not present an error would be raised
|
||||
@@ -459,7 +521,7 @@ class Messages_model extends CI_Model
|
||||
|
||||
return $this->sendExplicitTemplateSenderId($sender_id, $prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a new message using the given template and information present in parameter prestudents
|
||||
* Extra variables can be added using parameter $msgVars
|
||||
@@ -472,28 +534,28 @@ class Messages_model extends CI_Model
|
||||
if (!hasData($msgVarsData)) show_error('No recipients were given');
|
||||
|
||||
$prestudentsData = $this->PrestudentModel->getOrganisationunits($prestudents);
|
||||
|
||||
|
||||
// Get the senders uid (if user is an active employee)
|
||||
$this->BenutzerModel->addSelect('uid');
|
||||
$this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ma.mitarbeiter_uid = uid');
|
||||
if (!$result = getData($this->BenutzerModel->getFromPersonId($sender_id)))
|
||||
{
|
||||
show_error('No sender_uid found');
|
||||
}
|
||||
$sender_uid = $result[0]->uid;
|
||||
$benutzerResult = $this->BenutzerModel->getFromPersonId($sender_id);
|
||||
if (isError($benutzerResult)) show_error(getError($benutzerResult));
|
||||
if (!hasData($benutzerResult)) show_error('No sender uid found');
|
||||
|
||||
$sender_uid = getData($benutzerResult)[0]->uid;
|
||||
|
||||
// Adds the organisation unit to each prestudent
|
||||
if (isEmptyString($oe_kurzbz) && hasData($msgVarsData) && hasData($prestudentsData))
|
||||
{
|
||||
$this->CLMessagesModel->_addOeToPrestudents($msgVarsData, $prestudentsData);
|
||||
$this->_addOeToPrestudents($msgVarsData, $prestudentsData);
|
||||
}
|
||||
|
||||
foreach (getData($msgVarsData) as $receiver)
|
||||
{
|
||||
/**
|
||||
* Merge receivers data with senders data
|
||||
* NOTE: _addMsgVarsDataOfLoggedInUser usually retrieves data of the logged in user that is set in the
|
||||
* templates user fields. As sendExplicitTemplateSenderId is run by a job, a sender uid is passed to be used
|
||||
* NOTE: _addMsgVarsDataOfLoggedInUser usually retrieves data of the logged in user that is set in the
|
||||
* templates user fields. As sendExplicitTemplateSenderId is run by a job, a sender uid is passed to be used
|
||||
* instead the logged in user.
|
||||
*/
|
||||
$msgVarsDataArray = $this->_addMsgVarsDataOfLoggedInUser($receiver, $sender_uid);
|
||||
@@ -540,8 +602,6 @@ class Messages_model extends CI_Model
|
||||
if (isError($senderResult)) show_error(getError($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
|
||||
$messageResult = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (isError($messageResult)) show_error(getError($messageResult));
|
||||
// Security check! It is possible to reply only to a received message!!
|
||||
@@ -636,7 +696,7 @@ class Messages_model extends CI_Model
|
||||
$parseMessageText = error('The given person_id is not a valid number');
|
||||
|
||||
if (is_numeric($person_id)) $parseMessageText = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
|
||||
|
||||
// Add message vars data of the logged in user
|
||||
$parseMessageText = $this->_addMsgVarsDataOfLoggedInUser($parseMessageText);
|
||||
|
||||
@@ -662,10 +722,10 @@ class Messages_model extends CI_Model
|
||||
$parseMessageText = error('The given prestudent_id is not a valid number');
|
||||
|
||||
if (is_numeric($prestudent_id)) $parseMessageText = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
|
||||
|
||||
// Add message vars data of the logged in user
|
||||
$parseMessageText = $this->_addMsgVarsDataOfLoggedInUser($parseMessageText);
|
||||
|
||||
|
||||
if (hasData($parseMessageText))
|
||||
{
|
||||
$parseMessageText = success(
|
||||
@@ -701,6 +761,17 @@ class Messages_model extends CI_Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the received and sent messages for the given person
|
||||
*/
|
||||
public function getReceivedAndSentMessages($person_id)
|
||||
{
|
||||
return $this->RecipientModel->getReceivedAndSentMessages(
|
||||
$person_id,
|
||||
$this->config->item(MessageLib::CFG_OU_RECEIVERS)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -771,7 +842,10 @@ class Messages_model extends CI_Model
|
||||
{
|
||||
return sprintf(
|
||||
self::REPLY_BODY_FORMAT,
|
||||
date_format(date_create($sentDate), 'd.m.Y H:i'), $receiverName, $receiverSurname, $body
|
||||
date_format(date_create($sentDate), 'd.m.Y H:i'),
|
||||
$receiverName,
|
||||
$receiverSurname,
|
||||
$body
|
||||
);
|
||||
}
|
||||
|
||||
@@ -875,14 +949,14 @@ class Messages_model extends CI_Model
|
||||
|
||||
$variables[] = $tmpVar;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves message vars of logged in user from database view vw_msg_vars_person
|
||||
$result = null;
|
||||
|
||||
|
||||
// If data contains a prestudent id
|
||||
$result = $this->messagelib->getMessageVarsLoggedInUser();
|
||||
|
||||
|
||||
if (isError($result)) show_error(getError($result));
|
||||
|
||||
// Then builds an array that contains objects with field name and field description of logged in user data
|
||||
@@ -892,7 +966,7 @@ class Messages_model extends CI_Model
|
||||
$obj = new stdClass();
|
||||
$obj->id = $id;
|
||||
$obj->description = $description;
|
||||
|
||||
|
||||
$user_fields[] = $obj;
|
||||
}
|
||||
|
||||
@@ -924,30 +998,32 @@ class Messages_model extends CI_Model
|
||||
'type' => $type
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds message vars data of the logged in user to the given object (that should also have message vars data)
|
||||
* @param object $otherMsgVarsDataObj Can be success object or simple object.
|
||||
* @return object Returns success object.
|
||||
*/
|
||||
public function _addMsgVarsDataOfLoggedInUser($otherMsgVarsDataObj, $uid = null)
|
||||
private function _addMsgVarsDataOfLoggedInUser($otherMsgVarsDataObj, $uid = null)
|
||||
{
|
||||
// First check if param type is object
|
||||
if (!is_object($otherMsgVarsDataObj)) show_error('Must pass an object to merge with data of logged in user');
|
||||
|
||||
|
||||
// If it is a return object, extract the simple data object
|
||||
if (isSuccess($otherMsgVarsDataObj))
|
||||
{
|
||||
$otherMsgVarsDataObj = getData($otherMsgVarsDataObj)[0];
|
||||
}
|
||||
|
||||
if (isSuccess($otherMsgVarsDataObj)) $otherMsgVarsDataObj = getData($otherMsgVarsDataObj)[0];
|
||||
|
||||
// Retrieve message vars data of the logged in user
|
||||
if (!$msgVarsDataLoggedInUser = getData($this->MessageModel->getMsgVarsDataByLoggedInUser($uid))[0])
|
||||
{
|
||||
return success($otherMsgVarsDataObj); // If failed, return at least given object as expected success object
|
||||
}
|
||||
|
||||
return success(array((object)(array_merge((array) $otherMsgVarsDataObj, (array) $msgVarsDataLoggedInUser))));
|
||||
|
||||
$msgVarsDataLoggedInUserResult = $this->MessageModel->getMsgVarsDataByLoggedInUser($uid);
|
||||
if (isError($msgVarsDataLoggedInUserResult)) show_error(getError($msgVarsDataLoggedInUserResult));
|
||||
|
||||
// If no data have been found return only the given otherMsgVarsDataObj
|
||||
if (!hasData($msgVarsDataLoggedInUserResult)) return success(array($otherMsgVarsDataObj));
|
||||
|
||||
// Otherwise get them...
|
||||
$msgVarsDataLoggedInUser = getData($this->MessageModel->getMsgVarsDataByLoggedInUser($uid))[0];
|
||||
|
||||
// ...and return them merged with the otherMsgVarsDataObj
|
||||
return success(array((object)(array_merge((array)$otherMsgVarsDataObj, (array)$msgVarsDataLoggedInUser))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class Akte_model extends DB_Model
|
||||
* @param bool $nachgereicht if true, retrieves only nachgereichte Dokumente. if false, only not nachgereichte. default: null, all Dokumente
|
||||
* @return array
|
||||
*/
|
||||
public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null)
|
||||
public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null, $archiv = null)
|
||||
{
|
||||
$this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung, bis.tbl_nation.*, ausstellungsdetails');
|
||||
$this->addJoin('public.tbl_dokument', 'dokument_kurzbz');
|
||||
@@ -184,6 +184,9 @@ class Akte_model extends DB_Model
|
||||
if(is_bool($nachgereicht))
|
||||
$where['nachgereicht'] = $nachgereicht;
|
||||
|
||||
if (is_bool($archiv))
|
||||
$where['archiv'] = $archiv;
|
||||
|
||||
$dokumente = $this->loadWhere($where);
|
||||
|
||||
if($dokumente->error) return $dokumente;
|
||||
|
||||
@@ -309,13 +309,39 @@ class Prestudent_model extends DB_Model
|
||||
*/
|
||||
public function getLastPrestudent($person_id, $withzgv = false)
|
||||
{
|
||||
$qry = 'SELECT * FROM public.tbl_prestudent
|
||||
WHERE person_id = ?
|
||||
$qry = 'SELECT * FROM public.tbl_prestudent ps
|
||||
%s
|
||||
WHERE ps.person_id = ?
|
||||
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
|
||||
LIMIT 1';
|
||||
|
||||
$zgvwhere = $withzgv === true ? 'AND zgv_code IS NOT NULL' : '';
|
||||
$zgvwhere = '';
|
||||
if ($withzgv === true)
|
||||
{
|
||||
$zgvwhere = '
|
||||
LEFT JOIN (
|
||||
SELECT ps2.zgvmas_code,
|
||||
ps2.zgvmanation,
|
||||
ps2.zgvmadatum,
|
||||
ps2.zgvmaort,
|
||||
ps2.zgvmas_erfuellt,
|
||||
ps2.person_id
|
||||
FROM tbl_prestudent ps2
|
||||
WHERE zgvmas_code IS NOT NULL
|
||||
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
|
||||
) zgvmas ON zgvmas.person_id = ps.person_id
|
||||
LEFT JOIN (
|
||||
SELECT ps2.zgv_code,
|
||||
ps2.zgvnation,
|
||||
ps2.zgvdatum,
|
||||
ps2.zgvort,
|
||||
ps2.zgv_erfuellt,
|
||||
ps2.person_id
|
||||
FROM tbl_prestudent ps2
|
||||
WHERE zgv_code IS NOT NULL
|
||||
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
|
||||
)zgv ON zgv.person_id = ps.person_id';
|
||||
}
|
||||
|
||||
$qry = sprintf($qry, $zgvwhere);
|
||||
|
||||
@@ -560,9 +586,10 @@ class Prestudent_model extends DB_Model
|
||||
o.bezeichnung,
|
||||
(CASE
|
||||
WHEN sg.typ = \'b\' THEN ps.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN ps.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN mps.prestudent_id
|
||||
ELSE NULL
|
||||
END) AS prestudent_id
|
||||
END) AS prestudent_id,
|
||||
sg.typ
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
@@ -571,11 +598,17 @@ class Prestudent_model extends DB_Model
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE status_kurzbz = \'Bewerber\'
|
||||
) ps USING(prestudent_id)
|
||||
LEFT JOIN (
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE status_kurzbz = \'Interessent\' AND bestaetigtam IS NOT NULL
|
||||
) mps ON p.prestudent_id = mps.prestudent_id
|
||||
WHERE p.person_id = ?
|
||||
GROUP BY o.oe_kurzbz,
|
||||
o.bezeichnung,
|
||||
sg.typ,
|
||||
ps.prestudent_id,
|
||||
mps.prestudent_id,
|
||||
p.prestudent_id
|
||||
ORDER BY o.bezeichnung';
|
||||
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class Reihungstest_model extends DB_Model
|
||||
{
|
||||
@@ -10,8 +26,8 @@ class Reihungstest_model extends DB_Model
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_reihungstest';
|
||||
$this->pk = 'reihungstest_id';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a test from a test id only if it is available
|
||||
*/
|
||||
@@ -35,15 +51,15 @@ class Reihungstest_model extends DB_Model
|
||||
WHERE rt_id = tbl_reihungstest.reihungstest_id
|
||||
) > 0
|
||||
AND reihungstest_id = ?';
|
||||
|
||||
|
||||
return $this->execQuery($query, array($reihungstest_id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if there are active studyplans which have no public placement tests assigned yet.
|
||||
* Only check assignment to studyplans that are
|
||||
* - Bachelor,
|
||||
* - active,
|
||||
* - Bachelor,
|
||||
* - active,
|
||||
* - set as online application
|
||||
* - valid for 1st terms
|
||||
* @return array Returns object array with studyplans that have no public placement tests assigned yet.
|
||||
@@ -51,20 +67,20 @@ class Reihungstest_model extends DB_Model
|
||||
public function checkMissingReihungstest()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
SELECT
|
||||
bezeichnung
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
WHERE
|
||||
studienplan_id
|
||||
IN
|
||||
IN
|
||||
(
|
||||
SELECT DISTINCT
|
||||
SELECT DISTINCT
|
||||
studienplan_id
|
||||
FROM
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
JOIN
|
||||
lehre.tbl_studienplan_semester
|
||||
lehre.tbl_studienplan_semester
|
||||
USING (studiensemester_kurzbz)
|
||||
JOIN
|
||||
lehre.tbl_studienplan
|
||||
@@ -81,31 +97,31 @@ class Reihungstest_model extends DB_Model
|
||||
tbl_studiensemester.onlinebewerbung = \'t\'
|
||||
AND
|
||||
tbl_studienplan.onlinebewerbung_studienplan = \'t\'
|
||||
AND
|
||||
AND
|
||||
semester = 1
|
||||
AND
|
||||
typ = \'b\'
|
||||
|
||||
EXCEPT
|
||||
|
||||
SELECT DISTINCT
|
||||
SELECT DISTINCT
|
||||
studienplan_id
|
||||
FROM
|
||||
public.tbl_reihungstest
|
||||
FROM
|
||||
public.tbl_reihungstest
|
||||
JOIN
|
||||
public.tbl_rt_studienplan
|
||||
USING (reihungstest_id)
|
||||
WHERE
|
||||
datum >= now()
|
||||
AND
|
||||
WHERE
|
||||
datum >= now()
|
||||
AND
|
||||
oeffentlich = \'t\'
|
||||
)
|
||||
';
|
||||
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Gets amount of free places.
|
||||
* @return array Returns object array with faculty and amount of free places
|
||||
* for each public actual placement test date.
|
||||
@@ -132,9 +148,9 @@ class Reihungstest_model extends DB_Model
|
||||
SELECT
|
||||
sum(arbeitsplaetze) - ceil(sum(arbeitsplaetze)/100.0*'. REIHUNGSTEST_ARBEITSPLAETZE_SCHWUND. ')
|
||||
FROM
|
||||
public.tbl_rt_ort
|
||||
public.tbl_rt_ort
|
||||
JOIN
|
||||
public.tbl_ort
|
||||
public.tbl_ort
|
||||
ON (tbl_rt_ort.ort_kurzbz = tbl_ort.ort_kurzbz)
|
||||
WHERE
|
||||
tbl_rt_ort.rt_id = tbl_reihungstest.reihungstest_id
|
||||
@@ -170,27 +186,27 @@ class Reihungstest_model extends DB_Model
|
||||
oe_kurzbz
|
||||
FROM
|
||||
public.tbl_rt_studienplan
|
||||
JOIN
|
||||
JOIN
|
||||
lehre.tbl_studienplan sp USING (studienplan_id)
|
||||
JOIN
|
||||
JOIN
|
||||
lehre.tbl_studienordnung USING (studienordnung_id)
|
||||
JOIN
|
||||
public.tbl_studiengang sg USING (studiengang_kz)
|
||||
WHERE
|
||||
tbl_rt_studienplan.reihungstest_id = tbl_reihungstest.reihungstest_id
|
||||
)
|
||||
AND
|
||||
AND
|
||||
aktiv = true
|
||||
|
||||
|
||||
UNION ALL
|
||||
|
||||
|
||||
SELECT
|
||||
o.oe_kurzbz, o.oe_parent_kurzbz, o.organisationseinheittyp_kurzbz
|
||||
FROM
|
||||
public.tbl_organisationseinheit o, meine_oes
|
||||
WHERE
|
||||
o.oe_kurzbz = meine_oes.oe_parent_kurzbz
|
||||
AND
|
||||
AND
|
||||
aktiv = true
|
||||
)
|
||||
SELECT
|
||||
@@ -207,7 +223,7 @@ class Reihungstest_model extends DB_Model
|
||||
JOIN
|
||||
public.tbl_studiengang
|
||||
USING (studiengang_kz)
|
||||
WHERE
|
||||
WHERE
|
||||
tbl_reihungstest.datum >= now()
|
||||
AND
|
||||
tbl_reihungstest.oeffentlich = \'t\'
|
||||
@@ -221,10 +237,10 @@ class Reihungstest_model extends DB_Model
|
||||
fakultaet,
|
||||
freie_plaetze
|
||||
';
|
||||
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if a registration date (Anmeldefrist) of a placement test has been reached yesterday.
|
||||
* @param integer $studiengang_kz Optional. Kennzahl of degree program whose registration date should be checked.
|
||||
@@ -239,9 +255,9 @@ class Reihungstest_model extends DB_Model
|
||||
SELECT CURRENT_DATE - 1
|
||||
)
|
||||
';
|
||||
|
||||
|
||||
$parametersArray = array();
|
||||
|
||||
|
||||
if (!isEmptyString($studiengang_kz))
|
||||
{
|
||||
$query .= ' AND studiengang_kz = ?';
|
||||
@@ -250,7 +266,7 @@ class Reihungstest_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads all applicants of a placement test for runZentraleReihungstestAnmeldefristAssistenzJob
|
||||
* @param integer $reihungstest_id ID of placement test
|
||||
@@ -326,11 +342,11 @@ class Reihungstest_model extends DB_Model
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
ORDER BY studiengang_kz,
|
||||
orgform_kurzbz,
|
||||
prioritaet,
|
||||
nachname,
|
||||
vorname,
|
||||
ORDER BY studiengang_kz,
|
||||
orgform_kurzbz,
|
||||
prioritaet,
|
||||
nachname,
|
||||
vorname,
|
||||
person_id
|
||||
';
|
||||
|
||||
@@ -432,43 +448,46 @@ class Reihungstest_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all applicants of a placement test
|
||||
* @param integer $reihungstest_id ID of placement test
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
* Loads all applicants of a placement test
|
||||
* @param integer $reihungstest_id ID of placement test
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
public function getApplicantsOfPlacementTest($reihungstest_id)
|
||||
{
|
||||
$query = '
|
||||
SELECT DISTINCT tbl_rt_person.person_id,
|
||||
anrede,
|
||||
nachname,
|
||||
vorname,
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
WHERE kontakttyp = \'email\'
|
||||
AND zustellung = true
|
||||
AND person_id = tbl_rt_person.person_id
|
||||
ORDER BY insertamum DESC,
|
||||
updateamum DESC LIMIT 1
|
||||
) AS "email",
|
||||
tbl_ort.planbezeichnung,
|
||||
tbl_ort.lageplan
|
||||
FROM PUBLIC.tbl_rt_person
|
||||
JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id)
|
||||
JOIN PUBLIC.tbl_reihungstest rt ON (rt_id = reihungstest_id)
|
||||
JOIN PUBLIC.tbl_prestudent ps ON (ps.person_id = tbl_rt_person.person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
LEFT JOIN bis.tbl_zgv ON (ps.zgv_code = tbl_zgv.zgv_code)
|
||||
LEFT JOIN PUBLIC.tbl_ort ON (tbl_rt_person.ort_kurzbz = tbl_ort.ort_kurzbz)
|
||||
WHERE rt_id = ?
|
||||
AND get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) = \'Interessent\'
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
ORDER BY nachname,
|
||||
vorname,
|
||||
person_id
|
||||
SELECT *
|
||||
FROM
|
||||
(SELECT DISTINCT tbl_rt_person.person_id, ps.prestudent_id, anrede, nachname, vorname,
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
WHERE kontakttyp = \'email\'
|
||||
AND zustellung = true
|
||||
AND person_id = tbl_rt_person.person_id
|
||||
ORDER BY insertamum DESC,
|
||||
updateamum DESC LIMIT 1
|
||||
) AS "email",
|
||||
tbl_ort.planbezeichnung,
|
||||
tbl_ort.lageplan,
|
||||
sg.oe_kurzbz,
|
||||
row_number () over (partition by tbl_rt_person.person_id order by ps.priorisierung) as row_number
|
||||
FROM PUBLIC.tbl_rt_person
|
||||
JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id)
|
||||
JOIN PUBLIC.tbl_reihungstest rt ON (rt_id = reihungstest_id)
|
||||
JOIN PUBLIC.tbl_prestudent ps ON (ps.person_id = tbl_rt_person.person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN PUBLIC.tbl_studiengang sg ON(sg.studiengang_kz = rt.studiengang_kz)
|
||||
LEFT JOIN bis.tbl_zgv ON (ps.zgv_code = tbl_zgv.zgv_code)
|
||||
LEFT JOIN PUBLIC.tbl_ort ON (tbl_rt_person.ort_kurzbz = tbl_ort.ort_kurzbz)
|
||||
WHERE rt_id = ?
|
||||
AND get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) = \'Interessent\'
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
ORDER BY nachname,
|
||||
vorname,
|
||||
person_id)
|
||||
temp where row_number = 1
|
||||
';
|
||||
|
||||
return $this->execQuery($query, array($reihungstest_id));
|
||||
@@ -511,4 +530,4 @@ class Reihungstest_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($date, $studiengang_kz));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
class Paabgabe_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -11,4 +10,24 @@ class Paabgabe_model extends DB_Model
|
||||
$this->dbTable = 'campus.tbl_paabgabe';
|
||||
$this->pk = 'paabgabe_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets last Endabgabe of a Projektarbeit, including filename.
|
||||
* @param int $projektarbeit_id
|
||||
* @return object
|
||||
*/
|
||||
public function getEndabgabe($projektarbeit_id)
|
||||
{
|
||||
$qry = "SELECT paabgabe_id, student_uid, paabg.datum, paabg.abgabedatum, projekttyp_kurzbz, titel, titel_english,
|
||||
paabgabe_id || '_' || student_uid || '.pdf' AS filename
|
||||
FROM campus.tbl_paabgabe paabg
|
||||
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
|
||||
WHERE projektarbeit_id = ?
|
||||
AND paabgabetyp_kurzbz = 'end'
|
||||
AND paabg.abgabedatum IS NOT NULL
|
||||
ORDER BY paabg.abgabedatum, paabg.datum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,18 +54,28 @@ class Projektbetreuer_model extends DB_Model
|
||||
$qry = "SELECT DISTINCT ON (pers.person_id) pers.person_id, betreuerart_kurzbz, vorname, nachname,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
anrede, titelpre, titelpost, gebdatum, geschlecht, pa.projekttyp_kurzbz,
|
||||
ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid
|
||||
FROM lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE ben.aktiv
|
||||
AND projektarbeit_id = ?
|
||||
AND betreuerart_kurzbz = ?
|
||||
ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/
|
||||
CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/
|
||||
ben.insertamum";
|
||||
ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid,
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM public.tbl_kontakt
|
||||
WHERE kontakttyp = 'email'
|
||||
AND person_id = pers.person_id
|
||||
ORDER BY
|
||||
CASE WHEN zustellung THEN 0 ELSE 1 END,
|
||||
insertamum DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) AS private_email
|
||||
FROM lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE (ben.aktiv OR ben.aktiv IS NULL)
|
||||
AND projektarbeit_id = ?
|
||||
AND betreuerart_kurzbz = ?
|
||||
ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/
|
||||
CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/
|
||||
ben.insertamum";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id, $betreuerart_kurzbz));
|
||||
}
|
||||
@@ -77,14 +87,14 @@ class Projektbetreuer_model extends DB_Model
|
||||
*/
|
||||
public function getBetreuerByToken($zugangstoken)
|
||||
{
|
||||
$qry = '
|
||||
$qry = "
|
||||
SELECT tbl_projektbetreuer.person_id, tbl_projektbetreuer.projektarbeit_id, student_uid
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
|
||||
WHERE zugangstoken = ? AND zugangstoken_gueltigbis >= NOW()
|
||||
ORDER BY tbl_projektbetreuer.insertamum DESC, projektarbeit_id DESC
|
||||
LIMIT 1
|
||||
';
|
||||
";
|
||||
|
||||
return $this->execQuery($qry, array($zugangstoken));
|
||||
}
|
||||
@@ -96,31 +106,60 @@ class Projektbetreuer_model extends DB_Model
|
||||
* @param $student_uid string uid des Studenten der Arbeit abgibt
|
||||
* @return object | bool
|
||||
*/
|
||||
public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid)
|
||||
public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid, $zweitbegutachter_person_id = null)
|
||||
{
|
||||
$qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum
|
||||
FROM lehre.tbl_projektbetreuer betr
|
||||
JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id
|
||||
JOIN public.tbl_person pers ON betr.person_id = pers.person_id
|
||||
LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true
|
||||
LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id
|
||||
LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end'
|
||||
WHERE betr.betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND betr.projektarbeit_id = ?
|
||||
AND parb.student_uid = ?
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Erstbegutachter'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)
|
||||
ORDER BY betr.insertamum DESC
|
||||
LIMIT 1";
|
||||
$params = array($erstbegutachter_person_id, $erstbegutachter_person_id, $projektarbeit_id, $student_uid);
|
||||
|
||||
return $this->execQuery($qry_betr, array($projektarbeit_id, $student_uid, $erstbegutachter_person_id));
|
||||
$qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, kontakt,
|
||||
abg.abgabedatum, betr.betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer betr
|
||||
JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id
|
||||
JOIN public.tbl_person pers ON betr.person_id = pers.person_id
|
||||
LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true
|
||||
LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id
|
||||
LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end'
|
||||
WHERE
|
||||
(
|
||||
(
|
||||
betr.betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Erstbegutachter'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
)
|
||||
OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */
|
||||
(
|
||||
betr.betreuerart_kurzbz = 'Senatsmitglied'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Senatsvorsitz'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
)
|
||||
)
|
||||
AND betr.projektarbeit_id = ?
|
||||
AND parb.student_uid = ?
|
||||
AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)";
|
||||
|
||||
if (isset($zweitbegutachter_person_id))
|
||||
{
|
||||
$qry_betr .= " AND betr.person_id = ?";
|
||||
$params[] = $zweitbegutachter_person_id;
|
||||
}
|
||||
|
||||
$qry_betr .= " ORDER BY betr.person_id DESC,
|
||||
(CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */
|
||||
SELECT 1 FROM public.tbl_mitarbeiter ma
|
||||
WHERE ma.mitarbeiter_uid = tbl_benutzer.uid
|
||||
) THEN 0 ELSE 1 END), betr.insertamum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry_betr, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,23 +170,23 @@ class Projektbetreuer_model extends DB_Model
|
||||
*/
|
||||
public function generateZweitbegutachterToken($zweitbegutachter_person_id, $projektarbeit_id)
|
||||
{
|
||||
$betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id
|
||||
$betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id, betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
WHERE projektarbeit_id = ?
|
||||
AND tbl_projektbetreuer.person_id = ?
|
||||
AND betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND betreuerart_kurzbz IN ('Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1";
|
||||
|
||||
$betreueruidres = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id));
|
||||
$betreueruidRes = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id));
|
||||
|
||||
if (!hasData($betreueruidres))
|
||||
if (!hasData($betreueruidRes))
|
||||
return error('Zweitbegutachter nicht gefunden');
|
||||
|
||||
$row_betr = getData($betreueruidres)[0];
|
||||
$zweitbetreuer = getData($betreueruidRes)[0];
|
||||
|
||||
if (!isset($row_betr->uid))
|
||||
if (!isset($zweitbetreuer->uid))
|
||||
{
|
||||
do {
|
||||
$token = generateToken(16);
|
||||
@@ -156,8 +195,8 @@ class Projektbetreuer_model extends DB_Model
|
||||
|
||||
$result = $this->update(
|
||||
array('projektarbeit_id' => $projektarbeit_id,
|
||||
'person_id' => $row_betr->person_id,
|
||||
'betreuerart_kurzbz' => 'Zweitbegutachter'),
|
||||
'person_id' => $zweitbetreuer->person_id,
|
||||
'betreuerart_kurzbz' => $zweitbetreuer->betreuerart_kurzbz),
|
||||
array('zugangstoken' => $token,
|
||||
'zugangstoken_gueltigbis' => date('Y-m-d', strtotime('+1 year')))
|
||||
);
|
||||
@@ -167,4 +206,29 @@ class Projektbetreuer_model extends DB_Model
|
||||
else
|
||||
return success("Account vorhanden, kein Token benötigt");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets betreuerart of a Betreuer for a Projektarbeit.
|
||||
* Main Betreuer are prioritized (normally one Betreuer should be assigned to a Projektarbeit another time with a different Betreuerart).
|
||||
* @param int projektarbeit_id
|
||||
* @param int betreuer_person_id
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getBetreuerart($projektarbeit_id, $betreuer_person_id)
|
||||
{
|
||||
$qry = "SELECT betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id = ?
|
||||
AND person_id = ?
|
||||
ORDER BY CASE WHEN betreuerart_kurzbz = 'Senatsvorsitz' THEN 1 /*Senatsvorsitz has priority*/
|
||||
WHEN betreuerart_kurzbz = 'Begutachter' THEN 2
|
||||
WHEN betreuerart_kurzbz = 'Erstbegutachter' THEN 3
|
||||
WHEN betreuerart_kurzbz = 'Zweitbegutachter' THEN 4
|
||||
WHEN betreuerart_kurzbz = 'Senatsmitglied' THEN 5
|
||||
ELSE 5
|
||||
END, insertamum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id, $betreuer_person_id));
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user