Skip to content

Commit

Permalink
Updated to work with recent changes in anyTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemorken committed Mar 23, 2024
1 parent 68878d1 commit 73c53c5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/mysql/anyGetData.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function anyGetData($doEcho=false)
Parameters::get($table->getIdKey()) === "") {
$data = $table->getData();
if ($data !== null && !empty($data))
$data = $table->prepareData($data);
$data = $table->prepareData($type);
}
$data["permission"] = $table->getPermission();
$data["message"] = $table->getMessage();
Expand Down
2 changes: 1 addition & 1 deletion data/mysql/db/dbTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($connection)
/////////////////////////////////////////////////////////////////

abstract public function dbSearch();
abstract protected function prepareData(&$inData);
abstract protected function prepareData($type);
abstract public function dbInsert();
abstract public function dbUpdate();
abstract public function dbUpdateLinkList();
Expand Down
4 changes: 2 additions & 2 deletions data/mysql/types/document/documentTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ protected function initFilters($filters)
/////////////////////// Database query fragments ////////////////////////////
/////////////////////////////////////////////////////////////////////////////

protected function findListWhere($gid,$linkType=null,$linkId=null)
protected function findListWhere($gid,$type=null,$linkType=null,$linkId=null,$grouping=true,$groupType=null,$searchTerm="")
{
$where = parent::findListWhere($gid,$linkType,$linkId);
$where = parent::findListWhere($gid,$type,$linkType,$linkId,$grouping,$groupType,$searchTerm);
return $where;
} // findListWhere

Expand Down
4 changes: 2 additions & 2 deletions data/mysql/types/event/eventTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ public function hasParentId()
/////////////////////// Database query fragments ////////////////////////////
/////////////////////////////////////////////////////////////////////////////

protected function findListWhere($gid,$linkType=null,$linkId=null)
protected function findListWhere($gid,$type=null,$linkType=null,$linkId=null,$grouping=true,$groupType=null,$searchTerm="")
{
$where = parent::findListWhere($gid,$linkType,$linkId);
$where = parent::findListWhere($gid,$type,$linkType,$linkId,$grouping,$groupType,$searchTerm);
$w = "";
$event_date_start = Parameters::get("event_date_start");
$event_date_end = Parameters::get("event_date_end");
Expand Down
6 changes: 4 additions & 2 deletions data/mysql/types/group/groupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function dbValidateInsert()
if (strtolower($name) == "admin" || strtolower($name) == "administrator")
$this->mError .= $name."' is a reserved name. ";
else {
if (!$this->dbSearchItem($this->mData,$this->mNameKey,$name)) // TODO! Allow for several groups with same name?
if (!$this->dbSearchItemByKey("group",$this->mNameKey,$name)) // TODO! Allow for several groups with same name?
return false;
if ($this->mData != null)
$this->mError .= "Group '".$name."' already exists. ";
Expand Down Expand Up @@ -209,7 +209,9 @@ protected function dbSearchGroupInfo($type=null,$group_id=null)
} // while
} // if group_id
//vlog("dbSearchGroupInfo,data:",$data);
if ($this->mGrouping) {
$grouping = Parameters::get("grouping");
$grouping = $grouping !== false && $grouping !== "false" && $grouping !== "0";
if ($grouping) {
// Get group tree and append data to it
$data["group"] = $this->buildDataTree($data["group"]);
}
Expand Down
2 changes: 1 addition & 1 deletion data/mysql/types/user/userTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ protected function dbValidateDeletePermission()
private function dbSearchUserByLogin($userLogin)
{
$id_name = $this->emailAsLogin ? "user_email" : ANY_DB_USER_LOGIN;
$res = $this->dbSearchItem($this->mData,$id_name,$userLogin,true);
$res = $this->dbSearchItemByKey("user",$id_name,$userLogin,true);
return !empty($res);
} // dbSearchUserByLogin

Expand Down

0 comments on commit 73c53c5

Please sign in to comment.