Skip to content

Commit

Permalink
Fixing a bug that was checking the company id for permissions when up…
Browse files Browse the repository at this point in the history
…dating a project.
  • Loading branch information
trevormorse committed Jul 15, 2010
1 parent e3fd415 commit 5543c07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/projects/projects.class.php
Expand Up @@ -206,7 +206,7 @@ public function delete(CAppUI $AppUI = null) {
$q->clear();
$q->setDelete('tasks');
$q->addWhere('task_represents_project =' . (int)$this->project_id);

$q->clear();
$q->setDelete('projects');
$q->addWhere('project_id =' . (int)$this->project_id);
Expand Down Expand Up @@ -517,7 +517,7 @@ public function store(CAppUI $AppUI = null) {
*/
$q = new DBQuery;
$this->project_updated = $q->dbfnNowWithTZ();
if ($this->project_id && $perms->checkModuleItem('projects', 'edit', $this->company_id)) {
if ($this->project_id && $perms->checkModuleItem('projects', 'edit', $this->project_id)) {
if (($msg = parent::store())) {
return $msg;
}
Expand Down Expand Up @@ -863,7 +863,7 @@ public static function updateHoursWorked($project_id) {
$q->exec();
self::updatePercentComplete($project_id);
}

public static function updatePercentComplete($project_id) {
$working_hours = (w2PgetConfig('daily_working_hours') ? w2PgetConfig('daily_working_hours') : 8);

Expand Down Expand Up @@ -1075,7 +1075,7 @@ function projects_list_data($user_id = false) {
$q->addTable('projects', 'pr');
$q->addQuery('pr.project_id, project_status, project_color_identifier, project_type,
project_name, project_description, project_scheduled_hours as project_duration, project_parent, project_original_parent,
project_start_date, project_end_date, project_color_identifier, project_company,
project_start_date, project_end_date, project_color_identifier, project_company,
company_name, company_description, project_status, project_priority,
tc.critical_task, tc.project_actual_end_date, tp.task_log_problem, pr.project_task_count,
pr.project_percent_complete, user_username, project_active');
Expand Down

0 comments on commit 5543c07

Please sign in to comment.