Back to the index page  
LiveChat! (0 online)   FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 
[w2p-commit] SF.net SVN: web2project:[957] trunk

 
Post new topic   Reply to topic    web2Project Forum Index » SVN Commit and Bug Tracker Messages View previous topic :: View next topic  
[w2p-commit] SF.net SVN: web2project:[957] trunk
 PostPosted: Mon Feb 08, 2010 11:57 pm Reply with quote  
Message
  trevormorse at users.s...
Guest



Revision: 957
http://web2project.svn.sourceforge.net/web2project/?rev=957&view=rev
Author: trevormorse
Date: 2010-02-08 23:56:54 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
Adding class constants to CTask for access permissions to help with readability

Modified Paths:
--------------
trunk/modules/tasks/addedit.php
trunk/modules/tasks/tasks.class.php

Property Changed:
----------------
trunk/


Property changes on: trunk
___________________________________________________________________
Added: svn:ignore
+ .directory


Modified: trunk/modules/tasks/addedit.php
===================================================================
--- trunk/modules/tasks/addedit.php 2010-02-08 23:31:58 UTC (rev 956)
+++ trunk/modules/tasks/addedit.php 2010-02-08 23:56:54 UTC (rev 957)
@@ -7,7 +7,7 @@
$status = w2PgetSysVal('TaskStatus');
$priority = w2PgetSysVal('TaskPriority');
// user based access
-$task_access = array('0' => 'Public', '1' => 'Protected', '2' => 'Participant', '3' => 'Private');
+$task_access = array(CTask::ACCESS_PUBLIC => 'Public', CTask::ACCESS_PROTECTED => 'Protected', CTask::ACCESS_PARTICIPANT => 'Participant', CTask::ACCESS_PRIVATE => 'Private');

/**
* Tasks :: Add/Edit Form

Modified: trunk/modules/tasks/tasks.class.php
===================================================================
--- trunk/modules/tasks/tasks.class.php 2010-02-08 23:31:58 UTC (rev 956)
+++ trunk/modules/tasks/tasks.class.php 2010-02-08 23:56:54 UTC (rev 957)
@@ -12,9 +12,6 @@

$priority = w2PgetSysVal('TaskPriority');

-// user based access
-$task_access = array('0' => 'Public', '1' => 'Protected', '2' => 'Participant', '3' => 'Private');
-
/*
* TASK DYNAMIC VALUE:
* 0 = default(OFF), no dep tracking of others, others do track
@@ -75,6 +72,14 @@
public $task_updated = null;
public $task_updator = null;

+ /**
+ * Class constants for task access
+ */
+ const ACCESS_PUBLIC = 0;
+ const ACCESS_PROTECTED = 1;
+ const ACCESS_PARTICIPANT = 2;
+ const ACCESS_PRIVATE = 3;
+
public function __construct() {
parent::__construct('tasks', 'task_id');
}
@@ -1197,12 +1202,10 @@
}

switch ($this->task_access) {
- case 0:
- // public
+ case self::ACCESS_PUBLIC:
$retval = true;
break;
- case 1:
- // protected
+ case self::ACCESS_PROTECTED:
$q->addTable('users');
$q->addQuery('user_company');
$q->addWhere('user_id=' . (int)$user_id . ' OR user_id=' . (int)$this->task_owner);
@@ -1214,8 +1217,7 @@
$last_company = $current_company;
}

- case 2:
- // participant
+ case self::ACCESS_PARTICIPANT:
$company_match = ((isset($company_match)) ? $company_match : true);
$q->addTable('user_tasks');
$q->addQuery('COUNT(task_id)');
@@ -1224,8 +1226,7 @@
$q->clear();
$retval = (($company_match && $count > 0) || $this->task_owner == $user_id);
break;
- case 3:
- // private
+ case self::ACCESS_PRIVATE:
$retval = ($this->task_owner == $user_id);
break;
default:
@@ -2244,6 +2245,9 @@
}
}

+// user based access
+$task_access = array(CTask::ACCESS_PUBLIC => 'Public', CTask::ACCESS_PROTECTED => 'Protected', CTask::ACCESS_PARTICIPANT => 'Participant', CTask::ACCESS_PRIVATE => 'Private');
+
/**
* CTaskLog Class
*/


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
W2p-commit mailing list
W2p-commit@host169.hostmonster.com
http://host169.hostmonster.com/mailman/listinfo/w2p-commit_web2project.net

Post generated using Mail2Forum (http://www.mail2forum.com)
Post new topic   Reply to topic    web2Project Forum Index » SVN Commit and Bug Tracker Messages

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Macinscott 2 by Scott Stubblefield

Get web2Project at SourceForge.net. Fast, secure and Free Open Source software downloads