diff --git a/application/config/migration.php b/application/config/migration.php index 102054bae..e9a4e86f8 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -23,7 +23,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = '009'; +$config['migration_version'] = '011'; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php index 3a3412db0..7ea27576f 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -120,7 +120,7 @@ class Prestudent extends APIv1_Controller { $this->load->model('crm/RtPerson_model', 'RtPersonModel'); - if(isset($ddReihungstest['new']) && $ddReihungstest['new'] === true) + if(isset($ddReihungstest['new']) && $ddReihungstest['new'] == true) { // Remove new parameter to avoid DB insert errors unset($ddReihungstest['new']); @@ -149,8 +149,7 @@ class Prestudent extends APIv1_Controller private function _validateAddReihungstest($ddReihungstest = NULL) { - if (!isset($ddReihungstest['person_id']) || !isset($ddReihungstest['rt_id']) || - !isset($ddReihungstest['ort_kurzbz'])) + if (!isset($ddReihungstest['person_id']) || !isset($ddReihungstest['rt_id'])) { return false; } diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php index 3ab4575ef..514c7ee2a 100644 --- a/application/controllers/api/v1/crm/Reihungstest.php +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -85,7 +85,7 @@ class Reihungstest extends APIv1_Controller $result = $this->ReihungstestModel->addJoin('public.tbl_person', 'person_id'); if ($result->error == EXIT_SUCCESS) { - $result = $this->ReihungstestModel->addJoin('public.tbl_ort', 'tbl_ort.ort_kurzbz = tbl_rt_person.ort_kurzbz'); + $result = $this->ReihungstestModel->addJoin('public.tbl_ort', 'tbl_ort.ort_kurzbz = tbl_rt_person.ort_kurzbz', 'LEFT'); if ($result->error == EXIT_SUCCESS) { $result = $this->ReihungstestModel->loadWhere(array('person_id' => $person_id)); diff --git a/application/controllers/system/Phrases.php b/application/controllers/system/Phrases.php index f03e299fd..bd8f8d29d 100644 --- a/application/controllers/system/Phrases.php +++ b/application/controllers/system/Phrases.php @@ -135,6 +135,7 @@ class Phrases extends FHC_Controller { $phrase_inhalt_id = $this->input->post('phrase_inhalt_id', TRUE); $data['orgeinheit_kurzbz'] = $this->input->post('oe_kurzbz', TRUE); + $data['orgform_kurzbz'] = $this->input->post('orgform_kurzbz', TRUE); $data['text'] = $this->input->post('text', TRUE); $data['description'] = $this->input->post('description', TRUE); $data['sprache'] = $this->input->post('sprache', TRUE); diff --git a/application/libraries/MigrationLib.php b/application/libraries/MigrationLib.php index 747f094e0..1867031f1 100644 --- a/application/libraries/MigrationLib.php +++ b/application/libraries/MigrationLib.php @@ -9,19 +9,45 @@ class MigrationLib extends CI_Migration private $ERROR_PREFIX = "[E]"; private $SEPARATOR = "------------------------------"; + private $cli; + + public function __construct() + { + if ($this->input->is_cli_request()) + { + $this->cli = true; + } + else + { + $this->cli = false; + } + } + + private function getEOL() + { + if ($this->cli === true) + { + return PHP_EOL; + } + else + { + return "
"; + } + } + private function printMessage($message) { - printf("%s %s" . PHP_EOL, $this->MSG_PREFIX, $message); + printf("%s %s" . $this->getEOL(), $this->MSG_PREFIX, $message); } private function printInfo($info) { - printf("%s %s" . PHP_EOL, $this->INFO_PREFIX, $info); + printf("%s %s" . $this->getEOL(), $this->INFO_PREFIX, $info); } private function printError($error) { - printf("%s %s" . PHP_EOL, $this->ERROR_PREFIX, $error); + printf("%s %s" . $this->getEOL(), $this->ERROR_PREFIX, $error); } protected function startUP() diff --git a/application/migrations/011_reihungstest.php b/application/migrations/011_reihungstest.php index fff10b988..335f7dc95 100644 --- a/application/migrations/011_reihungstest.php +++ b/application/migrations/011_reihungstest.php @@ -6,6 +6,11 @@ require_once APPPATH . '/libraries/MigrationLib.php'; class Migration_Reihungstest extends MigrationLib { + public function __construct() + { + parent::__construct(); + } + public function up() { $this->startUP(); @@ -37,7 +42,7 @@ class Migration_Reihungstest extends MigrationLib rt_id integer, anmeldedatum date, teilgenommen boolean DEFAULT FALSE, - ort_kurzbz varchar(16) NOT NULL, + ort_kurzbz varchar(16), punkte numeric(8,4) DEFAULT NULL, CONSTRAINT pk_tbl_rt_person PRIMARY KEY (person_id, rt_id), CONSTRAINT fk_rt_person_ort_kurzbz FOREIGN KEY (ort_kurzbz) REFERENCES public.tbl_ort(ort_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT, diff --git a/application/widgets/orgform_widget.php b/application/widgets/orgform_widget.php index 13ab67013..2ac6c9f30 100644 --- a/application/widgets/orgform_widget.php +++ b/application/widgets/orgform_widget.php @@ -3,11 +3,11 @@ /* * OrgForm widget */ -class orgform_widget extends Widget +class orgform_widget extends Widget { protected $_htmltagname = 'orgform_kurzbz'; - public function display($data) + public function display($data) { $this->load->model('codex/Orgform_model', 'OrgFormModel'); $res = $this->OrgFormModel->load(); @@ -33,10 +33,10 @@ class orgform_widget extends Widget { $item = array ( - 'name' => $obj->orgform_kurzbz.' ('.$obj->bezeichnung.')', + 'name' => $obj->orgform_kurzbz.' ('.$obj->bezeichnung.')', 'value' => $obj->orgform_kurzbz ); - if (isset($data['orgform']) && $obj->orgform_kurzbz == $data['orgform']) + if (isset($data['orgform_kurzbz']) && $obj->orgform_kurzbz == $data['orgform_kurzbz']) $item['selected'] = true; else $item['selected'] = false; diff --git a/ci_db_extra.php b/ci_db_extra.php index a4dffc19b..78a1b0781 100755 --- a/ci_db_extra.php +++ b/ci_db_extra.php @@ -33,16 +33,16 @@ trait db_extra { if(is_null($i)) return pg_fetch_object($this->db_result); - else + else return pg_fetch_object($this->db_result, $i); } - else + else { if(is_null($i)) return pg_fetch_object($result); - else + else return pg_fetch_object($result, $i); - } + } } public function db_add_param($var, $type=FHC_STRING, $nullable=true) @@ -57,7 +57,7 @@ trait db_extra switch($type) { - case FHC_INTEGER: + case FHC_INTEGER: $var = $this->db_escape($var); if(!is_numeric($var) && $var!=='') die('Invalid Integer Parameter detected:'.$var); @@ -76,14 +76,14 @@ trait db_extra break; case FHC_STRING: - default: + default: $var = $this->db_escape($var); $var = $this->db_null_value($var); break; } - return $var; + return $var; } - + public function db_escape($var) { return pg_escape_string($var); @@ -94,14 +94,14 @@ trait db_extra if($qoute) return ($var!==''?$this->db_qoute($var):'null'); else - return ($var!==''?$var:'null'); + return ($var!==''?$var:'null'); } - + public function db_qoute($var) { return "'".$var."'"; } - + public function db_parse_bool($var) { if($var=='t') @@ -113,7 +113,7 @@ trait db_extra else die('Invalid DB Boolean. Wrong DB-Engine?'); } - + /** * Bereitet ein Array von Elementen auf, damit es in der IN-Klausel eines * Select Befehls verwendet werden kann. @@ -129,7 +129,7 @@ trait db_extra } return $string; } - + public function db_num_fields($result=null) { if(is_null($result)) @@ -137,12 +137,12 @@ trait db_extra else return pg_num_fields($result); } - + public function convert_html_chars($value) { return htmlspecialchars($value); } - + /** * Liefert den Feldnamen mit index i */ @@ -153,9 +153,37 @@ trait db_extra else return pg_field_name($result, $i); } - + public function db_last_error() { return pg_last_error(); } + + /** + * Erstellt aus einem DB Array ein PHP Array + * @param $var DB Result Array Spalte + * @return php array + */ + public function db_parse_lang_array($var) + { + + if ($var == '') + return; + preg_match_all('/(?<=^\{|,)(([^,"{]*)|\s*"((?:[^"\\\\]|\\\\(?:.|[0-9]+|x[0-9a-f]+))*)"\s*)(,|(?loadIndexArray(); + + $sprache = new sprache(); + $sprache->getAll(true); + $languages = $sprache->getAllIndexesSorted(); + + + foreach ($matches as $mk => $match) + { + $values[$languages[$mk+1]] = $match[3] != '' ? stripcslashes($match[3]) : (strtolower($match[2]) == 'null' ? null : $match[2]); + } + return $values; + } } diff --git a/content/messages.js.php b/content/messages.js.php new file mode 100644 index 000000000..48ac65d4d --- /dev/null +++ b/content/messages.js.php @@ -0,0 +1,32 @@ + + */ +require_once('../config/vilesci.config.inc.php'); +?> +// ********** FUNKTIONEN ********** // +var MessagePersonID=''; + +// **** +// * Laedt die Trees +// **** +function loadMessages(person_id) +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + MessagePersonID = person_id; +} diff --git a/content/messages.xul.php b/content/messages.xul.php new file mode 100644 index 000000000..667d07bda --- /dev/null +++ b/content/messages.xul.php @@ -0,0 +1,102 @@ + + */ +header("Cache-Control: no-cache"); +header("Cache-Control: post-check=0, pre-check=0",false); +header("Expires Mon, 26 Jul 1997 05:00:00 GMT"); +header("Pragma: no-cache"); +header("Content-type: application/vnd.mozilla.xul+xml"); + +require_once('../config/vilesci.config.inc.php'); +require_once('../include/functions.inc.php'); +require_once('../include/variable.class.php'); + +$user=get_uid(); +$variable = new variable(); +if(!$variable->loadVariables($user)) +{ + die('Fehler beim Laden der Variablen:'.$variable->errormsg); +} + +echo ''."\n"; + +echo ''; +echo ''; +echo ''; + +$person_id = filter_input(INPUT_GET,'person_id'); +echo ' +variable->locale.'/fas.dtd'); +echo ']> +'; +?> + +);" + > + +