From ab59c265d46a2373f6a54abd62924b2ae9b5195c Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 4 Oct 2021 14:05:10 +0200 Subject: [PATCH 001/128] First commit --- include/Docsbox.php | 112 ++++++++++++++++++++++++++++++ include/dokument_export.class.php | 71 +++++++++---------- 2 files changed, 148 insertions(+), 35 deletions(-) create mode 100644 include/Docsbox.php diff --git a/include/Docsbox.php b/include/Docsbox.php new file mode 100644 index 000000000..08b04f71b --- /dev/null +++ b/include/Docsbox.php @@ -0,0 +1,112 @@ +attach(array('file' => $inputFileName)) + ->expectsJson() + ->send(); + + var_dump($response);exit; + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + if (is_object($response) && isset($response->id) && isset($response->status)) + { + $status = null; + $result_url = null; + + while ($status == null) + { + try + { + $response = \Httpful\Request::get('http://docconverter.technikum-wien.at/api/v1/'.$response->id) + ->expectsJson() + ->send(); + + var_dump($response); + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + if (is_object($response) && isset($response->id) && isset($response->status)) + { + if ($response->status == 'finished' && isset($response->result_url)) + { + $status = $response->status; + $result_url = $response->result_url; + } + else + { + // Error + } + } + else + { + // Error + } + } + + try + { + $response = \Httpful\Request::get($result_url)->send(); + + var_dump($response); + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + var_dump($response);exit; + } + else + { + // Error + } + } +} + diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index 4f23a7dcd..30af55ac6 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -37,7 +37,6 @@ class dokument_export private $images=array(); private $sourceDir; public $errormsg; - private $unoconv_version; private $sign; private $sign_user; private $sign_profile; @@ -50,18 +49,6 @@ class dokument_export if(!isset($vorlage)) return; - 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 - die('Could not get Unoconv Version'); - } - else - die('Unoconv not found'); - //Vorlage aus der Datenbank holen $this->vorlage = new vorlage(); if(!$this->vorlage->getAktuelleVorlage($oe_kurzbz, $vorlage, $version)) @@ -281,20 +268,27 @@ class dokument_export // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt // werden. Deshalb wird dies hier speziell behandelt. // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist - if($this->unoconv_version=='0.6') - $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; - else - $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; + //if($this->unoconv_version=='0.6') + // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; + //else + // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; - $command = sprintf($command, $this->temp_filename, $tempname_zip); + //$command = sprintf($command, $this->temp_filename, $tempname_zip); - exec($command, $out, $ret); + //exec($command, $out, $ret); - if($ret!=0) - { - $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - return false; - } + require_once('Docsbox.php'); + + var_dump($tempname_zip); + var_dump($this->temp_filename); + + Docsbox::convert($tempname_zip, $this->temp_filename); + + //if($ret!=0) + //{ + // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + // return false; + //} break; case 'odt': default: @@ -455,19 +449,26 @@ class dokument_export */ public function convert($inFile, $outFile, $format = "pdf") { - 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); + //require_once('Docsbox.php'); - exec($command, $out, $ret); + //var_dump($inFile); + //var_dump($outFile); - if($ret!=0) - { - $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - return false; - } + //Docsbox::convert(); + + //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); + + //exec($command, $out, $ret); + + //if($ret!=0) + //{ + // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + // return false; + //} return true; } From 2fb4be0e5548b662085b56a4eedbfc0d5622d153 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 14 Oct 2021 11:34:27 +0200 Subject: [PATCH 002/128] - Added new config entry DOCSBOX_ENABLED to config/global.config-default.inc.php - Added new library application/libraries/DocsboxLib.php to manage document conversion using docsbox - Added new config file application/config/docsbox.php - Integrated DocsboxLib into include/dokument_export.class.php --- application/config/docsbox.php | 7 + application/libraries/DocsboxLib.php | 297 +++++++++++++++++++++++++++ config/global.config-default.inc.php | 3 + include/Docsbox.php | 112 ---------- include/dokument_export.class.php | 101 +++++---- 5 files changed, 372 insertions(+), 148 deletions(-) create mode 100644 application/config/docsbox.php create mode 100644 application/libraries/DocsboxLib.php delete mode 100644 include/Docsbox.php diff --git a/application/config/docsbox.php b/application/config/docsbox.php new file mode 100644 index 000000000..ca64698f9 --- /dev/null +++ b/application/config/docsbox.php @@ -0,0 +1,7 @@ +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; + } +} + diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php index b31447994..f4909ba5c 100644 --- a/config/global.config-default.inc.php +++ b/config/global.config-default.inc.php @@ -310,4 +310,7 @@ define ('ZAHLUNGSBESTAETIGUNG_ANZEIGEN_FUER_LEHRGAENGE', true); // Gibt an, ob im CIS die Zahlungsreferenz angezeigt wird define ('ZAHLUNGSBESTAETIGUNG_ZAHLUNGSREFERENZ_ANZEIGEN', false); + +define('DOCSBOX_ENABLED', false); + ?> diff --git a/include/Docsbox.php b/include/Docsbox.php deleted file mode 100644 index 08b04f71b..000000000 --- a/include/Docsbox.php +++ /dev/null @@ -1,112 +0,0 @@ -attach(array('file' => $inputFileName)) - ->expectsJson() - ->send(); - - var_dump($response);exit; - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - if (is_object($response) && isset($response->id) && isset($response->status)) - { - $status = null; - $result_url = null; - - while ($status == null) - { - try - { - $response = \Httpful\Request::get('http://docconverter.technikum-wien.at/api/v1/'.$response->id) - ->expectsJson() - ->send(); - - var_dump($response); - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - if (is_object($response) && isset($response->id) && isset($response->status)) - { - if ($response->status == 'finished' && isset($response->result_url)) - { - $status = $response->status; - $result_url = $response->result_url; - } - else - { - // Error - } - } - else - { - // Error - } - } - - try - { - $response = \Httpful\Request::get($result_url)->send(); - - var_dump($response); - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - var_dump($response);exit; - } - else - { - // Error - } - } -} - diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index 30af55ac6..c6c609ce9 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -37,6 +37,7 @@ class dokument_export private $images=array(); private $sourceDir; public $errormsg; + private $unoconv_version; private $sign; private $sign_user; private $sign_profile; @@ -49,6 +50,25 @@ class dokument_export if(!isset($vorlage)) return; + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + // Use docsbox!! + } + else + { + 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 + die('Could not get Unoconv Version'); + } + else + die('Unoconv not found'); + } + //Vorlage aus der Datenbank holen $this->vorlage = new vorlage(); if(!$this->vorlage->getAktuelleVorlage($oe_kurzbz, $vorlage, $version)) @@ -263,32 +283,36 @@ class dokument_export { case 'pdf': case 'doc': + $ret = 0; $this->temp_filename = $this->temp_folder . '/out.' . $this->outputformat; - // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt - // werden. Deshalb wird dies hier speziell behandelt. - // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist - //if($this->unoconv_version=='0.6') - // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; - //else - // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; + // If it is set to use docsbox + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - //$command = sprintf($command, $this->temp_filename, $tempname_zip); + $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename); + } + else // otherwise use unoconv + { + // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt + // werden. Deshalb wird dies hier speziell behandelt. + // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist + if ($this->unoconv_version == '0.6') + $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; + else + $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; - //exec($command, $out, $ret); + $command = sprintf($command, $this->temp_filename, $tempname_zip); - require_once('Docsbox.php'); + exec($command, $out, $ret); + } - var_dump($tempname_zip); - var_dump($this->temp_filename); - - Docsbox::convert($tempname_zip, $this->temp_filename); - - //if($ret!=0) - //{ - // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - // return false; - //} + if ($ret != 0) + { + $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + return false; + } break; case 'odt': default: @@ -449,26 +473,31 @@ class dokument_export */ public function convert($inFile, $outFile, $format = "pdf") { - //require_once('Docsbox.php'); + $ret = 0; - //var_dump($inFile); - //var_dump($outFile); + // If it is set to use DOCSBOX + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - //Docsbox::convert(); + $ret = DocsboxLib::convert($inFile, $outFile); + } + else // fallback to 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); - //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); + exec($command, $out, $ret); + } - //exec($command, $out, $ret); - - //if($ret!=0) - //{ - // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - // return false; - //} + if ($ret != 0) + { + $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + return false; + } return true; } From 6f14b5cec599f881a75d35c85ce9c6079c24009d Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 14 Oct 2021 14:25:35 +0200 Subject: [PATCH 003/128] - Changed DocsboxLib->convert, not it accepts a new optional parameter called format - Integrated the DocsboxLib into the application/libraries/DocumentLib.php --- application/libraries/DocsboxLib.php | 3 +- application/libraries/DocumentLib.php | 66 +++++++++++++++++++-------- 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index 2b0715513..ce43f1bc5 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -39,8 +39,9 @@ class DocsboxLib /** * 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) + public static function convert($inputFileName, $outputFileName, $format = 'pdf') { // Posts the file to docsbox $queueId = self::_postFile($inputFileName); diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index 98e546b4e..d78a9c0df 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -14,20 +14,27 @@ class DocumentLib // Gets CI instance $this->ci =& get_instance(); - exec('unoconv --version', $ret_arr); - - if(isset($ret_arr[0])) + 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 +64,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)) @@ -123,13 +137,25 @@ 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); + + exec($command, $out, $ret); + } if ($ret != 0) { From db49f2b1e77248328388213bea238a0b5956966f Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 4 Mar 2022 19:47:32 +0100 Subject: [PATCH 004/128] - libraries/DocsboxLib: - Added new constant DEFAULT_FORMAT - ERROR and SUCCESS constant values are the same of EXIT_ERROR and EXIT_SUCCESS - public method convert parameter format does not have a default value anymore - Added use import of ZipArchive - libraries/DocumentLib: removed unused variables --- application/libraries/DocsboxLib.php | 23 +++++++++++++++-------- application/libraries/DocumentLib.php | 7 ++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index ce43f1bc5..5ec028a49 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -1,11 +1,11 @@ body != '') { // Output directory where to unzip the downloaded zip file - $outputDirectory = dirname($outputFileName); + $outputDirectory = dirname($outputFileName); // The path and name of the downloaded zip file $temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl); diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index d78a9c0df..eec3b6938 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -14,6 +14,7 @@ class DocumentLib // Gets CI instance $this->ci =& get_instance(); + // Which document converter has to be used if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) { // Use docsbox!! @@ -119,7 +120,7 @@ class DocumentLib finfo_close($finfo); - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator'); @@ -154,7 +155,7 @@ class DocumentLib $command = 'unoconv -f %s --output %s %s 2>&1'; $command = sprintf($command, $format, $outFile, $inFile); - exec($command, $out, $ret); + exec($command, null, $ret); } if ($ret != 0) @@ -217,7 +218,7 @@ class DocumentLib $cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> '; $cmd .= 'setpagedevice viewJPEG"'; - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { $this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator'; From e50cc27a89f4bbdfc7d9192f215504d4e50b6068 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 4 Mar 2022 20:13:03 +0100 Subject: [PATCH 005/128] Fixed exec second parameter value --- application/libraries/DocumentLib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index eec3b6938..c1dd21c29 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -120,7 +120,8 @@ class DocumentLib finfo_close($finfo); - exec($cmd, null, $ret); + $out = null; + exec($cmd, $out, $ret); if ($ret != 0) { return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator'); @@ -155,7 +156,8 @@ class DocumentLib $command = 'unoconv -f %s --output %s %s 2>&1'; $command = sprintf($command, $format, $outFile, $inFile); - exec($command, null, $ret); + $out = null; + exec($command, $out, $ret); } if ($ret != 0) @@ -218,7 +220,8 @@ class DocumentLib $cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> '; $cmd .= 'setpagedevice viewJPEG"'; - exec($cmd, null, $ret); + $out = null; + exec($cmd, $out, $ret); if ($ret != 0) { $this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator'; From 6d1c926ec0eb22d7cea95e20b508a98d9b8018d8 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 29 Mar 2022 13:56:00 +0200 Subject: [PATCH 006/128] Anzeige AllinSaldo in Zeitaufzeichnung --- cis/private/tools/zeitaufzeichnung.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index ba57b442f..74c2678bc 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -1379,7 +1379,8 @@ if ($projekt->getProjekteMitarbeiter($user, true)) } } echo ''; - echo '

'; + echo '
'; + echo '

'; if (!$adminView) { From 9bf20dd7a41d4667bb208cfa501bd660e6a0efcb Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 28 Apr 2022 07:54:43 +0200 Subject: [PATCH 007/128] neue Funktion: getLastVerwendungZapflicht --- include/bisverwendung.class.php | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index ce6a557b1..afcc271f8 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -865,5 +865,68 @@ class bisverwendung extends basis_db return false; } } + + /** + * Lädt die letzte zeitaufzeichnungspflichtige Bisverwendung + * @param $uid UID des Mitarbeiters + * @return true wenn ok, false wenn Fehler + */ + public function getLastBisZAPflicht($uid) + { + $datetime = new DateTime($stichtag); + $stichtag = $datetime->format('Y-m-d'); + $bismeldung_jahr = $datetime->format('Y'); + + $qry = ' + SELECT + * + FROM + bis.tbl_bisverwendung + WHERE + mitarbeiter_uid = '. $this->db_add_param($uid).' + AND + zeitaufzeichnungspflichtig = true + ORDER BY ende DESC NULLS FIRST LIMIT 1 + '; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + + $obj = new bisverwendung(); + + $obj->bisverwendung_id = $row->bisverwendung_id; + $obj->ba1code = $row->ba1code; + $obj->ba2code = $row->ba2code; + $obj->beschausmasscode = $row->beschausmasscode; + $obj->verwendung_code = $row->verwendung_code; + $obj->hauptberufcode = $row->hauptberufcode; + $obj->hauptberuflich = $row->hauptberuflich; + $obj->habilitation = $row->habilitation; + $obj->beginn = $row->beginn; + $obj->ende = $row->ende; + $obj->updatevon = $row->updatevon; + $obj->updateamum = $row->updateamum; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->vertragsstunden = $row->vertragsstunden; + $obj->dv_art = $row->dv_art; + $obj->inkludierte_lehre = $row->inkludierte_lehre; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler bei der Datenbankabfrage'; + return false; + } + } + + } ?> From b6cc084799e0bf6fd2fdcc55019b4963e6683365 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 28 Apr 2022 11:46:45 +0200 Subject: [PATCH 008/128] Adaptierung Funktion getLastBisZAPflicht() --- include/bisverwendung.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index afcc271f8..e5314963b 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -873,10 +873,6 @@ class bisverwendung extends basis_db */ public function getLastBisZAPflicht($uid) { - $datetime = new DateTime($stichtag); - $stichtag = $datetime->format('Y-m-d'); - $bismeldung_jahr = $datetime->format('Y'); - $qry = ' SELECT * From d7e4d7ebde5f0eeedb89ea56183b6ea45ffe093a Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 3 May 2022 10:58:46 +0200 Subject: [PATCH 009/128] Moved config entries from application/config/docsbox.php to config/cis.config-default.inc.php and config/vilesci.config-default.inc.php --- application/config/docsbox.php | 7 ------- application/libraries/DocsboxLib.php | 3 +-- config/cis.config-default.inc.php | 8 ++++++++ config/vilesci.config-default.inc.php | 8 ++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) delete mode 100644 application/config/docsbox.php diff --git a/application/config/docsbox.php b/application/config/docsbox.php deleted file mode 100644 index ca64698f9..000000000 --- a/application/config/docsbox.php +++ /dev/null @@ -1,7 +0,0 @@ - + diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index cd45e6979..b1340fbfb 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -254,4 +254,12 @@ define('BIS_STANDORTCODE_LEHRGAENGE', '0'); // bPk Abfrage define('BPK_FUER_ALLE_BENUTZER_ABFRAGEN', false); + +// Docsbox configs +define('DOCSBOX_SERVER', 'http://docconverter.technikum-wien.at/'); +define('DOCSBOX_PATH_API', 'api/v1/'); +define('DOCSBOX_CONVERSION_TIMEOUT', 30); // seconds +define('DOCSBOX_WAITING_SLEEP_TIME', 1); + ?> + From 58d252b5b7d2e5a87c4b1db7a6fa8e00c4472eeb Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 6 May 2022 09:57:55 +0200 Subject: [PATCH 010/128] Added 3rd parameter to Docsbox::convert call were missing --- include/dokument_export.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index c6c609ce9..0d4f2c660 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -291,7 +291,7 @@ class dokument_export { require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename); + $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename, $this->outputformat); } else // otherwise use unoconv { @@ -480,7 +480,7 @@ class dokument_export { require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - $ret = DocsboxLib::convert($inFile, $outFile); + $ret = DocsboxLib::convert($inFile, $outFile, $format); } else // fallback to unoconv { From 704b32c76c4aba195389561cb8255c592ba2c1d7 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 11 May 2022 11:06:53 +0200 Subject: [PATCH 011/128] Fixed constant values in application/libraries/DocsboxLib.php --- application/libraries/DocsboxLib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index 7d5af7106..f9167c379 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -26,8 +26,8 @@ use \ZipArchive as ZipArchive; */ class DocsboxLib { - const ERROR = EXIT_ERROR; - const SUCCESS = EXIT_SUCCESS; + 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 From c87aee0ddf226a6f91ae842c603eb9e007b0ec22 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 24 Jun 2022 08:10:51 +0200 Subject: [PATCH 012/128] Zeitsperre Umbau Mail auf Sanchomail, Anzeige Zeitsaldo in Sanchomail, Adpatierungen Urlaub --- cis/private/profile/zeitsperre_resturlaub.php | 210 ++++++++++++++++-- include/zeitsperre.class.php | 49 +++- locale/de-AT/urlaubstool.php | 7 +- locale/en-US/urlaubstool.php | 7 + 4 files changed, 249 insertions(+), 24 deletions(-) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 8e449b12d..b5118dce4 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -31,6 +31,7 @@ require_once('../../../include/person.class.php'); require_once('../../../include/benutzer.class.php'); require_once('../../../include/mitarbeiter.class.php'); require_once('../../../include/mail.class.php'); +require_once('../../../include/sancho.inc.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/phrasen.class.php'); require_once('../../../include/zeitaufzeichnung.class.php'); @@ -65,6 +66,7 @@ if(isset($_GET['uid'])) die($p->t('global/FuerDieseAktionBenoetigenSieAdministrationsrechte')); } } + $datum_obj = new datum(); $ma= new mitarbeiter(); @@ -119,7 +121,8 @@ $( document ).ready(function() { for(i in addon) { - addon[i].init("cis/private/profile/zeitsperre_resturlaub.php", {uid:\''.$uid.'\', holiDays: holiDays}); + + addon[i].init("cis/private/profile/zeitsperre_resturlaub.php", {uid:\''.$uid.'\', holiDays: holiDays}); } } @@ -158,6 +161,63 @@ $( document ).ready(function() } return [true, ""]; } + +function AddonCaseTimeLoadZeitsaldo(uid) +{ + $.ajax({ + type: "GET", + dataType: "json", + url: "'.APP_ROOT.'/addons/casetime/vilesci/zeitsaldo.php?uid="+uid, + success: function (result) + { + if (result===false) + { + $("#zeitsaldo").html("error"); + } + else + { + var DatumAktuell = new Date(); + //var DatumAktuell = new Date(2016,0,11); + var MonatAktuell = DatumAktuell.getMonth()+1; + var MonatLetztes = MonatAktuell - 1; + var JahrAktuell = DatumAktuell.getFullYear(); + var JahrLetztes = DatumAktuell.getFullYear(); + var VorJahr = JahrAktuell -1; + if (MonatLetztes == 0) + { + MonatLetztes = 12; + JahrLetztes = JahrAktuell - 1; + } + var MonatVorLetztes = MonatLetztes -1; + var JahrVorLetztes = JahrLetztes; + if (MonatVorLetztes == 0) + { + MonatVorLetztes = 12; + JahrVorLetztes = JahrLetztes -1; + } + + + var zahl = parseFloat(result); + if (zahl > 0) + var faktor = 1; + else + var faktor = -1; + zahl = zahl * faktor; + var std = Math.floor(zahl); + var min = (zahl-Math.floor(zahl))*60; + min = Math.round(min); + var std_anzeigealt = std+"h:"+min+"m"; + + $(\'input[name="zeitsaldo"]\').val("Aktueller Stundensaldo: "+result +" Stunden ("+std_anzeigealt+")"); + + } + }, + error: function(){ + alert("Error Casetime Load"); + } + }); +} + '; ?> @@ -339,12 +399,16 @@ function showHideStudeDropDown() updateamum = date('Y-m-d H:i:s'); $zeitsperre->updatevon = $uid; + // Zeitsperretyp Beschreibung + $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); + $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; + if($zeitsperre->save()) { echo "

".$p->t('global/erfolgreichgespeichert')."

"; if(URLAUB_TOOLS) { - if($zeitsperre->new && $zeitsperre->zeitsperretyp_kurzbz=='Urlaub') + //Beim Anlegen von neuen Urlauben oder neuem Zeitausgleich wird ein Mail an den Vorgesetzten versendet + if($zeitsperre->new && ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub' || $zeitsperre->zeitsperretyp_kurzbz == 'ZA') + || !$zeitsperre->new && $zeitsperre->zeitsperretyp_kurzbz == 'ZA') { //Beim Anlegen von neuen Urlauben wird ein Mail an den Vorgesetzten versendet um diesen Freizugeben $prsn = new person(); - $vorgesetzter = $ma->getVorgesetzte($uid); + $vorgesetzter = $ma->getVorgesetzte($uid); + if($vorgesetzter) { $to=''; @@ -536,16 +607,73 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_ else $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y'); - $message = "Dies ist eine automatische Mail! \n". - "$benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:\n". - "$zeitsperre->bezeichnung von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y')." bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y')."\n\n". - "Sie können diesen unter folgender Adresse freigeben:\n". - APP_ROOT."cis/private/profile/urlaubsfreigabe.php?uid=$uid&year=".$jahr; - $from='vilesci@'.DOMAIN; - $mail = new mail($to, $from, 'Freigabeansuchen', $message); - if($mail->send()) + // Wenn ein neuer Urlaub eingetragen wurde, Freigabemail-Text + if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { - echo "
".$p->t('urlaubstool/freigabemailWurdeVersandt',array($fullName)).""; + if ($zeitsperre->new) + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'). + ".
Sie können diesen unter folgender Adresse freigeben:

". + " Link Urlaubstool "; + + $subject = "Freigabeansuchen"; + + $zeitsaldo = ''; + } + + } + + // Wenn ein Zeitausgleich eingetragen wurde... + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + // ...Mail-Text für neuen Zeitausgleich + if ($zeitsperre->new) + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Zeitausgleich eingetragen:
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $p->t('urlaubstool/zeitausgleichNeu'); + } + // ...Mail-Text für geaenderten Zeitausgleich + else + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat den Zeitausgleich wie folgt geändert:
" ; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $subject = $p->t('urlaubstool/zeitausgleichGeaendert'); + } + } + + $from='vilesci@'.DOMAIN; + + //Sanchomail mit Vorlage Sancho Mail Zeitausgleich + $template_data = array( + 'vorgesetzter' => $fullName, + 'textZeitausgleich' => $mailSancho, + 'Saldo'=> $zeitsaldo + ); + + if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + { + if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') + { + echo "
". $p->t('urlaubstool/freigabemailWurdeVersandt', array($fullName)). ""; + } + + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + echo "
". $p->t('urlaubstool/VorgesetzteInformiert', array($fullName)). ""; + } } else { @@ -572,9 +700,13 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $zeitsperre = new zeitsperre(); $zeitsperre->load($_GET['id']); + $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); + $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; + $vondatum = $zeitsperre->getVonDatum(); $bisdatum = $zeitsperre->getBisDatum(); + if(!$zeitsperre->delete($_GET['id'])) echo $zeitsperre->errormsg; @@ -604,16 +736,43 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $benutzer = new benutzer(); $benutzer->load($uid); - $message = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n". - $p->t('urlaubstool/xHatUrlaubGeloescht',array($benutzer->nachname,$benutzer->vorname)).":\n"; + + if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') + { + $mailSancho = $p->t('urlaubstool/xHatUrlaubGeloescht', array($benutzer->nachname, $benutzer->vorname)).":
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + // $subject = $p->t('urlaubstool/freigegebenerUrlaubGeloescht'); + $subject = $p->t('urlaubstool/UrlaubGeloescht'); - $message.= $p->t('urlaubstool/von')." ".date("d.m.Y", strtotime($vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($bisdatum))."\n"; + } + + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + $mailSancho = $p->t('urlaubstool/xHatZeitausgleichGeloescht', array($benutzer->nachname, $benutzer->vorname)) . ":
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); + + } + + $template_data = array( + 'vorgesetzter' => $fullName, + 'textZeitausgleich' => $mailSancho, + 'Saldo' => '' + ); - $mail = new mail($to, 'vilesci@'.DOMAIN,$p->t('urlaubstool/freigegebenerUrlaubGeloescht'), $message); - if($mail->send()) + if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) { + echo "" . $p->t('global/erfolgreichgelöscht') . '
'; echo "
".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName)).""; } else @@ -621,6 +780,7 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor echo "
".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."!"; } } + else { $vgmail="
".$p->t('urlaubstool/konnteKeinFreigabemailVersendetWerden').""; @@ -632,6 +792,7 @@ if(isset($_GET['type']) && $_GET['type']=='delete_sperre' && !isset($_GET['infor { $zeit = new zeitsperre(); $zeit->load($_GET['id']); + //pruefen ob die person die den datensatz loeschen will auch der //besitzer dieses datensatzes ist if($zeit->mitarbeiter_uid==$uid) @@ -698,7 +859,7 @@ if(count($zeit->result)>0) $content_table.="".$p->t('zeitsperre/edit').""; if ($row->vondatum < $gesperrt_bis AND in_array($row->zeitsperretyp_kurzbz,$typen_arr)) $content_table .= ' '; - else if($row->vondatum>=date("Y-m-d",time()) && $row->zeitsperretyp_kurzbz=='Urlaub') + else if($row->vondatum>=date("Y-m-d",time()) && ($row->zeitsperretyp_kurzbz=='Urlaub' || $row->zeitsperretyp_kurzbz == 'ZA')) { $content_table.="\n".$p->t('zeitsperre/loeschen').""; } @@ -836,6 +997,12 @@ if($result = $db->db_query($qry)) } $content_form.= ''; +//visible field für Zeitsaldo in Mail ZA +$content_form.= ''; + +//$content_form.= ''.$p->t('global/bezeichnung').' +//'; + $content_form.= "".$p->t('urlaubstool/erreichbarkeit')."'; + + $content_form.= ''; + + if(isset($_GET['type']) && $_GET['type']=='edit') $content_form.= ""; @@ -875,6 +1046,7 @@ echo ''; ?> + showHideStudeDropDown();'; ?> diff --git a/include/zeitsperre.class.php b/include/zeitsperre.class.php index 0e737eaf0..efae1c91d 100644 --- a/include/zeitsperre.class.php +++ b/include/zeitsperre.class.php @@ -551,13 +551,13 @@ class zeitsperre extends basis_db public function getVonBis($uid, $von, $bis, $zeitsperretyp_kurzbz = null) { $qry = ' - SELECT + SELECT zeitsperre_id, zeitsperretyp_kurzbz, vondatum, vonstunde, bisdatum, bisstunde - FROM + FROM campus.tbl_zeitsperre LEFT JOIN campus.tbl_zeitsperretyp USING (zeitsperretyp_kurzbz) - WHERE - mitarbeiter_uid = '. $this->db_add_param($uid). ' + WHERE + mitarbeiter_uid = '. $this->db_add_param($uid). ' AND ( (vondatum BETWEEN '.$this->db_add_param($von).' AND '.$this->db_add_param($bis).') OR @@ -592,5 +592,46 @@ class zeitsperre extends basis_db return true; } } + + /** + * Laedt einen Zeitsperretyp. + * + * @param $zeitsperretyp_kurzbz + * @return Gibt Zeitsperretyp als Objekt zurück. True wenn ok, false im Fehlerfall. + */ + public function loadZeitsperretyp($zeitsperretyp_kurzbz) + { + if(!is_string($zeitsperretyp_kurzbz)) + { + $this->errormsg = 'zeitsperretyp muß ein String sein'; + return false; + } + + $qry = "SELECT * FROM campus.tbl_zeitsperretyp WHERE zeitsperretyp_kurzbz = ". $this->db_add_param($zeitsperretyp_kurzbz); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Laden des Datensatzes'; + return false; + } + + if($row = $this->db_fetch_object()) + { + $obj = new StdClass(); + $obj->zeitsperretyp_kurzbz = $row->zeitsperretyp_kurzbz; + $obj->beschreibung = $row->beschreibung; + $obj->farbe = $row->farbe; + + $this->result[]= $obj; + } + else + { + $this->errormsg = 'Zeitsperretyp konnte nicht geladen werden'; + return false; + } + + return true; + } + } ?> diff --git a/locale/de-AT/urlaubstool.php b/locale/de-AT/urlaubstool.php index 6d6edde09..5001ed725 100644 --- a/locale/de-AT/urlaubstool.php +++ b/locale/de-AT/urlaubstool.php @@ -37,9 +37,14 @@ $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Si $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; $this->phrasen['urlaubstool/freigabeFehlt']='Urlaub wurde noch nicht freigegeben'; $this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Bereits Freigegebener Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/UrlaubGeloescht']='Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/zeitausgleichNeu']='Zeitausgleich wurde neu eingetragen'; +$this->phrasen['urlaubstool/zeitausgleichGeaendert']='Zeitausgleich wurde geändert'; +$this->phrasen['urlaubstool/zeitausgleichGeloescht']='Zeitausgleich wurde gelöscht'; +$this->phrasen['urlaubstool/xHatZeitausgleichGeloescht']='%s %s hat einen eingetragenen Zeitausgleich gelöscht'; $this->phrasen['urlaubstool/VorgesetzteInformiert']='Email wurde an %s versandt'; $this->phrasen['urlaubstool/konnteKeinInformationsemailVersendetWerden']='Es konnte kein Email versendet werden, da kein Vorgesetzter eingetragen ist!'; -$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat bereits freigegebenen Urlaub gelöscht'; +$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat Urlaub gelöscht'; $this->phrasen['urlaubstool/urlaubsfreigabe']='Freigabe Urlaub: '; $this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Bestätigungsmail an %s versandt'; $this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; diff --git a/locale/en-US/urlaubstool.php b/locale/en-US/urlaubstool.php index 697117c34..17a31c986 100644 --- a/locale/en-US/urlaubstool.php +++ b/locale/en-US/urlaubstool.php @@ -36,6 +36,13 @@ $this->phrasen['urlaubstool/meineZeitsperren']='My Planned Absences'; $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Sie können diesen unter folgender Adresse freigeben'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeFehlt']='Vacation has not been approved yet'; +$this->phrasen['urlaubstool/zeitausgleichNeu']='Compensatory time was entered'; +$this->phrasen['urlaubstool/zeitausgleichGeaendert']='Compensatory time was changed'; +$this->phrasen['urlaubstool/zeitausgleichGeloescht']='Compensatory time was deleted'; +$this->phrasen['urlaubstool/xHatZeitausgleichGeloescht']='Compensatory time was deleted by %s %s'; +$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='Vacation was deleted by %s %s'; +$this->phrasen['urlaubstool/UrlaubGeloescht']='Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Approved Vacation was deleted by %s %s'; $this->phrasen['urlaubstool/urlaubsfreigabe']='Vacation approval: '; $this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Confirmation mail to %s sent'; $this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll From 797cabccb969843cc9afcbd998e4923a7ffda37b Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 29 Jun 2022 08:46:01 +0200 Subject: [PATCH 013/128] neue Mailvorlagen Sancho fuer Zeitausgleich und Urlaub --- cis/private/profile/zeitsperre_resturlaub.php | 169 ++++++------------ 1 file changed, 51 insertions(+), 118 deletions(-) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index b5118dce4..12f9dfa97 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -108,7 +108,12 @@ $addon_obj->loadAddons(); foreach($addon_obj->result as $addon) { if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) + { echo ''; + $addoncasetime = true; + require_once('../../../addons/casetime/include/functions.inc.php'); + } + } // Wenn Seite fertig geladen ist Addons aufrufen @@ -162,62 +167,6 @@ $( document ).ready(function() return [true, ""]; } -function AddonCaseTimeLoadZeitsaldo(uid) -{ - $.ajax({ - type: "GET", - dataType: "json", - url: "'.APP_ROOT.'/addons/casetime/vilesci/zeitsaldo.php?uid="+uid, - success: function (result) - { - if (result===false) - { - $("#zeitsaldo").html("error"); - } - else - { - var DatumAktuell = new Date(); - //var DatumAktuell = new Date(2016,0,11); - var MonatAktuell = DatumAktuell.getMonth()+1; - var MonatLetztes = MonatAktuell - 1; - var JahrAktuell = DatumAktuell.getFullYear(); - var JahrLetztes = DatumAktuell.getFullYear(); - var VorJahr = JahrAktuell -1; - if (MonatLetztes == 0) - { - MonatLetztes = 12; - JahrLetztes = JahrAktuell - 1; - } - var MonatVorLetztes = MonatLetztes -1; - var JahrVorLetztes = JahrLetztes; - if (MonatVorLetztes == 0) - { - MonatVorLetztes = 12; - JahrVorLetztes = JahrLetztes -1; - } - - - var zahl = parseFloat(result); - if (zahl > 0) - var faktor = 1; - else - var faktor = -1; - zahl = zahl * faktor; - var std = Math.floor(zahl); - var min = (zahl-Math.floor(zahl))*60; - min = Math.round(min); - var std_anzeigealt = std+"h:"+min+"m"; - - $(\'input[name="zeitsaldo"]\').val("Aktueller Stundensaldo: "+result +" Stunden ("+std_anzeigealt+")"); - - } - }, - error: function(){ - alert("Error Casetime Load"); - } - }); -} - '; ?> @@ -399,16 +348,20 @@ function showHideStudeDropDown() load($uid); + $nameMitarbeiter = $benutzer->vorname. " ". $benutzer->nachname; + $beschreibung = (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung); + if($datum_obj->formatDatum($zeitsperre->vondatum, 'm')>=9) $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y')+1; else $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y'); + $von = $datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'); + $bis = $datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + // Wenn ein neuer Urlaub eingetragen wurde, Freigabemail-Text if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { - if ($zeitsperre->new) - { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'). - ".
Sie können diesen unter folgender Adresse freigeben:

". - " Link Urlaubstool "; + $zeitsaldo = " Link Urlaubstool "; $subject = "Freigabeansuchen"; - - $zeitsaldo = ''; - } - + $mailvorlage = 'Sancho_Mail_Urlaub_Neu'; } // Wenn ein Zeitausgleich eingetragen wurde... + //manu zeitsperre neu if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') { // ...Mail-Text für neuen Zeitausgleich if ($zeitsperre->new) { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Zeitausgleich eingetragen:
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - $subject = $p->t('urlaubstool/zeitausgleichNeu'); + $mailvorlage = 'Sancho_Content_Zeitausgleich'; } // ...Mail-Text für geaenderten Zeitausgleich else { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat den Zeitausgleich wie folgt geändert:
" ; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - $subject = $subject = $p->t('urlaubstool/zeitausgleichGeaendert'); + $mailvorlage = 'Sancho_Content_ZA_Aendern'; } } @@ -659,11 +598,15 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_ //Sanchomail mit Vorlage Sancho Mail Zeitausgleich $template_data = array( 'vorgesetzter' => $fullName, - 'textZeitausgleich' => $mailSancho, + 'nameMitarbeiter' => $nameMitarbeiter, + 'beschreibung' =>$beschreibung, + 'vonDatum' => $von, + 'bisDatum' => $bis, 'Saldo'=> $zeitsaldo ); - if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + + if (sendSanchoMail($mailvorlage, $template_data, $to, $subject)) { if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { @@ -703,8 +646,11 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; - $vondatum = $zeitsperre->getVonDatum(); - $bisdatum = $zeitsperre->getBisDatum(); + $vonDatum = $zeitsperre->getVonDatum(); + $bisDatum = $zeitsperre->getBisDatum(); + + $vonDatum = $datum_obj->formatDatum($vonDatum ,'d.m.Y'); + $bisDatum = $datum_obj->formatDatum($bisDatum,'d.m.Y'); if(!$zeitsperre->delete($_GET['id'])) @@ -736,41 +682,30 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $benutzer = new benutzer(); $benutzer->load($uid); + $nameMitarbeiter = $benutzer->vorname. " ". $benutzer->nachname; + $beschreibung = (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung); - if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') - { - $mailSancho = $p->t('urlaubstool/xHatUrlaubGeloescht', array($benutzer->nachname, $benutzer->vorname)).":
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - - // $subject = $p->t('urlaubstool/freigegebenerUrlaubGeloescht'); + if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') + { $subject = $p->t('urlaubstool/UrlaubGeloescht'); - - + $mailvorlage = 'Sancho_Mail_Urlaub_Loeschen'; } - if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') - { - $mailSancho = $p->t('urlaubstool/xHatZeitausgleichGeloescht', array($benutzer->nachname, $benutzer->vorname)) . ":
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - - $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); - - } + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); + $mailvorlage = 'Sancho_Mail_ZA_loeschen'; + } $template_data = array( 'vorgesetzter' => $fullName, - 'textZeitausgleich' => $mailSancho, - 'Saldo' => '' + 'nameMitarbeiter' => $nameMitarbeiter, + 'beschreibung' =>$beschreibung, + 'vonDatum' => $vonDatum, + 'bisDatum' => $bisDatum ); - - if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + if (sendSanchoMail($mailvorlage, $template_data, $to, $subject)) { echo "" . $p->t('global/erfolgreichgelöscht') . '
'; echo "
".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName)).""; @@ -997,12 +932,10 @@ if($result = $db->db_query($qry)) } $content_form.= ''; -//visible field für Zeitsaldo in Mail ZA -$content_form.= ''; - //$content_form.= ''.$p->t('global/bezeichnung').' //'; + $content_form.= "".$p->t('urlaubstool/erreichbarkeit')."'; } else { - echo ''; } } diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 12f9dfa97..f18a4b2cc 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -102,20 +102,20 @@ $num_rows_stunde=$db->db_num_rows($result_stunde); loadAddons(); foreach($addon_obj->result as $addon) { if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) - { echo ''; - $addoncasetime = true; - require_once('../../../addons/casetime/include/functions.inc.php'); - } - } +// Überprüfen, ob addon casetime aktiv ist +$addoncasetime = $addon_obj->checkActiveAddon("casetime"); +echo $addon_obj->checkActiveAddon("asterisk"); + // Wenn Seite fertig geladen ist Addons aufrufen echo ' '; - $addoncasetime = true; - require_once('../../addons/casetime/include/functions.inc.php'); - } + require_once('../../addons/casetime/include/functions.inc.php'); } + //Kopfzeile echo ' @@ -96,7 +91,7 @@ echo ' "); +if (!in_array($gebiet_id, $_SESSION['alleGebiete'])) + die($p->t('testtool/dasGebietIstNichtFuerSieBestimmt')); + $gebiet = new gebiet($gebiet_id); if($gebiet->level_start!='') diff --git a/cis/testtool/menu.php b/cis/testtool/menu.php index e4b0a82fe..1e39885d8 100644 --- a/cis/testtool/menu.php +++ b/cis/testtool/menu.php @@ -277,6 +277,7 @@ if (isset($_SESSION['pruefling_id'])) $anzahlGebiete = $db->db_num_rows($result); $lastsemester = ''; $quereinsteiger_stg = ''; + $_SESSION['alleGebiete']= []; while($row = $db->db_fetch_object($result)) { //Jedes Semester in einer eigenen Tabelle anzeigen @@ -385,6 +386,7 @@ if (isset($_SESSION['pruefling_id'])) '; + $_SESSION['alleGebiete'][] = $row->gebiet_id; } else { diff --git a/locale/de-AT/testtool.php b/locale/de-AT/testtool.php index dbafe21e9..81a2ca1ca 100644 --- a/locale/de-AT/testtool.php +++ b/locale/de-AT/testtool.php @@ -45,6 +45,7 @@ $this->phrasen['testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten']='Bei di $this->phrasen['testtool/bearbeitungszeit']='Bearbeitungszeit'; $this->phrasen['testtool/dieZeitIstAbgelaufen']='Die Zeit ist abgelaufen!
Bitte aktivieren Sie Javascript in Ihrem Browser!'; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']='Diese Frage ist nicht für Sie bestimmt'; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']='Das Gebiet ist nicht für Sie bestimmt'; $this->phrasen['testtool/fehlerBeimSpeichernDerErstansicht']='Fehler beim Speichern der Erstansicht'; $this->phrasen['testtool/startDrueckenUmZuBeginnen']='Um dieses Teilgebiet zu starten, drücken Sie bitte links oben auf Gebiet starten.'; $this->phrasen['testtool/keinPrueflingseintragVorhanden']='Kein Prüflingseintrag vorhanden'; diff --git a/locale/en-US/testtool.php b/locale/en-US/testtool.php index 473ac1e0d..87b818062 100644 --- a/locale/en-US/testtool.php +++ b/locale/en-US/testtool.php @@ -45,6 +45,7 @@ $this->phrasen['testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten']='In thi $this->phrasen['testtool/bearbeitungszeit']='Time'; $this->phrasen['testtool/dieZeitIstAbgelaufen']='The time has run out!
Please enable JavaScript in your browser!'; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']='This question is not intended for you'; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']='This section is not intended for you'; $this->phrasen['testtool/fehlerBeimSpeichernDerErstansicht']='Error in saving the initial view'; $this->phrasen['testtool/startDrueckenUmZuBeginnen']='To start this section, please click on Start section in the top left corner.'; $this->phrasen['testtool/keinPrueflingseintragVorhanden']='No candidate entry available.'; diff --git a/locale/it-IT/testtool.php b/locale/it-IT/testtool.php index 0f64986a9..9a3553efe 100644 --- a/locale/it-IT/testtool.php +++ b/locale/it-IT/testtool.php @@ -7,6 +7,7 @@ $this->phrasen['testtool/bitteZuerstAnmelden']=''; $this->phrasen['testtool/blaettern']=''; $this->phrasen['testtool/demo']=''; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']=''; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']=''; $this->phrasen['testtool/dieZeitIstAbgelaufen']=''; $this->phrasen['testtool/einleitung']=''; $this->phrasen['testtool/esWurdeKeineFrageGefunden']=''; From 8670ab18f80586454dc1eff6748500f8cfce5904 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Mon, 5 Sep 2022 11:27:33 +0200 Subject: [PATCH 023/128] =?UTF-8?q?Zeitaufzeichnung:=20Ber=C3=BCcksichtigu?= =?UTF-8?q?ng=20von=20Attribut=20Zeitaufzeichnung=20bei=20Projekt=20und=20?= =?UTF-8?q?Projektphase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/tools/zeitaufzeichnung.php | 29 ++++++++++++++-- .../tools/zeitaufzeichnung_projektphasen.php | 1 + include/projektphase.class.php | 34 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index ba57b442f..003eea434 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -605,9 +605,14 @@ echo ' { projphasenhtml += "'; + echo ''; } echo ''; } diff --git a/cis/private/tools/zeitaufzeichnung_projektphasen.php b/cis/private/tools/zeitaufzeichnung_projektphasen.php index 053f38b91..05df74443 100644 --- a/cis/private/tools/zeitaufzeichnung_projektphasen.php +++ b/cis/private/tools/zeitaufzeichnung_projektphasen.php @@ -86,6 +86,7 @@ if (isset($_GET['projekt_kurzbz'])) $item['bezeichnung'] = $row->bezeichnung; $item['start'] = $datum_obj->formatDatum($row->start, 'd.m.Y'); $item['ende'] = $datum_obj->formatDatum($row->ende, 'd.m.Y'); + $item['zeitaufzeichnung_erlaubt'] = $row->zeitaufzeichnung; $result_obj[] = $item; } } diff --git a/include/projektphase.class.php b/include/projektphase.class.php index 19bd85d6d..4e3c38b7c 100644 --- a/include/projektphase.class.php +++ b/include/projektphase.class.php @@ -829,5 +829,39 @@ class projektphase extends basis_db return false; } } + + /** + * Gibt zurück, ob für eine Projektphase Zeitaufzeichnungsbuchung erlaubt ist + * @param $projektphase_id die zu überprüfende Projektphase + * @return boolean true, wenn Buchung erlaubt + */ + public function getPhasenZA($projektphase_id) + { + $qry = " + SELECT + fue.tbl_projektphase.zeitaufzeichnung + FROM + fue.tbl_projektphase + WHERE + tbl_projektphase.projektphase_id = ".$this->db_add_param($projektphase_id); + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + return $row->zeitaufzeichnung; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } } ?> From 7252bc1e6f07e053bae5a4afc860cd757985e75a Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 9 Sep 2022 13:20:50 +0200 Subject: [PATCH 024/128] add config.file --- cis/private/profile/zeitsperre_resturlaub.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 04615ab66..351ebc29d 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -350,6 +350,7 @@ function showHideStudeDropDown() $zeitsaldo = ""; if($addoncasetime) { + require_once('../../../addons/casetime/config.inc.php'); require_once('../../../addons/casetime/include/functions.inc.php'); $zeitsaldo = getCaseTimeZeitsaldo($uid); $zeitsaldo = "Aktueller Zeitsaldo: ". $zeitsaldo . " (".formatZeitsaldo($zeitsaldo).")"; From 0d03689f570604b995ce0e147c2101141f6796da Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 14 Sep 2022 02:48:43 +0200 Subject: [PATCH 025/128] added IIssueExistsChecker and Issueload->model('system/Issue_model', 'IssueModel'); + + $this->load->library('IssuesLib'); + } + + /** + * Initializes issue resolution. + */ + public function run() + { + $this->logInfo("Issue producer job started"); + + foreach ($this->_codeLibMappings as $fehlercode => $library) + { + // 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::ISSUES_FOLDER . '/'; + $issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php'; + + // check if library file exists + if (!file_exists($issuesLibFilePath)) + { + // log error and continue with next issue if not + $this->logError("Issue library file " . $issuesLibFilePath . " does not exist"); + continue; + } + + // 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_EXISTS_METHOD_NAME))) + { + // log error and continue with next issue if not + $this->logError("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); + continue; + } + + // call the function for checking for issue resolution + $issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_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"); + } + } + } + + $this->logInfo("Issue resolve job ended"); + } +} From d5eff7d6154e94e42a00b8164553c337fb6f7a49 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 15 Sep 2022 18:56:18 +0200 Subject: [PATCH 026/128] issue plausichecks: added issue producer files, code formatting --- .../controllers/jobs/PlausiIssueProducer.php | 40 +++++++ application/core/IIssueExistsChecker.php | 10 +- application/core/IssueProducer_Controller.php | 101 +++++++----------- application/core/IssueResolver_Controller.php | 6 +- application/libraries/IssuesLib.php | 14 ++- .../libraries/issues/PlausicheckLib.php | 25 +++++ 6 files changed, 127 insertions(+), 69 deletions(-) create mode 100644 application/controllers/jobs/PlausiIssueProducer.php create mode 100644 application/libraries/issues/PlausicheckLib.php diff --git a/application/controllers/jobs/PlausiIssueProducer.php b/application/controllers/jobs/PlausiIssueProducer.php new file mode 100644 index 000000000..03fa6866f --- /dev/null +++ b/application/controllers/jobs/PlausiIssueProducer.php @@ -0,0 +1,40 @@ + class (library) name for resolving + $this->_fehlerLibMappings = array( + 'zgvDatumInZukunft' => 'ZgvDatumInZukunft', + 'zgvDatumVorGeburtsdatum' => 'ZgvDatumVorGeburtsdatum', + 'zgvMasterDatumInZukunft' => 'ZgvMasterDatumInZukunft', + 'zgvMasterDatumVorZgvdatum' => 'ZgvMasterDatumVorZgvdatum', + 'zgvMasterDatumVorGeburtsdatum' => 'ZgvMasterDatumVorGeburtsdatum', + 'keinAufenthaltszweckPlausi' => 'KeinAufenthaltszweckPlausi', + 'zuVieleZweckeIncomingPlausi' => 'ZuVieleZweckeIncomingPlausi', + 'falscherIncomingZweckPlausi' => 'FalscherIncomingZweckPlausi', + 'outgoingAufenthaltfoerderungfehltPlausi' => 'OutgoingAufenthaltfoerderungfehltPlausi', + 'outgoingAngerechneteEctsFehlenPlausi' => 'OutgoingAngerechneteEctsFehlenPlausi', + 'outgoingErworbeneEctsFehlenPlausi' => 'OutgoingErworbeneEctsFehlenPlausi' + ); + + $this->load->model('studiensemester_model', 'StudiensemesterModel'); + } + + public function run() + { + $semRes = $this->StudiensemesterModel->getAkt(); + + if (hasData($semRes)) + { + $studiensemester_kurzbz = getData($semRes)[0]->studiensemester_kurzbz; + } + } +} diff --git a/application/core/IIssueExistsChecker.php b/application/core/IIssueExistsChecker.php index 7a79b26ae..0aecaa796 100644 --- a/application/core/IIssueExistsChecker.php +++ b/application/core/IIssueExistsChecker.php @@ -7,9 +7,15 @@ interface IIssueExistsChecker { /** * Checks if an issue exists. - * Classes for checking if a certain issue exists implement this method. * @param array $params parameters needed for issue detection * @return object with success(true) if issue exists, success(false) otherwise */ - public function checkIfIssueExists($params); + 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); } diff --git a/application/core/IssueProducer_Controller.php b/application/core/IssueProducer_Controller.php index 625702a07..e0de28d88 100644 --- a/application/core/IssueProducer_Controller.php +++ b/application/core/IssueProducer_Controller.php @@ -7,8 +7,9 @@ abstract class IssueProducer_Controller extends JOB_Controller { const ISSUES_FOLDER = 'issues'; const CHECK_ISSUE_EXISTS_METHOD_NAME = 'checkIfIssueExists'; + const PRODUCE_ISSUE_METHOD_NAME = 'produceIssue'; - protected $_codeLibMappings; + protected $_fehlerLibMappings; public function __construct() { @@ -20,73 +21,51 @@ abstract class IssueProducer_Controller extends JOB_Controller } /** - * Initializes issue resolution. + * Initializes issue production. */ - public function run() + public function produceIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $paramsForChecking, $paramsForProduction) { - $this->logInfo("Issue producer job started"); + // get libname from fehler_kurzbz + $libName = $this->_fehlerLibMappings[$fehler_kurzbz]; + + // 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'; - foreach ($this->_codeLibMappings as $fehlercode => $library) + // check if library file exists + if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist"); + + // load library connected to fehler_kurzbz + $this->load->library($issuesLibPath . $libName); + + $lowercaseLibName = mb_strtolower($libName); + + // check if method is defined in library class + if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_EXISTS_METHOD_NAME))) + return error("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); + + // call the function for checking for issue resolution + $issueExistsRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_METHOD_NAME}($paramsForChecking); + + if (isError($issueExistsRes)) return $issueExistsRes; + + $issueExistsData = getData($issueExistsRes); + + if ($issueExistsData === true) { - // 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() + // write issue if it was detected + $produceRes = $this->{$lowercaseLibName}->{self::PRODUCE_ISSUE_METHOD_NAME}( + $fehler_kurzbz, + isset($params['person_id']) ? $params['person_id'] : null, + isset($params['oe_kurzbz']) ? $params['oe_kurzbz'] : null, + $paramsForProduction ); - // 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'; + if (isError($produceRes)) + return $produceRes; - // check if library file exists - if (!file_exists($issuesLibFilePath)) - { - // log error and continue with next issue if not - $this->logError("Issue library file " . $issuesLibFilePath . " does not exist"); - continue; - } - - // 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_EXISTS_METHOD_NAME))) - { - // log error and continue with next issue if not - $this->logError("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); - continue; - } - - // call the function for checking for issue resolution - $issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_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"); - } - } + return success("Issue " . $issue->issue_id . " successfully written"); } - - $this->logInfo("Issue resolve job ended"); } } diff --git a/application/core/IssueResolver_Controller.php b/application/core/IssueResolver_Controller.php index 77d14f408..ec47a060c 100755 --- a/application/core/IssueResolver_Controller.php +++ b/application/core/IssueResolver_Controller.php @@ -73,13 +73,11 @@ abstract class IssueResolver_Controller extends JOB_Controller } // load library connected to fehlercode - $this->load->library( - $issuesLibPath . $libName - ); + $this->load->library($issuesLibPath . $libName); $lowercaseLibName = mb_strtolower($libName); - // check if method is defined in libary class + // 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 diff --git a/application/libraries/IssuesLib.php b/application/libraries/IssuesLib.php index d6488bc36..e31cb88c6 100644 --- a/application/libraries/IssuesLib.php +++ b/application/libraries/IssuesLib.php @@ -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."); diff --git a/application/libraries/issues/PlausicheckLib.php b/application/libraries/issues/PlausicheckLib.php new file mode 100644 index 000000000..26b079c21 --- /dev/null +++ b/application/libraries/issues/PlausicheckLib.php @@ -0,0 +1,25 @@ +_ci =& get_instance(); + + $this->_ci->load->model('', ''); + } + + public function getStudents() + { + $qry = ' + + '; + } +} From 40d8edebef8e3299e22fe43e9a3f3abc30d79116 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Sun, 18 Sep 2022 23:02:55 +0200 Subject: [PATCH 027/128] Plausichecks: added run method to IssueProducer_Controller for producing plausicheck issues --- .../controllers/jobs/PlausiIssueProducer.php | 122 +++++++++++++++--- application/core/IIssueExistsChecker.php | 2 +- application/core/IssueProducer_Controller.php | 72 ++++++----- application/core/IssueResolver_Controller.php | 1 - .../libraries/issues/PlausicheckLib.php | 9 +- .../issues/plausichecks/IPlausiChecker.php | 14 ++ .../StgPrestudentUngleichStgStudent.php | 0 7 files changed, 156 insertions(+), 64 deletions(-) create mode 100644 application/libraries/issues/plausichecks/IPlausiChecker.php create mode 100644 application/libraries/issues/plausichecks/StgPrestudentUngleichStgStudent.php diff --git a/application/controllers/jobs/PlausiIssueProducer.php b/application/controllers/jobs/PlausiIssueProducer.php index 03fa6866f..d67c8693b 100644 --- a/application/controllers/jobs/PlausiIssueProducer.php +++ b/application/controllers/jobs/PlausiIssueProducer.php @@ -3,38 +3,120 @@ /** * Job for producing Plausicheck issues */ -class PlausiIssueProducer extends IssueProducer_Controller +class PlausiIssueProducer extends JOB_Controller { + const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks'; + const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck' + + private _fehlerLibMappings; + public function __construct() { parent::__construct(); - // set fehler codes which can be produced by the job - // structure: fehlercode => class (library) name for resolving + // set fehler which can be produced by the job + // structure: fehler_kurzbz => class (library) name for resolving $this->_fehlerLibMappings = array( - 'zgvDatumInZukunft' => 'ZgvDatumInZukunft', - 'zgvDatumVorGeburtsdatum' => 'ZgvDatumVorGeburtsdatum', - 'zgvMasterDatumInZukunft' => 'ZgvMasterDatumInZukunft', - 'zgvMasterDatumVorZgvdatum' => 'ZgvMasterDatumVorZgvdatum', - 'zgvMasterDatumVorGeburtsdatum' => 'ZgvMasterDatumVorGeburtsdatum', - 'keinAufenthaltszweckPlausi' => 'KeinAufenthaltszweckPlausi', - 'zuVieleZweckeIncomingPlausi' => 'ZuVieleZweckeIncomingPlausi', - 'falscherIncomingZweckPlausi' => 'FalscherIncomingZweckPlausi', - 'outgoingAufenthaltfoerderungfehltPlausi' => 'OutgoingAufenthaltfoerderungfehltPlausi', - 'outgoingAngerechneteEctsFehlenPlausi' => 'OutgoingAngerechneteEctsFehlenPlausi', - 'outgoingErworbeneEctsFehlenPlausi' => 'OutgoingErworbeneEctsFehlenPlausi' + '' => '' + //'zgvDatumInZukunft' => 'ZgvDatumInZukunft', + //'zgvDatumVorGeburtsdatum' => 'ZgvDatumVorGeburtsdatum', + //'zgvMasterDatumInZukunft' => 'ZgvMasterDatumInZukunft', + //'zgvMasterDatumVorZgvdatum' => 'ZgvMasterDatumVorZgvdatum', + //'zgvMasterDatumVorGeburtsdatum' => 'ZgvMasterDatumVorGeburtsdatum', + //'keinAufenthaltszweckPlausi' => 'KeinAufenthaltszweckPlausi', + //'zuVieleZweckeIncomingPlausi' => 'ZuVieleZweckeIncomingPlausi', + //'falscherIncomingZweckPlausi' => 'FalscherIncomingZweckPlausi', + //'outgoingAufenthaltfoerderungfehltPlausi' => 'OutgoingAufenthaltfoerderungfehltPlausi', + //'outgoingAngerechneteEctsFehlenPlausi' => 'OutgoingAngerechneteEctsFehlenPlausi', + //'outgoingErworbeneEctsFehlenPlausi' => 'OutgoingErworbeneEctsFehlenPlausi' ); + + $this->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); - $this->load->model('studiensemester_model', 'StudiensemesterModel'); + $this->load->library('IssuesLib'); } - public function run() + /** + * Initializes issue production. + */ + public function run($studiensemester_kurzbz = null) { - $semRes = $this->StudiensemesterModel->getAkt(); - - if (hasData($semRes)) + if (isEmptyString($studiensemester_kurzbz)) { - $studiensemester_kurzbz = getData($semRes)[0]->studiensemester_kurzbz; + $studiensemesterRes = $this->StudiensemesterModel->getAkt(); + + if (isError($studiensemesterRes)) $this->logError(getError($studiensemesterRes)); + + if (hasData($studiensemesterRes)) + { + $studiensemester_kurzbz = getData($studiensemesterRes); + } } + + + $this->logInfo("Plausicheck issue producer job started"); + + foreach ($this->_fehlerLibMappings as $fehler_kurzbz => $libName) + { + // get path of library for issue to be produced + $issuesLibPath = DOC_ROOT . 'application/libraries' . self::PLAUSI_ISSUES_FOLDER; + $issuesLibFilePath = $issuesLibPath . '/' . $libName . '.php'; + + // check if library file exists + if (!file_exists($issuesLibFilePath)) + { + // log error and continue with next issue if not + $this->logError("Issue library file " . $issuesLibFilePath . " does not exist"); + continue; + } + + // load library connected to fehlercode + $this->load->library($issuesLibPath . $libName); + + $lowercaseLibName = mb_strtolower($libName); + + // check if method is defined in library class + if (!is_callable(array($this->{$lowercaseLibName}, self::EXECUTE_PLAUSI_CHECK_METHOD_NAME))) + { + // log error and continue with next issue if not + $this->logError("Method " . self::EXECUTE_PLAUSI_CHECK_METHOD_NAME . " is not defined in library $lowercaseLibName"); + continue; + } + + // call the function for checking for issue production + $executePlausiRes = $this->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}(); + + if (isError($executePlausiRes)) + { + $this->logError(getError($executePlausiRes)); + } + else + { + // get the data returned by Plausicheck + $executePlausiData = getData($executePlausiRes); + + if (is_array($executePlausiData)) + { + foreach ($executePlausiData 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); + + if (isError($addIssueRes)) + $this->logError(getError($behobenRes)); + else + $this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced"); + } + } + } + } + + $this->logInfo("Plausicheck issue producer job stopped"); } } diff --git a/application/core/IIssueExistsChecker.php b/application/core/IIssueExistsChecker.php index 0aecaa796..7f5a6b6e5 100644 --- a/application/core/IIssueExistsChecker.php +++ b/application/core/IIssueExistsChecker.php @@ -17,5 +17,5 @@ interface IIssueExistsChecker * @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); + //public function produceIssue($person_id, $oe_kurzbz, $paramsForProducing); } diff --git a/application/core/IssueProducer_Controller.php b/application/core/IssueProducer_Controller.php index e0de28d88..6879bc7dd 100644 --- a/application/core/IssueProducer_Controller.php +++ b/application/core/IssueProducer_Controller.php @@ -23,49 +23,53 @@ abstract class IssueProducer_Controller extends JOB_Controller /** * Initializes issue production. */ - public function produceIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $paramsForChecking, $paramsForProduction) - { - // get libname from fehler_kurzbz - $libName = $this->_fehlerLibMappings[$fehler_kurzbz]; + //public function produceIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $paramsForChecking, $paramsForProduction) + //{ + //// get libname from fehler_kurzbz + //$libName = $this->_fehlerLibMappings[$fehler_kurzbz]; - // 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'; + //// 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'; - // check if library file exists - if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist"); + //// check if library file exists + //if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist"); - // load library connected to fehler_kurzbz - $this->load->library($issuesLibPath . $libName); + //// load library connected to fehler_kurzbz + //$this->load->library($issuesLibPath . $libName); - $lowercaseLibName = mb_strtolower($libName); + //$lowercaseLibName = mb_strtolower($libName); - // check if method is defined in library class - if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_EXISTS_METHOD_NAME))) - return error("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); + //// check if method is defined in library class + //if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_EXISTS_METHOD_NAME))) + //return error("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); - // call the function for checking for issue resolution - $issueExistsRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_METHOD_NAME}($paramsForChecking); + //// call the function for checking for issue resolution + //$issueExistsRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_METHOD_NAME}($paramsForChecking); - if (isError($issueExistsRes)) return $issueExistsRes; + //if (isError($issueExistsRes)) return $issueExistsRes; - $issueExistsData = getData($issueExistsRes); + //$issueExistsData = getData($issueExistsRes); - if ($issueExistsData === true) - { - // write issue if it was detected - $produceRes = $this->{$lowercaseLibName}->{self::PRODUCE_ISSUE_METHOD_NAME}( - $fehler_kurzbz, - isset($params['person_id']) ? $params['person_id'] : null, - isset($params['oe_kurzbz']) ? $params['oe_kurzbz'] : null, - $paramsForProduction - ); + //if ($issueExistsData === true) + //{ + //// write issue if it was detected + ////$produceRes = $this->{$lowercaseLibName}->{self::PRODUCE_ISSUE_METHOD_NAME}( + ////$fehler_kurzbz, + ////isset($params['person_id']) ? $params['person_id'] : null, + ////isset($params['oe_kurzbz']) ? $params['oe_kurzbz'] : null, + ////$paramsForProduction + ////); - if (isError($produceRes)) - return $produceRes; + ////if (isError($produceRes)) + ////return $produceRes; - return success("Issue " . $issue->issue_id . " successfully written"); - } - } + //$addIssueres = $this->IssuesLib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params); + + //if (isError()) + + //return success("Issue " . $issue->issue_id . " successfully written"); + //} + //} } diff --git a/application/core/IssueResolver_Controller.php b/application/core/IssueResolver_Controller.php index ec47a060c..d6eda8afb 100755 --- a/application/core/IssueResolver_Controller.php +++ b/application/core/IssueResolver_Controller.php @@ -43,7 +43,6 @@ abstract class IssueResolver_Controller extends JOB_Controller } else { - $openIssues = getData($openIssuesRes); foreach ($openIssues as $issue) diff --git a/application/libraries/issues/PlausicheckLib.php b/application/libraries/issues/PlausicheckLib.php index 26b079c21..16c423aa3 100644 --- a/application/libraries/issues/PlausicheckLib.php +++ b/application/libraries/issues/PlausicheckLib.php @@ -2,7 +2,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Lib +class PlausicheckLib { private $_ci; // Code igniter instance @@ -15,11 +15,4 @@ class Lib $this->_ci->load->model('', ''); } - - public function getStudents() - { - $qry = ' - - '; - } } diff --git a/application/libraries/issues/plausichecks/IPlausiChecker.php b/application/libraries/issues/plausichecks/IPlausiChecker.php new file mode 100644 index 000000000..415bc4735 --- /dev/null +++ b/application/libraries/issues/plausichecks/IPlausiChecker.php @@ -0,0 +1,14 @@ + Date: Sun, 18 Sep 2022 23:11:43 +0200 Subject: [PATCH 028/128] system/checkStudenten: corrected typo in Studierenden Orgform Plausicheck text output --- system/checkStudenten.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/checkStudenten.php b/system/checkStudenten.php index 2590574db..14c4f2239 100644 --- a/system/checkStudenten.php +++ b/system/checkStudenten.php @@ -492,7 +492,7 @@ if ($result = $db->db_query($qry)) /* * Studierende im aktuellen StSem die in Mischformstudiengängen keine Orgform eingetragen haben */ -$text .= "

