@@ -43,7 +43,7 @@ static function getAssignedProjects($user_id)
4343 // Do a query with inner join to get assigned projects.
4444 $ sql = "select p.id, p.name, p.tasks, upb.rate from tt_projects p " .
4545 " inner join tt_user_project_binds upb on (upb.user_id = $ user_id and upb.project_id = p.id and upb.status = 1) " .
46- " where p.group_id = " .$ user ->getActiveGroup ()." and p.status = 1 order by p.name " ;
46+ " where p.group_id = " .$ user ->getGroup ()." and p.status = 1 order by p.name " ;
4747 $ res = $ mdb2 ->query ($ sql );
4848 if (!is_a ($ res , 'PEAR_Error ' )) {
4949 while ($ val = $ res ->fetchRow ()) {
@@ -63,7 +63,7 @@ static function getRates($user_id)
6363
6464 $ sql = "select p.id, upb.rate from tt_projects p " .
6565 " inner join tt_user_project_binds upb on (upb.user_id = $ user_id and upb.project_id = p.id) " .
66- " where group_id = " .$ user ->getActiveGroup ();
66+ " where group_id = " .$ user ->getGroup ();
6767 $ res = $ mdb2 ->query ($ sql );
6868 if (!is_a ($ res , 'PEAR_Error ' )) {
6969 while ($ val = $ res ->fetchRow ()) {
@@ -83,7 +83,7 @@ static function getProjects()
8383 $ mdb2 = getConnection ();
8484
8585 $ sql = "select id, name, tasks from tt_projects " .
86- " where group_id = " .$ user ->getActiveGroup ()." and (status = 0 or status = 1) order by name " ;
86+ " where group_id = " .$ user ->getGroup ()." and (status = 0 or status = 1) order by name " ;
8787
8888 $ res = $ mdb2 ->query ($ sql );
8989 if (!is_a ($ res , 'PEAR_Error ' )) {
@@ -104,7 +104,7 @@ static function getProjectsForClient()
104104
105105 $ sql = "select p.id, p.name, p.tasks from tt_projects p " .
106106 " inner join tt_client_project_binds cpb on (cpb.client_id = $ user ->client_id and cpb.project_id = p.id) " .
107- " where p.group_id = " .$ user ->getActiveGroup ()." and (p.status = 0 or p.status = 1) " .
107+ " where p.group_id = " .$ user ->getGroup ()." and (p.status = 0 or p.status = 1) " .
108108 " order by p.name " ;
109109
110110 $ res = $ mdb2 ->query ($ sql );
@@ -125,7 +125,7 @@ static function get($id)
125125 $ mdb2 = getConnection ();
126126
127127 $ sql = "select id, name, description, status, tasks from tt_projects where id = $ id and group_id = " .
128- $ user ->getActiveGroup ()." and (status = 0 or status = 1) " ;
128+ $ user ->getGroup ()." and (status = 0 or status = 1) " ;
129129 $ res = $ mdb2 ->query ($ sql );
130130 if (!is_a ($ res , 'PEAR_Error ' )) {
131131 $ val = $ res ->fetchRow ();
@@ -142,7 +142,7 @@ static function getProjectByName($name) {
142142 global $ user ;
143143
144144 $ sql = "select id from tt_projects where group_id = " .
145- $ user ->getActiveGroup ()." and name = " .$ mdb2 ->quote ($ name ).
145+ $ user ->getGroup ()." and name = " .$ mdb2 ->quote ($ name ).
146146 " and (status = 1 or status = 0) " ;
147147 $ res = $ mdb2 ->query ($ sql );
148148 if (!is_a ($ res , 'PEAR_Error ' )) {
@@ -159,7 +159,7 @@ static function delete($id) {
159159 global $ user ;
160160 $ mdb2 = getConnection ();
161161
162- $ group_id = $ user ->getActiveGroup ();
162+ $ group_id = $ user ->getGroup ();
163163 $ org_id = $ user ->org_id ;
164164
165165 // Start with project itself. Reason: if the passed in project_id is bogus,
@@ -245,7 +245,7 @@ static function update($fields) {
245245 global $ user ;
246246 $ mdb2 = getConnection ();
247247
248- $ group_id = $ user ->getActiveGroup ();
248+ $ group_id = $ user ->getGroup ();
249249 $ org_id = $ user ->org_id ;
250250 $ project_id = $ fields ['id ' ]; // Project we are updating.
251251 $ name = $ fields ['name ' ]; // Project name.
@@ -323,7 +323,7 @@ static function update($fields) {
323323 // Update project name, description, tasks and status in tt_projects table.
324324 $ comma_separated = implode (", " , $ tasks_to_bind ); // This is a comma-separated list of associated task ids.
325325 $ sql = "update tt_projects set name = " .$ mdb2 ->quote ($ name ).", description = " .$ mdb2 ->quote ($ description ).
326- ", tasks = " .$ mdb2 ->quote ($ comma_separated ).", status = $ status where id = $ project_id and group_id = " .$ user ->getActiveGroup ();
326+ ", tasks = " .$ mdb2 ->quote ($ comma_separated ).", status = $ status where id = $ project_id and group_id = " .$ user ->getGroup ();
327327 $ affected = $ mdb2 ->exec ($ sql );
328328 return (!is_a ($ affected , 'PEAR_Error ' ));
329329 }
0 commit comments