X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttGroup.class.php;h=c3a56e05540605a8f164c84f39829d505178b311;hb=4334f16faa68ecaec5aceb5c16bb500d62a3688f;hp=5ef258cae3e7f3a5bbea3ef73ba3f87dabd81b21;hpb=5d1a946b7e54074b7a9ae0b85b73bd573ffe236b;p=timetracker.git diff --git a/WEB-INF/lib/ttGroup.class.php b/WEB-INF/lib/ttGroup.class.php index 5ef258ca..c3a56e05 100644 --- a/WEB-INF/lib/ttGroup.class.php +++ b/WEB-INF/lib/ttGroup.class.php @@ -54,7 +54,10 @@ class ttGroup { var $password_complexity = null; // Password complexity example. var $currency = null; // Currency. var $plugins = null; // Comma-separated list of enabled plugins. + var $config = null; // Comma-separated list of miscellaneous config options. + var $configHelper = null; // An instance of ttConfigHelper class. + var $custom_logo = 0; // Whether to use a custom logo for group. var $lock_spec = null; // Cron specification for record locking. var $workday_minutes = 480; // Number of work minutes in a regular day. @@ -63,6 +66,8 @@ class ttGroup { // We need a non-zero count to display some menus. // Constructor. + // Note: org_id is needed because we construct an object in ttUser constructor, + // when global $user object does not yet exist. function __construct($id, $org_id) { $mdb2 = getConnection(); @@ -102,13 +107,15 @@ class ttGroup { /* $this->custom_logo = $val['custom_logo']; */ + + // TODO: refactor this. $this->config = $val['config']; - $config = new ttConfigHelper($this->config); + $this->configHelper = new ttConfigHelper($val['config']); // Set user config options. - $this->show_holidays = $config->getDefinedValue('show_holidays'); - $this->punch_mode = $config->getDefinedValue('punch_mode'); - $this->allow_overlap = $config->getDefinedValue('allow_overlap'); - $this->future_entries = $config->getDefinedValue('future_entries'); + $this->show_holidays = $this->configHelper->getDefinedValue('show_holidays'); + $this->punch_mode = $this->configHelper->getDefinedValue('punch_mode'); + $this->allow_overlap = $this->configHelper->getDefinedValue('allow_overlap'); + $this->future_entries = $this->configHelper->getDefinedValue('future_entries'); } // Determine active user count in a separate query.