Suche alle Bewerber die keine Orgform eingetragen haben.

"; +$text .= "

Suche alle Studierenden die keine Orgform eingetragen haben.

"; $qry = " SELECT From 4d44bbb79c5dbc6543a442b1be45f92fc1dcd64d Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 20 Sep 2022 12:39:20 +0200 Subject: [PATCH 029/128] Anzeige Aktueller Urlaubssaldo in Sanchomail --- cis/private/profile/urlaubstool.php | 20 ++++++++++++++++--- cis/private/profile/zeitsperre_resturlaub.php | 6 +++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/cis/private/profile/urlaubstool.php b/cis/private/profile/urlaubstool.php index 9f9e90646..c6d3452ab 100644 --- a/cis/private/profile/urlaubstool.php +++ b/cis/private/profile/urlaubstool.php @@ -218,7 +218,7 @@ if((isset($_GET['delete']) && isset($_GET['informSupervisor'])) || (isset($_POS $from='vilesci@'.DOMAIN; - //Sanchomail mit Vorlage Sancho Mail Zeitausgleich + //Sanchomail mit Vorlage Sancho Mail Urlaub $template_data = array( 'vorgesetzter' => $fullName, 'nameMitarbeiter' => $nameMitarbeiter, @@ -428,14 +428,27 @@ if(isset($_GET['speichern']) && isset($_GET['wtag'])) $from='vilesci@'.DOMAIN; - //Sanchomail mit Vorlage Sancho Mail Zeitausgleich + // Überprüfen, ob addon casetime aktiv ist + $addon_obj = new addon(); + $addoncasetime = $addon_obj->checkActiveAddon("casetime"); + $urlaubssaldo = ""; + if($addoncasetime) + { + require_once('../../../addons/casetime/config.inc.php'); + require_once('../../../addons/casetime/include/functions.inc.php'); + $urlaubssaldo = getCastTimeUrlaubssaldo($uid); + $urlaubssaldo = "Aktueller Urlaubssaldo: ". $urlaubssaldo->{'AktuellerStand'} . " Tage"; + } + + //Sanchomail mit Vorlage Sancho Mail Urlaub Neu $template_data = array( 'vorgesetzter' => $fullName, 'nameMitarbeiter' => $nameMitarbeiter, 'beschreibung' =>$beschreibung, 'vonDatum' => $von, 'bisDatum' => $bis, - 'Link'=> $link + 'Link'=> $link, + 'urlaubssaldo' => $urlaubssaldo ); @@ -596,6 +609,7 @@ echo ' } }); '; + ?> loadAddons(); +foreach($addon_obj->result as $addon) +{ + if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) + { + echo ' + '; + } +} // Wenn Seite fertig geladen ist Addons aufrufen echo ' @@ -900,7 +902,7 @@ for ($i=0;$i<6;$i++) if($hgfarbe[$j+7*$i]=='#CDDDEE') { $k=$j+7*$i; - echo ""; + echo ""; echo 'loeschen'; } } diff --git a/config/cis.config-default.inc.php b/config/cis.config-default.inc.php index da3baf507..027af9504 100644 --- a/config/cis.config-default.inc.php +++ b/config/cis.config-default.inc.php @@ -261,5 +261,9 @@ define('CIS_ZEITWUNSCH_GD', false); define('CIS_SHOW_COVID_STATUS', false); //Vertrag Allin -define ('DEFAULT_ALLIN_DIENSTVERTRAG',[110,111]); +define ('DEFAULT_ALLIN_DIENSTVERTRAG',[111]); + +//Echter Dienstvertrag +define ('DEFAULT_ECHTER_DIENSTVERTRAG',[103,111]); + ?> diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index 6ed926b3f..17f668b90 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -266,8 +266,9 @@ define('FAS_DOPPELTE_BUCHUNGSTYPEN_CHECK', serialize( // Spezialnoten die am Zeunigs und Diplomasupplement ignoriert werden define('ZEUGNISNOTE_NICHT_ANZEIGEN',serialize(array('iar', 'nz'))); +//Default Lehrmodus +define ('DEFAULT_LEHRMODUS','regulaer'); + //Echter Dienstvertrag define ('DEFAULT_ECHTER_DIENSTVERTRAG',[103,110]); - - ?> From 74fb245757e75b5c6bfd20af9042dc9482ead8ea Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 10 Nov 2022 11:20:36 +0100 Subject: [PATCH 079/128] =?UTF-8?q?26114=20=C3=84nderung=20Mailtext=20Urla?= =?UTF-8?q?ub=20neu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/urlaubstool.php | 85 +++++++++---------- cis/private/profile/zeitsperre_resturlaub.php | 2 +- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/cis/private/profile/urlaubstool.php b/cis/private/profile/urlaubstool.php index 42bbe2ec7..cf66953b3 100644 --- a/cis/private/profile/urlaubstool.php +++ b/cis/private/profile/urlaubstool.php @@ -52,8 +52,8 @@ $mehrarbeitsstunden = '0'; $anspruch = '25'; $zaehl=1; $tage=array(); //Array Tage für Kalenderanzeige -$hgfarbe=array_fill(0,44,'#E9ECEE'); //Array mit Hintegrundfarben der Kalenderfelder -$datensatz=array_fill(0,44,0); +$hgfarbe=array_fill(0, 44, '#E9ECEE'); //Array mit Hintegrundfarben der Kalenderfelder +$datensatz=array_fill(0, 44, 0); $freigabevon=array(); $freigabeamum=array(); $vertretung_uid=array(); @@ -125,7 +125,6 @@ if (isset($_GET['hgfarbe'])) } else { - if (!isset($_GET['spmonat'])) { for($i=0;$i<44;$i++) @@ -172,46 +171,46 @@ if (isset($_GET['rechts_x']) || isset($_POST['rechts_x'])) //Eintragung löschen if(isset($_GET['delete'])) { - $zeitsperre = new zeitsperre(); - $zeitsperre->load($_GET['delete']); + $zeitsperre = new zeitsperre(); + $zeitsperre->load($_GET['delete']); - $vondatum = $zeitsperre->getVonDatum(); - $bisdatum = $zeitsperre->getBisDatum(); - $vondatum = $datum_obj->formatDatum($vondatum ,'d.m.Y'); - $bisdatum = $datum_obj->formatDatum($bisdatum,'d.m.Y'); + $vondatum = $zeitsperre->getVonDatum(); + $bisdatum = $zeitsperre->getBisDatum(); + $vondatum = $datum_obj->formatDatum($vondatum ,'d.m.Y'); + $bisdatum = $datum_obj->formatDatum($bisdatum,'d.m.Y'); - if(!$zeitsperre->delete($_GET['delete'])) - { - echo $zeitsperre->errormsg; - } - else - { - //Mail an Vorgesetzten - $prsn = new person(); + if(!$zeitsperre->delete($_GET['delete'])) + { + echo $zeitsperre->errormsg; + } + else + { + //Mail an Vorgesetzten + $prsn = new person(); - $vorgesetzter = $ma->getVorgesetzte($uid); - if($vorgesetzter) - { - $to=''; - $fullName =''; - foreach($ma->vorgesetzte as $vg) - { - if($to!='') - { - $to.=', '.$vg.'@'.DOMAIN; - $name = $prsn->getFullNameFromBenutzer($vg); - $fullName.=', '.$name; - } - else - { - $to.=$vg.'@'.DOMAIN; - $name = $prsn->getFullNameFromBenutzer($vg); - $fullName.=$name; - } - } + $vorgesetzter = $ma->getVorgesetzte($uid); + if($vorgesetzter) + { + $to=''; + $fullName =''; + foreach($ma->vorgesetzte as $vg) + { + if($to!='') + { + $to.=', '.$vg.'@'.DOMAIN; + $name = $prsn->getFullNameFromBenutzer($vg); + $fullName.=', '.$name; + } + else + { + $to.=$vg.'@'.DOMAIN; + $name = $prsn->getFullNameFromBenutzer($vg); + $fullName.=$name; + } + } - $benutzer = new benutzer(); - $benutzer->load($uid); + $benutzer = new benutzer(); + $benutzer->load($uid); //new sanchomail $nameMitarbeiter = $benutzer->vorname. " ". $benutzer->nachname; @@ -238,7 +237,7 @@ if(isset($_GET['delete'])) { $vgmail="
".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."!"; } - } + } } } @@ -428,7 +427,7 @@ if(isset($_GET['speichern']) && isset($_GET['wtag'])) require_once('../../../addons/casetime/config.inc.php'); require_once('../../../addons/casetime/include/functions.inc.php'); $urlaubssaldo = getCastTimeUrlaubssaldo($uid); - $urlaubssaldo = "Aktueller Urlaubssaldo: ". $urlaubssaldo->{'AktuellerStand'} . " Tage"; + $urlaubssaldo = $urlaubssaldo->{'AktuellerStand'}; } //Sanchomail mit Vorlage Sancho Mail Urlaub Neu @@ -898,12 +897,12 @@ for ($i=0;$i<6;$i++) } elseif(isset($freigabeamum[$j+7*$i])) { - echo 'freigegeben '; + echo 'freigegeben '; if($hgfarbe[$j+7*$i]=='#CDDDEE') { $k=$j+7*$i; echo ""; - echo 'loeschen'; + echo 'loeschen'; } } else diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 87489d169..01306de98 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -356,7 +356,7 @@ if($addoncasetime) $zeitsaldo = getCaseTimeZeitsaldo($uid); $zeitsaldo = "Aktueller Zeitsaldo: ". $zeitsaldo . " (".formatZeitsaldo($zeitsaldo).")"; $urlaubssaldo = getCastTimeUrlaubssaldo($uid); - $urlaubssaldo = "Aktueller Urlaubssaldo: ". $urlaubssaldo->{'AktuellerStand'} . " Tage"; + $urlaubssaldo = $urlaubssaldo->{'AktuellerStand'}; } //Zeitsperre Speichern From f766f36095f5ff577868667ef878f61d60ff4110 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 10 Nov 2022 11:43:27 +0100 Subject: [PATCH 080/128] =?UTF-8?q?26113=20=C3=84nderung=20Mails=20Zeitsal?= =?UTF-8?q?do?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/zeitsperre_resturlaub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 01306de98..36271fde2 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -354,7 +354,7 @@ if($addoncasetime) require_once('../../../addons/casetime/config.inc.php'); require_once('../../../addons/casetime/include/functions.inc.php'); $zeitsaldo = getCaseTimeZeitsaldo($uid); - $zeitsaldo = "Aktueller Zeitsaldo: ". $zeitsaldo . " (".formatZeitsaldo($zeitsaldo).")"; + $zeitsaldo = formatZeitsaldo($zeitsaldo); $urlaubssaldo = getCastTimeUrlaubssaldo($uid); $urlaubssaldo = $urlaubssaldo->{'AktuellerStand'}; } From f72afe473c49cb12c9a8fbfc50e7901063dc90d0 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 10 Nov 2022 15:02:13 +0100 Subject: [PATCH 081/128] =?UTF-8?q?26112=20Vilesci-Kein=20L=C3=B6schen=20v?= =?UTF-8?q?on=20Zeitsperren=20bei=20abgeschickter=20Monatsliste=20m=C3=B6g?= =?UTF-8?q?lich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/personen/urlaubsverwaltung.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/vilesci/personen/urlaubsverwaltung.php b/vilesci/personen/urlaubsverwaltung.php index fec5222d7..f631aa081 100644 --- a/vilesci/personen/urlaubsverwaltung.php +++ b/vilesci/personen/urlaubsverwaltung.php @@ -70,7 +70,6 @@ if ($addoncasetime) require_once('../../addons/casetime/include/functions.inc.php'); } - //Kopfzeile echo ' @@ -91,7 +90,7 @@ echo ' '; - } + if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) + { + echo ' + '; + } } // Wenn Seite fertig geladen ist Addons aufrufen @@ -612,57 +609,58 @@ echo ' '; ?> - - - <?php echo $p->t('urlaubstool/urlaubstool');?> - + }, + select: function(event, ui) + { + //Ausgeaehlte Ressource zuweisen und Textfeld wieder leeren + $("#vertretung").val(ui.item.uid); + } + }); +}) + + +<?php echo $p->t('urlaubstool/urlaubstool');?> + ".$p->t('urlaubstool/urlaubstool')." (".$uid.")"; + //Anzeige Resturlaubsberechnung echo ''; echo ''; -for($i=1;$i<=7;$i++) +for($i=1; $i<=7; $i++) echo "\n".''; echo ''; -for ($i=0;$i<6;$i++) +for ($i=0; $i<6; $i++) { echo "\n".''; - for ($j=1;$j<8;$j++) + for ($j=1; $j<8; $j++) { echo "\n"; - if(strlen(stristr($tage[$j+7*$i],"."))>0) + if(strlen(stristr($tage[$j+7*$i], "."))>0) { if($j%6==0 || $j==7) { @@ -866,7 +864,7 @@ for ($i=0;$i<6;$i++) } if($tage[$j+7*$i]!='') { - if($hgfarbe[$j+7*$i]=='#FFFC7F' )//|| $hgfarbe[$j+7*$i]=='#CDDDEE') + if($hgfarbe[$j+7*$i]=='#FFFC7F')//|| $hgfarbe[$j+7*$i]=='#CDDDEE') { echo 't('urlaubstool/erreichbar').': '.$erreichbarkeit_kurzbz[$j+7*$i].'">'.$tage[$j+7*$i].'
';; $k=$j+7*$i; @@ -876,16 +874,16 @@ for ($i=0;$i<6;$i++) elseif($hgfarbe[$j+7*$i]=='#E9ECEE') { echo ''.$tage[$j+7*$i].'
'; - if(strlen(stristr($tage[$j+7*$i],"."))>0) + if(strlen(stristr($tage[$j+7*$i], "."))>0) { echo ''; + value="'.date("Y-m-d", mktime(0, 0, 0, substr($tage[$j+7*$i], 3, 2), substr($tage[$j+7*$i], 0, 2), substr($tage[$j+7*$i], 6, 4))).'" + id="'.date("d.m.Y", mktime(0, 0, 0, substr($tage[$j+7*$i], 3, 2), substr($tage[$j+7*$i], 0, 2), substr($tage[$j+7*$i], 6, 4))).'">'; } else { - echo ''; + echo ''; } } else @@ -897,12 +895,12 @@ for ($i=0;$i<6;$i++) } elseif(isset($freigabeamum[$j+7*$i])) { - echo 'freigegeben '; + echo 'freigegeben '; if($hgfarbe[$j+7*$i]=='#CDDDEE') { $k=$j+7*$i; echo ""; - echo 'loeschen'; + echo 'loeschen'; } } else From 37cbe5e8f775d868ae325695cd5eb97c35e27570 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 23 Nov 2022 07:24:48 +0100 Subject: [PATCH 084/128] - le details disablen bis der rebuild fertig ist --- content/lvplanung/lehrveranstaltungoverlay.js.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/lvplanung/lehrveranstaltungoverlay.js.php b/content/lvplanung/lehrveranstaltungoverlay.js.php index ac2c94948..c743ff389 100644 --- a/content/lvplanung/lehrveranstaltungoverlay.js.php +++ b/content/lvplanung/lehrveranstaltungoverlay.js.php @@ -43,6 +43,7 @@ var lehrveranstaltungLvGesamtNotenSelectUID=null; //LehreinheitID des Noten Eint var lehrveranstaltungNotenTreeloaded=false; var lehrveranstaltungGesamtNotenTreeloaded=false; var LehrveranstaltungAusbildungssemesterFilter=''; +var LeDetailsDisabled = false; //Damit die Details von der Lehreinheit disabled bleiben soland der Rebuild nicht fertig ist // Config-Eintrag, ob Vertragsdetails angezeigt werden sollen var lehrveranstaltung_vertragsdetails_anzeigen = Boolean(); @@ -80,6 +81,7 @@ var LvTreeListener = didRebuild : function(builder) { //debug('didrebuild'); + LeDetailsDisabled = false; //timeout nur bei Mozilla notwendig da sonst die rows //noch keine values haben. Ab Seamonkey funktionierts auch //ohne dem setTimeout @@ -452,7 +454,7 @@ function LvTreeSelectLehreinheit() return false; //In der globalen Variable ist die zu selektierende Lehreinheit gespeichert - if(LvSelectLehreinheit_id!=null) + if(LvSelectLehreinheit_id!=null && LeDetailsDisabled === false) { //Den Subtree der Lehrveranstaltung oeffnen zu der zuletzt die Lehreinheit gespeichert/angelegt wurde //da diese sonst nicht markiert werden kann @@ -754,6 +756,7 @@ function LeDetailSave() netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); document.getElementById('lehrveranstaltung-detail-checkbox-new').checked=false; LeDetailDisableFields(true); + LeDetailsDisabled = true; //LvTreeRefresh(); LvSelectLehreinheit_id=val.dbdml_data; LvOpenLehrveranstaltung_id=lehrveranstaltung; @@ -850,7 +853,8 @@ function LeAuswahl() } else { - LeDetailDisableFields(false); + if (LeDetailsDisabled === false) + LeDetailDisableFields(false); LehrveranstaltungNotenDisableFields(true); LehrveranstaltungNotenTreeUnload(); From 33eb1cb6af2921a4a6ee6decf5bef41c74b42803 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 23 Nov 2022 16:21:05 +0100 Subject: [PATCH 085/128] removed comment in Plausichecks.php controller --- application/controllers/system/issues/Plausichecks.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/controllers/system/issues/Plausichecks.php b/application/controllers/system/issues/Plausichecks.php index 588e35037..748361321 100644 --- a/application/controllers/system/issues/Plausichecks.php +++ b/application/controllers/system/issues/Plausichecks.php @@ -16,7 +16,6 @@ class Plausichecks extends Auth_Controller // Load libraries $this->load->library('issues/PlausicheckProducerLib'); $this->load->library('WidgetLib'); - //$this->load->library('IssuesLib'); // Load models $this->load->model('system/Fehler_model', 'FehlerModel'); From a2f65373cd3571d0d9524cc73eede566d6146ca8 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 24 Nov 2022 06:57:56 +0100 Subject: [PATCH 086/128] - fixed bug --- vilesci/stammdaten/auswertung_fhtw.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index a3928e7a1..01cf3094e 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -3381,7 +3381,7 @@ else $minutes = date('i', $time); if ($minutes <= 5) - echo ''; + echo ''; else { echo From d1a8ec7490a9297a887588becb66a189e2cbdef0 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 29 Nov 2022 08:15:22 +0100 Subject: [PATCH 087/128] Erweiterung und OrderBy der Abfragen um Dauer Auslandsaufenthalt --- cis/private/lehre/fotoliste.pdf.php | 5 +++-- include/lehrelisthelper.class.php | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cis/private/lehre/fotoliste.pdf.php b/cis/private/lehre/fotoliste.pdf.php index 353f3a2ad..881649ddf 100644 --- a/cis/private/lehre/fotoliste.pdf.php +++ b/cis/private/lehre/fotoliste.pdf.php @@ -180,7 +180,8 @@ $qry = 'SELECT DISTINCT ON tbl_person.matr_nr, tbl_person.geschlecht, tbl_person.foto, - tbl_person.foto_sperre + tbl_person.foto_sperre, + (tbl_bisio.bis::timestamp - tbl_bisio.von::timestamp) as daysout FROM campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid) @@ -200,7 +201,7 @@ $qry = 'SELECT DISTINCT ON if ($lehreinheit != '') $qry .= ' AND vw_student_lehrveranstaltung.lehreinheit_id=' . $db->db_add_param($lehreinheit, FHC_INTEGER); -$qry .= ' ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC'; +$qry .= ' ORDER BY nachname, vorname, person_id, daysout DESC'; $stsem_obj = new studiensemester(); $stsem_obj->load($studiensemester); diff --git a/include/lehrelisthelper.class.php b/include/lehrelisthelper.class.php index 31f6a067d..581c103cc 100644 --- a/include/lehrelisthelper.class.php +++ b/include/lehrelisthelper.class.php @@ -208,7 +208,8 @@ class LehreListHelper tbl_bisio.bisio_id, tbl_bisio.von, tbl_bisio.bis, tbl_student.studiengang_kz AS stg_kz_student, tbl_note.lkt_ueberschreibbar, tbl_note.anmerkung, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_studiengang.kurzbzlang, tbl_mobilitaet.mobilitaetstyp_kurzbz, tbl_zeugnisnote.note, - (CASE WHEN bis.tbl_mobilitaet.studiensemester_kurzbz = vw_student_lehrveranstaltung.studiensemester_kurzbz THEN 1 ELSE 0 END) as doubledegree + (CASE WHEN bis.tbl_mobilitaet.studiensemester_kurzbz = vw_student_lehrveranstaltung.studiensemester_kurzbz THEN 1 ELSE 0 END) as doubledegree, + (tbl_bisio.bis::timestamp - tbl_bisio.von::timestamp) as daysout FROM campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid) @@ -230,10 +231,11 @@ class LehreListHelper if($this->lehreinheit!='') $qry.=' AND vw_student_lehrveranstaltung.lehreinheit_id='.$this->db->db_add_param($this->lehreinheit, FHC_INTEGER); - $qry.=' ORDER BY nachname, vorname, person_id, tbl_bisio.bis, doubledegree DESC'; + $qry.=' ORDER BY nachname, vorname, person_id, daysout DESC, doubledegree DESC'; $stsem_obj = new studiensemester(); $stsem_obj->load($this->studiensemester); + $stsemdatumvon = $stsem_obj->start; $stsemdatumbis = $stsem_obj->ende; From 381fa2ed7e7d5cc99b05b565a24a232afac69ef2 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 29 Nov 2022 10:17:32 +0100 Subject: [PATCH 088/128] - bei der warnung buchung vorhanden, name hinzugefuegt --- content/student/studentDBDML.php | 16 ++++++++++++++++ content/student/studentoverlay.js.php | 6 +++--- include/konto.class.php | 24 ++++++++++++++---------- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index 68348adbf..22f6f0b53 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -2499,7 +2499,23 @@ if(!$error) } if($exists) + { $return = true; + $zusatz = "\n"; + if (count($exists) > 10) + { + $zusatz .= "und "; + $persons = implode("\n- ", array_slice($exists, 0, 10)); + if (count($exists) === 11) + $zusatz .= "einer weiteren Person."; + else + $zusatz .= (count($exists) - 10) . " weiteren Personen."; + } + else + $persons = implode("\n- ", $exists); + + $data = "Es ist bereits eine Buchung vorhanden:\n- ". $persons . $zusatz ." Trotzdem fortfahren?"; + } else $return = false; } diff --git a/content/student/studentoverlay.js.php b/content/student/studentoverlay.js.php index 3401c03d5..b01d6086b 100644 --- a/content/student/studentoverlay.js.php +++ b/content/student/studentoverlay.js.php @@ -3102,9 +3102,9 @@ function StudentKontoNeuSpeichern(dialog, person_ids, studiengang_kz) { exists = StudentCheckBuchung(person_ids, studiensemester_kurzbz, buchungstyp_kurzbz, studiengang_kz); } - if (exists) + if (exists.dbdml_return) { - if(!confirm('Die Buchung ist bereits vorhanden. Trotzdem fortfahren?')) + if(!confirm(exists.dbdml_data)) return false; } @@ -3159,7 +3159,7 @@ function StudentCheckBuchung(person_ids, studiensemester_kurzbz, buchungstyp_kur var val = new ParseReturnValue(response); - return(val.dbdml_return); + return val; } // ***** diff --git a/include/konto.class.php b/include/konto.class.php index 7849f2605..281ab77c7 100644 --- a/include/konto.class.php +++ b/include/konto.class.php @@ -967,19 +967,23 @@ class konto extends basis_db public function checkDoppelteBuchung($person_ids, $stsem, $typ) { - $qry = "SELECT betrag - FROM public.tbl_konto - WHERE person_id IN (".$this->implode4SQL(array_filter($person_ids)).") - AND studiensemester_kurzbz = ".$this->db_add_param($stsem)." - AND buchungstyp_kurzbz = ".$this->db_add_param($typ)." - GROUP BY buchungsnr"; + $qry = "SELECT person.vorname, person.nachname + FROM public.tbl_konto konto + JOIN public.tbl_person person USING(person_id) + WHERE konto.person_id IN (".$this->implode4SQL(array_filter($person_ids)).") + AND studiensemester_kurzbz = ".$this->db_add_param($stsem)." + AND buchungstyp_kurzbz = ".$this->db_add_param($typ)." + GROUP BY person.vorname, person.nachname + ORDER BY person.nachname, person.vorname"; if ($result = $this->db_query($qry)) { - if ($this->db_num_rows($result) > 0) - return true; - else - return false; + $persons = array(); + while ($row = $this->db_fetch_object($result)) + { + $persons[] = $row->nachname . ' ' . $row->vorname; + } + return $persons; } else { From d1ac2e042462bcc6c818e18a9a4a5a7e9c3b2885 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 30 Nov 2022 17:26:50 +0100 Subject: [PATCH 089/128] added plausicheck "getIncomingUndGsFoerderrelevant" --- .../libraries/issues/PlausicheckLib.php | 65 +++++++++++++++++++ .../issues/PlausicheckProducerLib.php | 1 + .../IncomingUndGsFoerderrelevant.php | 44 +++++++++++++ system/fehlerupdate.php | 8 +++ 4 files changed, 118 insertions(+) create mode 100644 application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php diff --git a/application/libraries/issues/PlausicheckLib.php b/application/libraries/issues/PlausicheckLib.php index d55e7dd39..951e77c7f 100644 --- a/application/libraries/issues/PlausicheckLib.php +++ b/application/libraries/issues/PlausicheckLib.php @@ -1162,6 +1162,71 @@ class PlausicheckLib return $this->_db->execReadOnlyQuery($qry, $params); } + /** + * Incoming or gemeinsame Studien students should not receive funding (not be förderrelevant). + * @param studiensemester_kurzbz string check is to be executed for certain Studiensemester + * @param studiengang_kz int if check is to be executed for certain Studiengang + * @param prestudent_id int if check is to be executed only for one prestudent + * @return object success or error + */ + public function getIncomingUndGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null) + { + $params = array($studiensemester_kurzbz, $studiensemester_kurzbz); + + $qry = " + SELECT + DISTINCT ON(prestudent_id) + pers.person_id, + ps.prestudent_id, + stg.oe_kurzbz AS prestudent_stg_oe_kurzbz + FROM + public.tbl_student stud + JOIN public.tbl_benutzer ON(student_uid=uid) + JOIN public.tbl_person pers USING(person_id) + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang stg ON(stg.studiengang_kz=stud.studiengang_kz) + WHERE + ( + EXISTS + ( + SELECT 1 + FROM + public.tbl_prestudentstatus + WHERE + prestudent_id = ps.prestudent_id + AND status_kurzbz = 'Incoming' + AND studiensemester_kurzbz = ? + ) + OR EXISTS ( + SELECT 1 + FROM + bis.tbl_mobilitaet + JOIN public.tbl_prestudent USING(prestudent_id) + WHERE + prestudent_id = ps.prestudent_id + AND gsstudientyp_kurzbz = 'Extern' + AND studiensemester_kurzbz = ? + ) + ) + AND (ps.foerderrelevant <> FALSE OR ps.foerderrelevant IS NULL) + AND bismelden=TRUE + AND stg.melderelevant"; + + if (isset($studiengang_kz)) + { + $qry .= " AND stg.studiengang_kz = ?"; + $params[] = $studiengang_kz; + } + + if (isset($prestudent_id)) + { + $qry .= " AND ps.prestudent_id = ?"; + $params[] = $prestudent_id; + } + + return $this->_db->execReadOnlyQuery($qry, $params); + } + //------------------------------------------------------------------------------------------------------------------ // Private methods diff --git a/application/libraries/issues/PlausicheckProducerLib.php b/application/libraries/issues/PlausicheckProducerLib.php index 74adb21dd..fb85cf98f 100644 --- a/application/libraries/issues/PlausicheckProducerLib.php +++ b/application/libraries/issues/PlausicheckProducerLib.php @@ -30,6 +30,7 @@ class PlausicheckProducerLib 'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus', 'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich', 'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz', + 'IncomingUndGsFoerderrelevant' => 'IncomingUndGsFoerderrelevant', 'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung', 'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde', 'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent', diff --git a/application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php b/application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php new file mode 100644 index 000000000..919fb8415 --- /dev/null +++ b/application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php @@ -0,0 +1,44 @@ +_ci->plausichecklib->getIncomingUndGsFoerderrelevant($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); + } +} diff --git a/system/fehlerupdate.php b/system/fehlerupdate.php index da4ebe12d..9cfa5a0c4 100644 --- a/system/fehlerupdate.php +++ b/system/fehlerupdate.php @@ -125,6 +125,14 @@ $fehlerArr = array( 'fehlertyp_kurzbz' => 'error', 'app' => 'core' ), + array( + 'fehlercode' => 'CORE_INOUT_0009', + 'fehler_kurzbz' => 'IncomingUndGsFoerderrelevant', + 'fehlercode_extern' => null, + 'fehlertext' => 'Incoming oder gemeinsames Studium ist nicht als nicht förderrelevant markiert. (prestudent_id %s)', + 'fehlertyp_kurzbz' => 'error', + 'app' => 'core' + ), array( 'fehlercode' => 'CORE_STG_0001', 'fehler_kurzbz' => 'StgPrestudentUngleichStgStudent', From 7d1267732f7f76ae0b63850c9023c7bbfdcaf77a Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 30 Nov 2022 17:53:36 +0100 Subject: [PATCH 090/128] IncomingOrGsFoerderrelevant plausicheck: added first version of issue resolver, renamed from IncomingAndGsFoerderrelevant --- .../controllers/jobs/IssueResolver.php | 1 + .../libraries/issues/PlausicheckLib.php | 2 +- .../issues/PlausicheckProducerLib.php | 2 +- ...nt.php => IncomingOrGsFoerderrelevant.php} | 4 +-- .../issues/resolvers/CORE_INOUT_0009.php | 29 +++++++++++++++++++ system/fehlerupdate.php | 2 +- 6 files changed, 35 insertions(+), 5 deletions(-) rename application/libraries/issues/plausichecks/{IncomingUndGsFoerderrelevant.php => IncomingOrGsFoerderrelevant.php} (85%) create mode 100644 application/libraries/issues/resolvers/CORE_INOUT_0009.php diff --git a/application/controllers/jobs/IssueResolver.php b/application/controllers/jobs/IssueResolver.php index d53a6c10c..78e867936 100755 --- a/application/controllers/jobs/IssueResolver.php +++ b/application/controllers/jobs/IssueResolver.php @@ -25,6 +25,7 @@ class IssueResolver extends IssueResolver_Controller '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', diff --git a/application/libraries/issues/PlausicheckLib.php b/application/libraries/issues/PlausicheckLib.php index 951e77c7f..07f091208 100644 --- a/application/libraries/issues/PlausicheckLib.php +++ b/application/libraries/issues/PlausicheckLib.php @@ -1169,7 +1169,7 @@ class PlausicheckLib * @param prestudent_id int if check is to be executed only for one prestudent * @return object success or error */ - public function getIncomingUndGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null) + public function getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null) { $params = array($studiensemester_kurzbz, $studiensemester_kurzbz); diff --git a/application/libraries/issues/PlausicheckProducerLib.php b/application/libraries/issues/PlausicheckProducerLib.php index fb85cf98f..c1e15151f 100644 --- a/application/libraries/issues/PlausicheckProducerLib.php +++ b/application/libraries/issues/PlausicheckProducerLib.php @@ -30,7 +30,7 @@ class PlausicheckProducerLib 'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus', 'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich', 'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz', - 'IncomingUndGsFoerderrelevant' => 'IncomingUndGsFoerderrelevant', + 'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant', 'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung', 'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde', 'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent', diff --git a/application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php b/application/libraries/issues/plausichecks/IncomingOrGsFoerderrelevant.php similarity index 85% rename from application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php rename to application/libraries/issues/plausichecks/IncomingOrGsFoerderrelevant.php index 919fb8415..0e12ccac8 100644 --- a/application/libraries/issues/plausichecks/IncomingUndGsFoerderrelevant.php +++ b/application/libraries/issues/plausichecks/IncomingOrGsFoerderrelevant.php @@ -7,7 +7,7 @@ require_once('PlausiChecker.php'); /** * */ -class IncomingUndGsFoerderrelevant extends PlausiChecker +class IncomingOrGsFoerderrelevant extends PlausiChecker { public function executePlausiCheck($params) { @@ -18,7 +18,7 @@ class IncomingUndGsFoerderrelevant extends PlausiChecker $studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null; // get all students failing the plausicheck - $prestudentRes = $this->_ci->plausichecklib->getIncomingUndGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz); + $prestudentRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz); if (isError($prestudentRes)) return $prestudentRes; diff --git a/application/libraries/issues/resolvers/CORE_INOUT_0009.php b/application/libraries/issues/resolvers/CORE_INOUT_0009.php new file mode 100644 index 000000000..b56344042 --- /dev/null +++ b/application/libraries/issues/resolvers/CORE_INOUT_0009.php @@ -0,0 +1,29 @@ +_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 + } +} diff --git a/system/fehlerupdate.php b/system/fehlerupdate.php index 9cfa5a0c4..98204315a 100644 --- a/system/fehlerupdate.php +++ b/system/fehlerupdate.php @@ -127,7 +127,7 @@ $fehlerArr = array( ), array( 'fehlercode' => 'CORE_INOUT_0009', - 'fehler_kurzbz' => 'IncomingUndGsFoerderrelevant', + 'fehler_kurzbz' => 'IncomingOrGsFoerderrelevant', 'fehlercode_extern' => null, 'fehlertext' => 'Incoming oder gemeinsames Studium ist nicht als nicht förderrelevant markiert. (prestudent_id %s)', 'fehlertyp_kurzbz' => 'error', From 6215786565cff89b810676b0ec18ef57c2bdedea Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 1 Dec 2022 10:20:10 +0100 Subject: [PATCH 091/128] - zeit staffelung hinzugefuegt --- vilesci/stammdaten/auswertung_fhtw.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index 01cf3094e..016bbe602 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -2488,8 +2488,7 @@ else } function prueflingAddTime(pruefling_id, gebiet) { - var datetime = $("#prueflingAddTime_" + pruefling_id + "_gebiet_" + gebiet).val(); - var min = parseInt(datetime.split(":")[1]); + var min = $("#prueflingAddTime_" + pruefling_id + "_gebiet_" + gebiet).val(); data = { pruefling_id: pruefling_id, gebiet: gebiet, @@ -3375,20 +3374,18 @@ else if (!is_null($erg->pruefling_id)) { - echo - ''; - if ($minutes <= 5) - echo ''; - else + for ($i = 2; $i <= 10; $i = $i +2) { - echo - ' - '; + if ($i < $minutes) + echo ''; } + echo ''; + echo ' From d24bc36bf76990be9be9ec8c9214ac3d4ab3d544 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 1 Dec 2022 11:07:47 +0100 Subject: [PATCH 092/128] - freischaltcode beim RT hinzugefuegt --- cis/testtool/login.php | 63 +++++++++++++++++-- include/reihungstest.class.php | 15 ++++- locale/de-AT/testtool.php | 3 + locale/en-US/testtool.php | 2 + system/dbupdate_3.4.php | 1 + ...82_reihungstest_zugangscode_fuer_login.php | 15 +++++ vilesci/stammdaten/reihungstestverwaltung.php | 28 +++++++++ 7 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 system/dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php diff --git a/cis/testtool/login.php b/cis/testtool/login.php index 43f157026..0b114b8c5 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -82,7 +82,8 @@ if (isset($_REQUEST['prestudent'])) $ps = new prestudent($_REQUEST['prestudent']); $login_ok = false; - if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL && isset($_GET['confirmation'])) + if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL && + (isset($_GET['confirmation']) || isset($_GET['confirmed_code']))) { if (isset($_SESSION['bewerbung/personId']) && $ps->person_id == $_SESSION['bewerbung/personId']) { @@ -153,6 +154,33 @@ if (isset($_REQUEST['prestudent'])) { // regenerate Session ID after Login session_regenerate_id(); + if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL) + { + if ($rt->zugangs_ueberpruefung && !is_null($rt->zugangscode)) + { + $_SESSION['confirmed_code'] = false; + if (isset($_SESSION['confirmation_needed']) && $_SESSION['confirmation_needed'] === true) + { + if (isset($_GET['confirmed_code'])) + { + if ($_GET['confirmed_code'] === $_SESSION['reihungstest_code']) + { + $_SESSION['confirmed_code'] = true; + } + else + $alertmsg .= '
Code ist nicht korrekt.
'; + } + } + + if ($_SESSION['confirmed_code'] === false) + { + $_SESSION['reihungstest_code'] = $rt->zugangscode; + $_SESSION['confirmation_needed'] = true; + } + else + $reload_menu = true; + } + } $pruefling = new pruefling(); if ($pruefling->getPruefling($ps->prestudent_id)) @@ -314,8 +342,11 @@ else } } - -if (isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id'])) +if ((isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']) && + !isset($_SESSION['confirmation_needed']) && !isset($_SESSION['confirmed_code'])) || + (isset($_SESSION['confirmation_needed']) && $_SESSION['confirmation_needed'] === true && + isset($_SESSION['confirmed_code']) && $_SESSION['confirmed_code'] === true && + isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']))) { $pruefling = new pruefling(); @@ -421,8 +452,32 @@ if (isset($_POST['save']) && isset($_SESSION['prestudent_id'])) +
+
'.$alertmsg.'
+
+ '.$p->t('testtool/freischalttext').' +
+
+ '.$p->t('testtool/freischaltcode').': +
+ + +
+
+ + +
+ '; +} //REIHUNGSTEST STARTSEITE (nach Login) -if (isset($prestudent_id)) +elseif (isset($prestudent_id)) { $prestudent = new prestudent($prestudent_id); $stg_obj = new studiengang($prestudent->studiengang_kz); diff --git a/include/reihungstest.class.php b/include/reihungstest.class.php index 0140816ab..30d603afc 100644 --- a/include/reihungstest.class.php +++ b/include/reihungstest.class.php @@ -60,6 +60,9 @@ class reihungstest extends basis_db public $anmeldedatum; // date public $teilgenommen; // boolean public $punkte; // numeric + + public $zugangs_ueberpruefung = false; //boolean + public $zugangscode; //smallint /** @@ -114,6 +117,8 @@ class reihungstest extends basis_db $this->stufe = $row->stufe; $this->anmeldefrist = $row->anmeldefrist; $this->aufnahmegruppe_kurzbz = $row->aufnahmegruppe_kurzbz; + $this->zugangs_ueberpruefung = $this->db_parse_bool($row->zugangs_ueberpruefung); + $this->zugangscode = $row->zugangscode; return true; } @@ -229,7 +234,7 @@ class reihungstest extends basis_db $qry = 'BEGIN; INSERT INTO public.tbl_reihungstest (studiengang_kz, ort_kurzbz, anmerkung, datum, uhrzeit, insertamum, insertvon, updateamum, updatevon, max_teilnehmer, oeffentlich, freigeschaltet, - studiensemester_kurzbz, stufe, anmeldefrist, aufnahmegruppe_kurzbz) VALUES('. + studiensemester_kurzbz, stufe, anmeldefrist, aufnahmegruppe_kurzbz, zugangs_ueberpruefung, zugangscode) VALUES('. $this->db_add_param($this->studiengang_kz, FHC_INTEGER).', '. $this->db_add_param($this->ort_kurzbz).', '. $this->db_add_param($this->anmerkung).', '. @@ -243,7 +248,9 @@ class reihungstest extends basis_db $this->db_add_param($this->studiensemester_kurzbz).','. $this->db_add_param($this->stufe, FHC_INTEGER).','. $this->db_add_param($this->anmeldefrist).','. - $this->db_add_param($this->aufnahmegruppe_kurzbz).');'; + $this->db_add_param($this->aufnahmegruppe_kurzbz). ',' . + $this->db_add_param($this->zugangs_ueberpruefung, FHC_BOOLEAN).','. + $this->db_add_param($this->zugangscode) . ');'; } else { @@ -261,7 +268,9 @@ class reihungstest extends basis_db 'studiensemester_kurzbz='.$this->db_add_param($this->studiensemester_kurzbz).', '. 'stufe='.$this->db_add_param($this->stufe, FHC_INTEGER).', '. 'anmeldefrist='.$this->db_add_param($this->anmeldefrist).', '. - 'aufnahmegruppe_kurzbz='.$this->db_add_param($this->aufnahmegruppe_kurzbz).' '. + 'aufnahmegruppe_kurzbz='.$this->db_add_param($this->aufnahmegruppe_kurzbz).', '. + 'zugangs_ueberpruefung='.$this->db_add_param($this->zugangs_ueberpruefung, FHC_BOOLEAN).', '. + 'zugangscode='.$this->db_add_param($this->zugangscode).' '. 'WHERE reihungstest_id='.$this->db_add_param($this->reihungstest_id, FHC_INTEGER, false).';'; } diff --git a/locale/de-AT/testtool.php b/locale/de-AT/testtool.php index dbafe21e9..60a625c99 100644 --- a/locale/de-AT/testtool.php +++ b/locale/de-AT/testtool.php @@ -79,5 +79,8 @@ $this->phrasen['testtool/einfuehrungsText']=' '; $this->phrasen['testtool/prueflingGesperrt']='Bitte kontaktieren Sie die Reihungstestaufsicht!'; +$this->phrasen['testtool/freischaltcode']='Freischaltcode'; +$this->phrasen['testtool/freischalttext']='Ihren Freischaltcode erhalten Sie am Tag des Reihungstests nach erfolgter Einführung im ZOOM-Meeting (siehe Leitfaden) von der Aufsicht.
Wir wünschen Ihnen viel Erfolg.'; + ?> diff --git a/locale/en-US/testtool.php b/locale/en-US/testtool.php index 473ac1e0d..5524d4304 100644 --- a/locale/en-US/testtool.php +++ b/locale/en-US/testtool.php @@ -51,4 +51,6 @@ $this->phrasen['testtool/keinPrueflingseintragVorhanden']='No candidate entry av $this->phrasen['testtool/fuerFolgendeStgAngemeldet']='You have applied for the following degree programs:'; $this->phrasen['testtool/invalideGebiete']='One or more question areas incorrect!
Please inform an assisting person.'; $this->phrasen['testtool/prueflingGesperrt']='Please contact the placement test supervisor!'; +$this->phrasen['testtool/freischaltcode']='Activation code'; +$this->phrasen['testtool/freischalttext']='You will receive your activation code on the day of the placement test after the introduction in the ZOOM meeting (see guideline) from the supervisor.
We wish you good luck.' ?> \ No newline at end of file diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 9d89de0d1..57f037d14 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -29,6 +29,7 @@ require_once('dbupdate_3.4/example2.php'); */ require_once('dbupdate_3.4/26173_index_webservicelog.php'); +require_once('dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php b/system/dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php new file mode 100644 index 000000000..e522df339 --- /dev/null +++ b/system/dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php @@ -0,0 +1,15 @@ +db_query("SELECT zugangs_ueberpruefung FROM public.tbl_reihungstest LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_reihungstest ADD COLUMN zugangs_ueberpruefung boolean NOT NULL DEFAULT false; + ALTER TABLE public.tbl_reihungstest ADD COLUMN zugangscode smallint DEFAULT NULL;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_reihungstest: '.$db->db_last_error().'
'; + else + echo '
public.tbl_reihungstest: Spalte zugangs_ueberpruefung und zugangscode hinzugefuegt'; +} \ No newline at end of file diff --git a/vilesci/stammdaten/reihungstestverwaltung.php b/vilesci/stammdaten/reihungstestverwaltung.php index 4db82d102..6fac37be7 100644 --- a/vilesci/stammdaten/reihungstestverwaltung.php +++ b/vilesci/stammdaten/reihungstestverwaltung.php @@ -847,6 +847,12 @@ if(isset($_GET['excel'])) if ($('.ort_listitem').length == 0 && $('#max_teilnehmer').val() == '' && $('#ort').val() == '') confirm('Wenn der Reihungstest "Öffentlich" ist, sollten Räume zugeteilt sein, oder "Max TeilnehmerInnen" gesetzt sein'); } + + if ($('#zugangs_ueberpruefung').is(":checked") && $('#zugangcode').val() == '') + { + alert('Wenn die Zugangsüberprüfung aktiviert ist, ist ein Zugangscode verpflichtend.'); + return false; + } }); if ($('#oeffentlich').is(":checked") && $('.ort_listitem').length == 0 && $('#max_teilnehmer').val() == '' && $('#ort').val() == '') @@ -1396,6 +1402,12 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $error = true; } } + + if (isset($_POST['zugangs_ueberpruefung']) && $_POST['zugangcode'] === '') + { + $messageError .= '

Der Zugangscode muss ausgefüllt sein, wenn die Zugangsüberprüfung aktiviert ist.

'; + $error = true; + } if(!$error) { @@ -1407,6 +1419,8 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $reihungstest->stufe = filter_input(INPUT_POST, 'stufe', FILTER_VALIDATE_INT); $reihungstest->aufnahmegruppe_kurzbz = filter_input(INPUT_POST, 'aufnahmegruppe'); $reihungstest->anmeldefrist = $datum_obj->formatDatum($_POST['anmeldefrist']); + $reihungstest->zugangs_ueberpruefung = false; + $reihungstest->zugangscode = null; } else { @@ -1421,6 +1435,8 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $reihungstest->anmeldefrist = $datum_obj->formatDatum($_POST['anmeldefrist']); $reihungstest->updateamum = date('Y-m-d H:i:s'); $reihungstest->updatevon = $user; + $reihungstest->zugangs_ueberpruefung = isset($_POST['zugangs_ueberpruefung']); + $reihungstest->zugangscode = ($_POST['zugangcode'] === '' ? null : $_POST['zugangcode']); } $reihungstest->studiengang_kz = $_POST['studiengang_kz']; //$reihungstest->ort_kurzbz = $_POST['ort_kurzbz']; @@ -2504,6 +2520,18 @@ $studienplaene_list = implode(',', array_keys($studienplaene_arr)); (Kurz vor Testbeginn aktivieren)
+ + + + + + + + From 41eaee41affe657a50c7a5b6311fad15aa2bd6f5 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 1 Dec 2022 17:18:18 +0100 Subject: [PATCH 093/128] getIncomingOrGsFoerderrelevant: studiensemester is checked only for prestudent status --- .../libraries/issues/PlausicheckLib.php | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/application/libraries/issues/PlausicheckLib.php b/application/libraries/issues/PlausicheckLib.php index 07f091208..5105169dd 100644 --- a/application/libraries/issues/PlausicheckLib.php +++ b/application/libraries/issues/PlausicheckLib.php @@ -1169,9 +1169,9 @@ class PlausicheckLib * @param prestudent_id int if check is to be executed only for one prestudent * @return object success or error */ - public function getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null) + public function getIncomingOrGsFoerderrelevant($studiensemester_kurzbz = null, $studiengang_kz = null, $prestudent_id = null) { - $params = array($studiensemester_kurzbz, $studiensemester_kurzbz); + $params = array(); $qry = " SELECT @@ -1184,19 +1184,11 @@ class PlausicheckLib JOIN public.tbl_benutzer ON(student_uid=uid) JOIN public.tbl_person pers USING(person_id) JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_prestudentstatus status USING(prestudent_id) JOIN public.tbl_studiengang stg ON(stg.studiengang_kz=stud.studiengang_kz) WHERE ( - EXISTS - ( - SELECT 1 - FROM - public.tbl_prestudentstatus - WHERE - prestudent_id = ps.prestudent_id - AND status_kurzbz = 'Incoming' - AND studiensemester_kurzbz = ? - ) + status.status_kurzbz = 'Incoming' OR EXISTS ( SELECT 1 FROM @@ -1205,13 +1197,18 @@ class PlausicheckLib WHERE prestudent_id = ps.prestudent_id AND gsstudientyp_kurzbz = 'Extern' - AND studiensemester_kurzbz = ? ) ) AND (ps.foerderrelevant <> FALSE OR ps.foerderrelevant IS NULL) AND bismelden=TRUE AND stg.melderelevant"; + if (isset($studiensemester_kurzbz)) + { + $qry .= " AND status.studiensemester_kurzbz = ?"; + $params[] = $studiensemester_kurzbz; + } + if (isset($studiengang_kz)) { $qry .= " AND stg.studiengang_kz = ?"; From ad19e0ed75f93a1f46b8687148a1ef225f3f57ba Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 12 Dec 2022 07:55:36 +0100 Subject: [PATCH 094/128] - im fas die unr hinzugefuegt --- content/lvplanung/lehrveranstaltungoverlay.xul.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/lvplanung/lehrveranstaltungoverlay.xul.php b/content/lvplanung/lehrveranstaltungoverlay.xul.php index 4fde1fcc3..0ebc0b178 100644 --- a/content/lvplanung/lehrveranstaltungoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungoverlay.xul.php @@ -216,6 +216,10 @@ echo ' +
'; @@ -708,7 +706,7 @@ echo ' style="vertical-align: middle;" alt="links">  \n"; echo ' '; echo ' '; //Tage -$mbeginn=mktime(0, 0, 0, ($wmonat+1) , 1, $jahre[$wjahr]); +$mbeginn=mktime(0, 0, 0, ($wmonat+1), 1, $jahre[$wjahr]); $ttt=getdate($mbeginn); $wotag="$ttt[wday]"; if ($wotag==0) @@ -786,9 +784,9 @@ else { $mendev = cal_days_in_month(CAL_GREGORIAN, ($wmonat), $jahre[$wjahr]); } -$ttt=getdate(mktime(0, 0, 0, ($wmonat+1) , $mende, $jahre[$wjahr])); +$ttt=getdate(mktime(0, 0, 0, ($wmonat+1), $mende, $jahre[$wjahr])); //echo "monatsende:".$mende; -for($i=1;$i<43;$i++) +for($i=1; $i<43; $i++) { if($i>=$wotag && $zaehl<=$mende) { @@ -799,22 +797,22 @@ for($i=1;$i<43;$i++) { if($wmonat==0) { - $tage[$i]=date("d.m.Y", mktime(0, 0, 0, 12 , $mendev+$i-($wotag-1), $jahre[$wjahr]-1)); + $tage[$i]=date("d.m.Y", mktime(0, 0, 0, 12, $mendev+$i-($wotag-1), $jahre[$wjahr]-1)); } else { - $tage[$i]=date("d.m.Y", mktime(0, 0, 0, ($wmonat) , $mendev+$i-($wotag-1), $jahre[$wjahr])); + $tage[$i]=date("d.m.Y", mktime(0, 0, 0, ($wmonat), $mendev+$i-($wotag-1), $jahre[$wjahr])); } } elseif ($i>$mende && $i<=$mende+($wotag-1)+(7-($ttt['wday']==0?7:$ttt['wday']))) { if($wmonat==11) { - $tage[$i]=date("d.m.Y", mktime(0, 0, 0, 1 , $i-$mende-$wotag+1, $jahre[$wjahr+1])); + $tage[$i]=date("d.m.Y", mktime(0, 0, 0, 1, $i-$mende-$wotag+1, $jahre[$wjahr+1])); } else { - $tage[$i]=date("d.m.Y", mktime(0, 0, 0, ($wmonat+2) , $i-$mende-$wotag+1, $jahre[$wjahr])); + $tage[$i]=date("d.m.Y", mktime(0, 0, 0, ($wmonat+2), $i-$mende-$wotag+1, $jahre[$wjahr])); } } else @@ -832,17 +830,17 @@ echo '
'.$tagbez[$lang->index][$i].'
Zugangsüberprüfung + zugangs_ueberpruefung ? 'checked="checked"' : '' ?>> +
Zugangscode + (Verpflichtend, wenn die Zugangsüberprüfung aktiviert ist) +