summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-02-07 22:41:35 -0500
committerMalf Furious <m@lfurio.us>2018-02-07 22:41:35 -0500
commit0dd76669c58d1ae62d761d8f7c815b464963ca4a (patch)
treea22a44b47684d7f20305bb3b0258a01fa6edccf5
parent66aa954421c093ad54da8806e42d4ff9bba59091 (diff)
parent0bae6d4063c82c6522e3a5887bc25a2162504b69 (diff)
downloadscrott-0dd76669c58d1ae62d761d8f7c815b464963ca4a.tar.gz
scrott-0dd76669c58d1ae62d761d8f7c815b464963ca4a.zip
Merge branch 'bug/object' into dev
-rw-r--r--app/class/agent.class.php62
-rw-r--r--app/class/issue.class.php4
-rw-r--r--app/class/mesg.class.php10
-rw-r--r--app/class/obj.class.php (renamed from app/class/object.class.php)10
-rw-r--r--app/class/pad.class.php4
-rw-r--r--app/class/stage.class.php6
-rw-r--r--app/df.php2
7 files changed, 49 insertions, 49 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php
index ed50b93..6d0e20d 100644
--- a/app/class/agent.class.php
+++ b/app/class/agent.class.php
@@ -12,7 +12,7 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/object.class.php";
+require_once "class/obj.class.php";
require_once "class/pad.class.php";
require_once "class/settings.class.php";
require_once "class/phpmailer.class.php";
@@ -22,7 +22,7 @@ require_once "class/smtp.class.php";
* This is a supertype for users and groups, since these two object types
* will often be handled polymorphically and will share some functionality.
*/
-abstract class agent extends object
+abstract class agent extends obj
{
/*
* Constructor
@@ -35,7 +35,7 @@ abstract class agent extends object
/*
* Check whether this agent is the owner of the given object
*/
- public function isOwnerOf(object $obj) : bool
+ public function isOwnerOf(obj $obj) : bool
{
return $obj->getOwner()->guid == $this->guid;
}
@@ -43,7 +43,7 @@ abstract class agent extends object
/*
* Check whether this agent is a member of the given object
*/
- public function isMemberOf(object $obj) : bool
+ public function isMemberOf(obj $obj) : bool
{
foreach ($obj->getMembers() as $memb)
{
@@ -114,7 +114,7 @@ abstract class agent extends object
* Check whether this agent has access permission for given
* object
*/
- public function canAccess(object $obj) : bool
+ public function canAccess(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -130,13 +130,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canAccessSub($parent))
return true;
}
else if ($this->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canAccessSub($owner))
return true;
}
@@ -148,7 +148,7 @@ abstract class agent extends object
* Check whether this agent has modify permission for given
* object
*/
- public function canModify(object $obj) : bool
+ public function canModify(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -161,13 +161,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySub($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySub($owner))
return true;
}
@@ -179,7 +179,7 @@ abstract class agent extends object
* Check whether this agent has modify members permission for
* given object
*/
- public function canModifyMembers(object $obj) : bool
+ public function canModifyMembers(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -192,13 +192,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySubMembers($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySubMembers($owner))
return true;
}
@@ -210,7 +210,7 @@ abstract class agent extends object
* Check whether this agent has modify permissions permission
* for given object
*/
- public function canModifyPermissions(object $obj) : bool
+ public function canModifyPermissions(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -220,13 +220,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySubPermissions($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySubPermissions($owner))
return true;
}
@@ -238,7 +238,7 @@ abstract class agent extends object
* Check whether this agent has access-sub permission for
* given object
*/
- public function canAccessSub(object $obj) : bool
+ public function canAccessSub(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -254,13 +254,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canAccessSub($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canAccessSub($owner))
return true;
}
@@ -272,7 +272,7 @@ abstract class agent extends object
* Check whether this agent has create-sub permission
* for given object
*/
- public function canCreateSub(object $obj) : bool
+ public function canCreateSub(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -288,13 +288,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canCreateSub($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canCreateSub($owner))
return true;
}
@@ -306,7 +306,7 @@ abstract class agent extends object
* Check whether this agent has modify-sub permission
* for given object
*/
- public function canModifySub(object $obj) : bool
+ public function canModifySub(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -319,13 +319,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySub($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySub($owner))
return true;
}
@@ -337,7 +337,7 @@ abstract class agent extends object
* Check whether this agent has modify-sub-members
* permission for given object
*/
- public function canModifySubMembers(object $obj) : bool
+ public function canModifySubMembers(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -350,13 +350,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySubMembers($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySubMembers($owner))
return true;
}
@@ -368,7 +368,7 @@ abstract class agent extends object
* Check whether this agent has modify-sub-permissions
* permission for given object
*/
- public function canModifySubPermissions(object $obj) : bool
+ public function canModifySubPermissions(obj $obj) : bool
{
if ($this->admin)
return true;
@@ -378,13 +378,13 @@ abstract class agent extends object
if ($obj->parent)
{
- $parent = new object($obj->parent);
+ $parent = new obj($obj->parent);
if ($this->canModifySubPermissions($parent))
return true;
}
else if ($obj->owner)
{
- $owner = new object($obj->owner);
+ $owner = new obj($obj->owner);
if ($this->canModifySubPermissions($owner))
return true;
}
diff --git a/app/class/issue.class.php b/app/class/issue.class.php
index b61a6e3..1c77894 100644
--- a/app/class/issue.class.php
+++ b/app/class/issue.class.php
@@ -12,7 +12,7 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/object.class.php";
+require_once "class/obj.class.php";
require_once "class/stage.class.php";
require_once "class/user.class.php";
require_once "class/mesg.class.php";
@@ -21,7 +21,7 @@ require_once "class/mesg.class.php";
* This class models Scrott issues. Issues represent units of work, can
* be assigned to users, and advance through a pipeline.
*/
-class issue extends object
+class issue extends obj
{
/*
* Constructor
diff --git a/app/class/mesg.class.php b/app/class/mesg.class.php
index 2512d03..1a864c0 100644
--- a/app/class/mesg.class.php
+++ b/app/class/mesg.class.php
@@ -12,7 +12,7 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/object.class.php";
+require_once "class/obj.class.php";
require_once "class/user.class.php";
require_once "class/pad.class.php";
require_once "class/stage.class.php";
@@ -22,7 +22,7 @@ require_once "class/issue.class.php";
* This class models issue activity, private messaging, pad discussions,
* and system and object log messages.
*/
-class mesg extends object
+class mesg extends obj
{
/*
* Constants used for uploading attachments
@@ -56,7 +56,7 @@ class mesg extends object
/*
* Initialize a new regular message.
*/
- public static function initNew(string $message, user $author, object $parent) : mesg
+ public static function initNew(string $message, user $author, obj $parent) : mesg
{
$mesg = new mesg();
$mesg->setOwner($author);
@@ -106,7 +106,7 @@ class mesg extends object
/*
* Initialize a new log message.
*/
- public static function initNewLog(string $message, user $author, object $parent) : mesg
+ public static function initNewLog(string $message, user $author, obj $parent) : mesg
{
$owner = $parent->getOwner();
@@ -321,7 +321,7 @@ class mesg extends object
break;
}
- $rcpt = object::arrayUnique($rcpt);
+ $rcpt = obj::arrayUnique($rcpt);
$author = $this->author;
$rcpt = array_filter($rcpt, function ($val) use($author) { return $val->guid != $author; });
$attachPath = ($this->getAttachment() ? "dynmic/attach/" . $this->guid : NULL);
diff --git a/app/class/object.class.php b/app/class/obj.class.php
index c1ba85c..5be9ac3 100644
--- a/app/class/object.class.php
+++ b/app/class/obj.class.php
@@ -19,7 +19,7 @@ require_once "class/image.php";
* This is a generic database object. This is a supertype of all Scrott
* datatypes and defines fields common to all of them.
*/
-class object extends table
+class obj extends table
{
/*
* Constants used for uploading images
@@ -66,7 +66,7 @@ class object extends table
*/
public static function typeOf(string $guid) : string
{
- $obj = new object($guid);
+ $obj = new obj($guid);
return $obj->objtype;
}
@@ -125,19 +125,19 @@ class object extends table
* Get the parent of this object. If this object does not have a
* parent, NULL will be returned.
*/
- public function getParent() : ?object
+ public function getParent() : ?obj
{
if (!isset($this->parent) || $this->parent == "")
return NULL;
- $parent = new object($this->parent);
+ $parent = new obj($this->parent);
return new $parent->objtype($parent->guid);
}
/*
* Update the parent of this object
*/
- public function setParent(object $parent) : void
+ public function setParent(obj $parent) : void
{
$this->parent = $parent->guid;
$this->saveObj();
diff --git a/app/class/pad.class.php b/app/class/pad.class.php
index 3966f58..38812d6 100644
--- a/app/class/pad.class.php
+++ b/app/class/pad.class.php
@@ -12,7 +12,7 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/object.class.php";
+require_once "class/obj.class.php";
require_once "class/agent.class.php";
require_once "class/stage.class.php";
@@ -20,7 +20,7 @@ require_once "class/stage.class.php";
* This class models Scrott pads. Pads are the space for projects to track
* issues and communicate.
*/
-class pad extends object
+class pad extends obj
{
/*
* Constructor
diff --git a/app/class/stage.class.php b/app/class/stage.class.php
index 74c5f42..43bb3c3 100644
--- a/app/class/stage.class.php
+++ b/app/class/stage.class.php
@@ -12,7 +12,7 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/object.class.php";
+require_once "class/obj.class.php";
require_once "class/pad.class.php";
require_once "class/issue.class.php";
@@ -20,7 +20,7 @@ require_once "class/issue.class.php";
* This class models Scrott pad stages. Stages form a pipeline through
* which issues can progress.
*/
-class stage extends object
+class stage extends obj
{
/*
* Constructor
@@ -173,7 +173,7 @@ class stage extends object
* moved to the given stage object. Additionally, the pad may be
* given, in which case, those issues will be closed.
*/
- public function removeStage(object $mvt) : void
+ public function removeStage(obj $mvt) : void
{
if (!($prev = $this->getPrev()))
$prev = $this->getParent();
diff --git a/app/df.php b/app/df.php
index 3f648ad..6c23136 100644
--- a/app/df.php
+++ b/app/df.php
@@ -61,7 +61,7 @@ function checkPermissions(string $guid, bool $allowHeadUser = false) : bool
if (!($user = user::getCurrent()))
return false;
- $obj = new object($guid);
+ $obj = new obj($guid);
if ($allowHeadUser && $obj->objtype == "user")
return true;