From: <gem...@li...> - 2013-02-14 16:54:10
|
Revision: 1140 http://sourceforge.net/p/gemstracker/code/1140 Author: matijsdejong Date: 2013-02-14 16:54:06 +0000 (Thu, 14 Feb 2013) Log Message: ----------- Enabled RespondentModel.php to work when there are no organizations Removed old unused code from rest Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/configs/db/tables/gems__respondents.30.sql Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-14 16:54:06 UTC (rev 1140) @@ -105,8 +105,10 @@ if (! isset($filter['gr2o_id_organization'])) { if ($this->isMultiOrganization() && !isset($filter['gr2o_patient_nr'])) { + $allowed = $this->user->getAllowedOrganizations(); + // If we are not looking for a specific patient, we can look at all patients - $filter[] = 'gr2o_id_organization IN (' . implode(', ', array_keys($this->user->getAllowedOrganizations())) . ')'; + $filter['gr2o_id_organization'] = array_keys($allowed); } else { // Otherwise, we can only see in our current organization $filter['gr2o_id_organization'] = $this->getCurrentOrganization(); Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-02-14 16:54:06 UTC (rev 1140) @@ -128,7 +128,6 @@ { $select = $this->getSelect(); - if ($this->hasItemsUsed()) { // Add expression columns by default // getColumn() triggers the columns as 'used' Modified: trunk/library/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondents.30.sql 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/configs/db/tables/gems__respondents.30.sql 2013-02-14 16:54:06 UTC (rev 1140) @@ -2,33 +2,9 @@ CREATE TABLE if not exists gems__respondents ( grs_id_user bigint unsigned not null auto_increment references gems__user_ids (gui_id_user), - -- grs_login varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' - -- null unique key, - -- grs_password varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null unique key, --- Naam --- Adres --- Woonplaats --- Tel. nr --- geb. datum --- aandoening (code bijv: ICD9, DBC etc) --- aangedaan lichaamsdeel --- uitgevoerde behandeling --- hand dominantie --- behandelend arts --- beroep/ hobby's --- OK/ behandel datum --- email - -- grs_staff boolean not null default 0, - -- grs_respondent boolean not null default 1, - -- grs_active boolean not null default 1, - -- grs_id_supervisor bigint unsigned default 1 - -- references gems_staff (grs_id_user), - -- grs_id_primary_group bigint unsigned - -- references gems__groups (umg_id_group), grs_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en', grs_email varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, @@ -38,10 +14,7 @@ grs_last_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_gender char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'U', - -- grs_dexterity char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' - -- not null default 'U', grs_birthday date, - -- grs_function varchar(40) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_address_1 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_address_2 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', @@ -53,9 +26,6 @@ -- grs_phone_2 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', -- grs_phone_3 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', - -- grs_id_reception_code bigint unsigned not null default 1 - -- references gems__reception_codes (umrc_id_reception_code), - grs_changed timestamp not null default current_timestamp on update current_timestamp, grs_changed_by bigint unsigned not null, grs_created timestamp not null, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |