diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 380a629e9..a6463cb5b 100755 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -107,9 +107,9 @@ $config['fhc_acl'] = array 'lehre.tbl_projekttyp' => 'basis/projekttyp', 'lehre.tbl_pruefung' => 'basis/pruefung', 'lehre.tbl_pruefungstyp' => 'basis/pruefungstyp', - 'lehre.tbl_studienordnung' => 'basis/studienordnung', - 'lehre.tbl_studienordnungstatus' => 'basis/studienordnungstatus', - 'lehre.tbl_studienplan' => 'basis/studienplan', + 'lehre.tbl_studienordnung' => 'lehre/studienordnung', + 'lehre.tbl_studienordnungstatus' => 'lehre/studienordnungstatus', + 'lehre.tbl_studienplan' => 'lehre/studienplan', 'lehre.tbl_studienplatz' => 'basis/studienplatz', 'lehre.tbl_studienplan_semester' => 'basis/studienplan_semester', 'lehre.tbl_stunde' => 'basis/stunde', diff --git a/application/controllers/DBTools.php b/application/controllers/DBTools.php index d7e0ca00a..02480df2a 100644 --- a/application/controllers/DBTools.php +++ b/application/controllers/DBTools.php @@ -34,7 +34,7 @@ class DBTools extends FHC_Controller { parent::__construct(); - $seed_path = APPPATH.'seeds/'; + $this->seed_path = APPPATH.'seeds/'; if ($this->input->is_cli_request()) { @@ -54,9 +54,9 @@ class DBTools extends FHC_Controller $this->load->library('migration'); // If not set, set it - //$this->seed_path !== '' OR $this->seed_path = APPPATH.'seeds/'; + $this->seed_path !== '' OR $this->seed_path = APPPATH.'seeds/'; // Add trailing slash if not set - //$this->seed_path = rtrim($this->seed_path, '/').'/'; + $this->seed_path = rtrim($this->seed_path, '/').'/'; // Load seed language $this->lang->load('seed'); @@ -78,9 +78,9 @@ class DBTools extends FHC_Controller public function index() { $result = "The following are the available command line interface commands\n\n"; - $result .= "php index.ci.php DBTools migrate [\"version_number\"] Run all migrations. "; + $result .= "php index.ci.php DBTools migrate [\"version_number\"] Run migrations. (latest/current) "; $result .= "The version number is optional.\n"; - $result .= "php index.ci.php DBTools seed \"file_name\" Run the specified seed file.\n"; + $result .= "php index.ci.php DBTools seed [\"file_name\"] Run the specified seed (Name of Seed. expl: 'Organisation').\n"; echo $result.PHP_EOL; } @@ -262,6 +262,68 @@ class DBTools extends FHC_Controller return $seeds; } +/** + * Truncate DB from Testdata + * + * @param string $name Name of the seed file. + * @return bool + */ + public function truncate($name) + { + $seeds = $this->findSeeds(); + + if (empty($name)) + { + $this->_error_string = $this->lang->line('seed_none_found'); + return false; + } + + $method = 'truncate'; + $pending = array(); + + + foreach ($seeds as $number => $file) + { + include_once($file); + $class = 'Seed_'.ucfirst(strtolower($this->_getSeedName(basename($file, '.php')))); + + // Validate the seed file structure + if (! class_exists($class, false)) + { + $this->_error_string = sprintf($this->lang->line('seed_class_doesnt_exist'), $class); + return false; + } + // method_exists() returns true for non-public methods, + // while is_callable() can't be used without instantiating. + // Only get_class_methods() satisfies both conditions. + elseif (! in_array($method, array_map('strtolower', get_class_methods($class)))) + { + $this->_error_string = sprintf($this->lang->line('seed_missing_'.$method.'_method'), $class); + return false; + } + + $pending[$number] = array($class, $method); + } + + // Now just run the necessary seeds + foreach ($pending as $number => $seed) + { + if (is_null($name)) + { + log_message('debug', 'Seeding '.$method); + + $seed[0] = new $seed[0]; + call_user_func($seed); + } + elseif ($seed[0] == 'Seed_'.$name) + { + log_message('debug', 'Seeding '.$method); + + $seed[0] = new $seed[0]; + call_user_func($seed); + } + } + } /** * Extracts the seed number from a filename * diff --git a/application/libraries/MessageLib.php b/application/libraries/MessageLib.php index 24f8568b1..2fe4735d5 100644 --- a/application/libraries/MessageLib.php +++ b/application/libraries/MessageLib.php @@ -293,86 +293,7 @@ class MessageLib // ------------------------------------------------------------------------ - /** - * reply_to_message() - replies to internal message. This function will NOT create a new thread or participant list - * - * @param integer $msg_id REQUIRED - * @param integer $sender_id REQUIRED - * @param string $subject - * @param string $body - * @param integer $priority - * @return array - */ - function reply_to_message($msg_id, $sender_id, $subject = '', $body = '', $priority = PRIORITY_NORMAL) - { - if (empty($sender_id)) - { - return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID); - } - - if (empty($msg_id)) - { - return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); - } - - if ($new_msg_id = $this->ci->message_model->reply_to_message($msg_id, $sender_id, $body, $priority)) - { - return $this->_success($new_msg_id, MSG_MESSAGE_SENT); - } - - // General Error Occurred - return $this->_general_error(); - } - - // ------------------------------------------------------------------------ - - /** - * get_participant_list() - returns list of participants on given thread. If sender_id set, sender_id will be left off list - * - * @param integer $thread_id REQUIRED - * @param integer $sender_id REQUIRED - * @return array - */ - function get_participant_list($thread_id, $sender_id = 0) - { - if (empty($thread_id)) - { - return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); - } - - if ($participants = $this->ci->message_model-> get_participant_list($thread_id, $sender_id)) - { - return $this->_success($participants); - } - - // General Error Occurred - return $this->_general_error(); - } - - // ------------------------------------------------------------------------ - - /** - * get_msg_count() - returns integer with count of message for user, by status. defaults to new messages - * - * @param integer $user_id REQUIRED - * @param integer $status_id OPTIONAL - defaults to "Unread" - * @return array - */ - function get_msg_count($user_id, $status_id = MSG_STATUS_UNREAD) - { - if (empty($user_id)) - { - return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); - } - - if (is_numeric($message = $this->ci->message_model->get_msg_count($user_id, $status_id))) - { - return $this->_success($message); - } - - // General Error Occurred - return $this->_general_error(); - } + // ------------------------------------------------------------------------ // Private Functions from here out! @@ -422,4 +343,4 @@ class MessageLib 'msg' => lang('message_'.$error) ); } -} \ No newline at end of file +} diff --git a/application/seeds/001_organisation.php b/application/seeds/001_organisation.php new file mode 100644 index 000000000..88a717611 --- /dev/null +++ b/application/seeds/001_organisation.php @@ -0,0 +1,170 @@ +fhc =& get_instance(); + $this->fhc->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); + + $pre = 'INSERT INTO public.tbl_organisationseinheit VALUES ('; + $post = '; '; + + $sql = "INSERT INTO public.tbl_organisationseinheittyp VALUES ('Seminar'); "; + $sql .= "INSERT INTO public.tbl_organisationseinheittyp VALUES ('Lehrgang'); "; + $sql .= "INSERT INTO public.tbl_studiengangstyp VALUES ('d', 'Diplom'); "; + + $sql .= "$pre 'fhstp', NULL, 'Fachhochschule St. Pölten', 'Erhalter', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL)$post"; + $sql .= "$pre 'depcon', 'fhstp', 'Studienzentrum', 'Studienzentrum', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL)$post"; + $sql .= "$pre 'depwi', 'depcon', 'Medien und Wirtschaft', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL)$post"; + $sql .= "$pre 'lmsc', 'depwi', 'LMSC', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'depgus', 'depcon', 'Gesundheit', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'ldem', 'depgus', 'LDEM', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'depsoz', 'depcon', 'Soziales', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsbz', 'depsoz', 'LSBZ', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bum', 'depwi', 'BUM', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lmom', 'depwi', 'LMOM', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lmmo', 'depwi', 'LMMO', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lmem', 'depwi', 'LMEM', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bdi', 'depgus', 'BDI', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsom', 'depsoz', 'LSOM', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'laet', 'depgus', 'LAET', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bpt', 'depgus', 'BPT', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'depet', 'depcon', 'Bahntechnologie und Mobilität', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mbm', 'depet', 'MBM', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bmk', 'depwi', 'BMK', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'deptech', 'depcon', 'Medien und Digitale Technologien', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'levd', 'deptech', 'LEVD', 'Lehrgang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bmt', 'deptech', 'BMT', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsma', 'depsoz', 'LSMA', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'levm', 'depwi', 'LEVM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'dso', 'depsoz', 'DSO', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lmev', 'depwi', 'LMEV', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'levt', 'deptech', 'LEVT', 'Lehrgang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lcma', 'depwi', 'LCMA', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lpmf', 'deptech', 'LPMF', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mdh', 'deptech', 'MDH', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lafg', 'deptech', 'LAFG', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lpwk', 'deptech', 'LPWK', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lwkf', 'deptech', 'LWKF', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bdb', 'depwi', 'BDB', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'dtm', 'deptech', 'DTM', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'dmm', 'depwi', 'DMM', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'dcs', 'deptech', 'DCS', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bid', 'deptech', 'BID', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lvjg', 'depwi', 'LVJG', 'Lehrgang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lrdm', 'depwi', 'LRDM', 'Lehrgang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lptm', 'deptech', 'LPTM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mid', 'deptech', 'MID', 'Studiengang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lebs', 'depet', 'LEBS', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'depit', 'depcon', 'Informatik und Security', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mis', 'depit', 'MIS', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bmm', 'depwi', 'BMM', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bso', 'depsoz', 'BSO', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mmm', 'depwi', 'MMM', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'msa', 'depsoz', 'MSA', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lfmr', 'depsoz', 'LFMR', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lspm', 'depsoz', 'LSPM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mso', 'depsoz', 'MSO', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsbl', 'depsoz', 'LSBL', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsbm', 'depsoz', 'LSBM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bbm', 'depet', 'BBM', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mdm', 'deptech', 'MDM', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mmk', 'depwi', 'MMK', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bse', 'deptech', 'BSE', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lspa', 'depsoz', 'LSPA', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'ltti', 'depet', 'LTTI', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lcmm', 'depwi', 'LCMM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lmcm', 'depwi', 'LMCM', 'Lehrgang', false, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lits', 'depit', 'LITS', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bis', 'depit', 'BIS', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bgk', 'depgus', 'BGK', 'Studiengang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lfea', 'depet', 'LFEA', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsak', 'depsoz', 'LSAK', 'Seminar', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lksp', 'depsoz', 'LKSP', 'Seminar', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lpvp', 'depgus', 'LPVP', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'latm', 'deptech', 'LATM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lftm', 'deptech', 'LFTM', 'Lehrgang', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsmm', 'depsoz', 'LSMM', 'Lehrgang', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lsbt', 'depet', 'LSBT', 'Seminar', true, true, NULL, NULL, true, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'gw', 'depgus', 'Institut für Gesundheitswissenschaften', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'fhsc', 'fhstp', 'Services', 'Abteilung', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'fhshsm', 'fhsc', 'Services für Hochschulmanagement und -Organisation', 'Abteilung', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'peui', 'fhshsm', 'Programmentwicklung und Innovation', 'Abteilung', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'pers_recht', 'fhshsm', 'Personal und Recht', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'fhsl', 'fhsc', 'Services für Lehre', 'Abteilung', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'skill', 'fhsl', 'SKILL (Service- und Kompetenzzentrum für Innovatives Lehren und Lernen)', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mkt', 'fhshsm', 'Marketing und Unternehmenskommunikation', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'nsc', 'fhshsm', 'IT und Infrastruktur', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'qm', 'fhshsm', 'Qualitätsmanagement', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'frw', 'fhshsm', 'Finanzwesen und Controlling', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'bibl', 'fhshsm', 'Bibliothek', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'fhsfwt', 'fhsc', 'Services für Forschung und Wissenstransfer', 'Abteilung', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'csc', 'fhshsm', 'Campus Service Center', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'acc', 'fhshsm', 'Alumni und Career Center', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'luso', 'fhsl', 'Lehr- und Studienorganisation', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'fh_kollegium', 'fhstp', 'FH-Kollegium', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'ro', 'fhsfwt', 'Forschung und Wissenstransfer', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'io', 'fhsfwt', 'International Office', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'recht', 'pers_recht', 'Recht', 'Lehrgang', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'lppm', 'deptech', 'LPPM', 'Lehrgang', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mi', 'deptech', 'Medieninformatik', 'Institut', false, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'ia', 'depsoz', 'Ilse Arlt Institut für Soziale Inklusionsforschung', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'icmt', 'deptech', 'Institut für CreativeMediaTechnologies', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'gf', 'fhstp', 'Geschäftsführung', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'sf', 'depit', 'Institut für IT Sicherheitsforschung', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'mw', 'depwi', 'Institut für Medienwirtschaft', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'crvg', 'depet', 'Carl Ritter von Ghega Institut für integrierte Mobilitätsforschung', 'Institut', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'hsm', 'fhstp', 'Hochschulmanagement', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'cr', 'fhstp', 'Campus Radio', 'Abteilung', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'abfctv', 'deptech', 'Ausbildungsfernsehen c-tv', 'Abteilung', true, false, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + $sql .= "$pre 'jrz', 'depit', 'Josef Ressel-Zentrum für konsolidierte Erkennung gezielter Angriffe', 'Studienzentrum', true, true, NULL, NULL, false, NULL, NULL, NULL, NULL) $post"; + + // Studiengaenge + $pre = 'INSERT INTO public.tbl_studiengang VALUES '; + $post = '; '; + + $sql .= "$pre (3, 'bum', 'BUM', 'b', 'BUM', 'BUM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (4, 'bdi', 'BDI', 'b', 'BDI', 'BDI', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (5, 'bpt', 'BPT', 'b', 'BPT', 'BPT', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (6, 'mbm', 'MBM', 'm', 'MBM', 'MBM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (7, 'bmk', 'BMK', 'b', 'BMK', 'BMK', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (8, 'bmt', 'BMT', 'b', 'BMT', 'BMT', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (9, 'dso', 'DSO', 'd', 'DSO', 'DSO', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (10, 'mdh', 'MDH', 'm', 'MDH', 'MDH', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (11, 'bdb', 'BDB', 'b', 'BDB', 'BDB', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (12, 'dtm', 'DTM', 'd', 'DTM', 'DTM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (13, 'dmm', 'DMM', 'd', 'DMM', 'DMM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (14, 'dcs', 'DCS', 'd', 'DCS', 'DCS', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (15, 'bid', 'BID', 'b', 'BID', 'BID', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (16, 'mid', 'MID', 'm', 'MID', 'MID', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (17, 'mis', 'MIS', 'm', 'MIS', 'MIS', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (18, 'bmm', 'BMM', 'b', 'BMM', 'BMM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (19, 'bso', 'BSO', 'b', 'BSO', 'BSO', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (20, 'mmm', 'MMM', 'm', 'MMM', 'MMM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (21, 'msa', 'MSA', 'm', 'MSA', 'MSA', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (22, 'mso', 'MSO', 'm', 'MSO', 'MSO', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (23, 'bbm', 'BBM', 'b', 'BBM', 'BBM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (24, 'mdm', 'MDM', 'm', 'MDM', 'MDM', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (25, 'mmk', 'MMK', 'm', 'MMK', 'MMK', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (26, 'bse', 'BSE', 'b', 'BSE', 'BSE', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (27, 'bis', 'BIS', 'b', 'BIS', 'BIS', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + $sql .= "$pre (28, 'bgk', 'BGK', 'b', 'BGK', 'BGK', NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, 'VZ')$post"; + + + $this->fhc->db->query($sql); + echo PHP_EOL; + + } + + public function truncate() + { + //$this->db->query('EMPTY TABLE public.person;'); + } +} + diff --git a/application/seeds/002_studienordnung.php b/application/seeds/002_studienordnung.php new file mode 100644 index 000000000..2cc3bf8e0 --- /dev/null +++ b/application/seeds/002_studienordnung.php @@ -0,0 +1,142 @@ +fhc =& get_instance(); + } + + public function seed($limit = 25) + { + //$this->fhc =& get_instance(); + $this->fhc->load->model('organisation/Studienordnung_model', 'StudienordnungModel'); + $this->fhc->load->model('organisation/Studienplan_model', 'StudienplanModel'); + + // Studienordnung + echo "Seeding about $limit Studienordnungen "; + $data = array('studiengang_kz' =>3, 'bezeichnung' => 'BUM-WS2016-VZ'); + $studienordnung_id = $this->fhc->StudienordnungModel->insert($data)->retval; + $data = array('studiengang_kz' =>4, 'bezeichnung' => 'BDI-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>5, 'bezeichnung' => 'BPT-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>6, 'bezeichnung' => 'MBM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>7, 'bezeichnung' => 'BMK-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>8, 'bezeichnung' => 'BMT-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>9, 'bezeichnung' => 'DSO-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>10, 'bezeichnung' => 'MDH-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>11, 'bezeichnung' => 'BDB-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>12, 'bezeichnung' => 'DTM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>13, 'bezeichnung' => 'DMM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>14, 'bezeichnung' => 'DCS-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>15, 'bezeichnung' => 'BID-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>16, 'bezeichnung' => 'MID-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>17, 'bezeichnung' => 'MIS-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>18, 'bezeichnung' => 'BMM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>19, 'bezeichnung' => 'BSO-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>20, 'bezeichnung' => 'MMM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>21, 'bezeichnung' => 'MSA-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>22, 'bezeichnung' => 'MSO-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>23, 'bezeichnung' => 'BBM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>24, 'bezeichnung' => 'MDM-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>25, 'bezeichnung' => 'MMK-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>26, 'bezeichnung' => 'BSE-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>27, 'bezeichnung' => 'BIS-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + $data = array('studiengang_kz' =>28, 'bezeichnung' => 'BGK-WS2016-VZ'); + $this->fhc->StudienordnungModel->insert($data); + + //Studienplan + echo "Seeding about $limit Studienplaene "; + $data = array('studienordnung_id' => $studienordnung_id, 'bezeichnung' => 'BUM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+1, 'bezeichnung' => 'BDI-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+2, 'bezeichnung' => 'BPT-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+3, 'bezeichnung' => 'MBM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+4, 'bezeichnung' => 'BMK-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+5, 'bezeichnung' => 'BMT-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+6, 'bezeichnung' => 'DSO-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+7, 'bezeichnung' => 'MDH-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+8, 'bezeichnung' => 'BDB-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+9, 'bezeichnung' => 'DTM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' => $studienordnung_id+10, 'bezeichnung' => 'DMM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+11, 'bezeichnung' => 'DCS-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+12, 'bezeichnung' => 'BID-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+13, 'bezeichnung' => 'MID-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+14, 'bezeichnung' => 'MIS-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+15, 'bezeichnung' => 'BMM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+16, 'bezeichnung' => 'BSO-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+17, 'bezeichnung' => 'MMM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+18, 'bezeichnung' => 'MSA-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+19, 'bezeichnung' => 'MSO-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+20, 'bezeichnung' => 'BBM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+21, 'bezeichnung' => 'MDM-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+22, 'bezeichnung' => 'MMK-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+23, 'bezeichnung' => 'BSE-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+24, 'bezeichnung' => 'BIS-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + $data = array('studienordnung_id' =>$studienordnung_id+25, 'bezeichnung' => 'BGK-WS2016-VZ'); + $this->fhc->StudienplanModel->insert($data); + + // Studienplaene + + + echo PHP_EOL; + + } + + public function truncate() + { + echo "Truncating Studienordnungen and Studienplaene!"; + $this->fhc->db->query('DELETE FROM lehre.tbl_studienplan WHERE studienordnung_id>1;'); + $this->fhc->db->query('DELETE FROM lehre.tbl_studienordnung WHERE studienordnung_id>1;'); + } +} + diff --git a/application/seeds/001_person.php b/application/seeds/003_person.php similarity index 100% rename from application/seeds/001_person.php rename to application/seeds/003_person.php diff --git a/application/seeds/002_prestudent.php b/application/seeds/004_prestudent.php similarity index 100% rename from application/seeds/002_prestudent.php rename to application/seeds/004_prestudent.php diff --git a/application/seeds/003_message.php b/application/seeds/005_message.php similarity index 100% rename from application/seeds/003_message.php rename to application/seeds/005_message.php diff --git a/ci_db_extra.php b/ci_db_extra.php index dbdf590d2..a4dffc19b 100755 --- a/ci_db_extra.php +++ b/ci_db_extra.php @@ -19,6 +19,14 @@ trait db_extra } } + public function db_num_rows($result=null) + { + if(is_null($result)) + return pg_num_rows($this->db_result); + else + return pg_num_rows($result); + } + public function db_fetch_object($result = null, $i=null) { if(is_null($result)) @@ -150,4 +158,4 @@ trait db_extra { return pg_last_error(); } -} \ No newline at end of file +} diff --git a/config/system.config-default.inc.php b/config/system.config-default.inc.php index 7bda3b927..55afb3e0f 100644 --- a/config/system.config-default.inc.php +++ b/config/system.config-default.inc.php @@ -17,6 +17,9 @@ define("DB_CONNECT_PERSISTENT",FALSE); define('CONN_CLIENT_ENCODING','UTF-8' ); + // Dokumentenmanagement + define('DMS_PATH','/var/fhcomplete/documents/dms/'); + // Fuer Mails etc define('DOMAIN','technikum-wien.at'); diff --git a/system/checksystem.php b/system/checksystem.php index 3ee4685b6..fb26e63cf 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -124,6 +124,7 @@ $berechtigungen = array( array('lehre/reservierung:begrenzt','normale Raumreservierung im CIS'), array('lehre/studienordnung','Studienordnung'), array('lehre/studienordnungInaktiv','Studienordnung Inaktiv'), + array('lehre/studienplan','Studienplan'), array('lehre/vorrueckung','Lehreinheitenvorrückung'), array('lv-plan','Stundenplan'), array('lv-plan/gruppenentfernen','Erlaut das Entfernen von Gruppen aus LVPlan vom FAS aus'), diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index 0e80a45ab..d309f81af 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -21,6 +21,18 @@ * Dieses Skript prueft die Datenbank auf aktualitaet, dabei werden fehlende Attribute angelegt. */ +// Defaultwerte in tbl_studiengang +$qry = "ALTER TABLE public.tbl_studiengang ALTER COLUMN testtool_sprachwahl SET DEFAULT true; +ALTER TABLE public.tbl_studiengang ALTER COLUMN projektarbeit_note_anzeige SET DEFAULT true; +ALTER TABLE lehre.tbl_studienplan ALTER COLUMN testtool_sprachwahl SET DEFAULT true; +ALTER TABLE lehre.tbl_studienplan ALTER COLUMN aktiv SET DEFAULT true;"; + +if(!$db->db_query($qry)) + echo 'public.tbl_studiengang: '.$db->db_last_error().'
'; +else + echo 'Defaultwerte für tbl_studiengang und tbl_studienplan gesetzt.'; + + //Spalte studiensemester_kurzbz für Reihungstest if(!$result = @$db->db_query("SELECT studiensemester_kurzbz FROM public.tbl_reihungstest LIMIT 1")) {