From: Banana Date: Sat, 8 Oct 2022 10:22:35 +0000 (+0200) Subject: testing fixes X-Git-Tag: 1.3~4 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=2d4945dac3f2ca4b0f76fca5a4797ef3496ea9b0;p=bibliotheca-php.git testing fixes --- diff --git a/TODO b/TODO index d379cae..c818b2c 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,13 @@ +* option for sorting direction * Automatic upgrades of DB +* drop in updates * Definition of fields in "card view" * User and groupmanagement: Check where a user or group is used! * Better error handling and display while adding / update and delete * Export of an entry, collection or everything. Stored on disk. * Import of the export -* drop in updates + * responsive and breakpoints * Field management: Web interface * minimal theme -* Automatic upgrade from DB changes diff --git a/webclient/lib/managecollectionfields.class.php b/webclient/lib/managecollectionfields.class.php index 481bfe3..3856772 100644 --- a/webclient/lib/managecollectionfields.class.php +++ b/webclient/lib/managecollectionfields.class.php @@ -26,28 +26,28 @@ class ManageCollectionFields { * * @var mysqli */ - private $_DB; + private mysqli $_DB; /** * The user object to query with * * @var Doomguy */ - private $_User; + private Doomguy $_User; /** * The collection we are working with * - * @var integer + * @var string */ - private $_collectionId; + private string $_collectionId; /** * Which db cols should not be removed * * @var array */ - private $_protectedDBCols = array( + private array $_protectedDBCols = array( 'id','created','modified','modificationuser','owner','group','rights' ); @@ -56,14 +56,14 @@ class ManageCollectionFields { * * @var array */ - private $_cacheExistingSysFields = array(); + private array $_cacheExistingSysFields = array(); /** * Store available fields info for runtime * * @var array */ - private $_cacheAvailableFields = array(); + private array $_cacheAvailableFields = array(); /** * ManageCollections constructor @@ -79,9 +79,9 @@ class ManageCollectionFields { /** * The id from the collection we are working with * - * @param integer $id + * @param string $id */ - public function setCollection($id) { + public function setCollection(string $id): void { if(!empty($id)) { $this->_collectionId = $id; } @@ -94,7 +94,7 @@ class ManageCollectionFields { * @return array * @todo No rights implemented yet. Maybe not needed. Management done by hand directly on DB */ - public function getAvailableFields($refresh=false): array { + public function getAvailableFields(bool $refresh=false): array { if($refresh === false && !empty($this->_cacheAvailableFields)) { return $this->_cacheAvailableFields; diff --git a/webclient/lib/managecollections.class.php b/webclient/lib/managecollections.class.php index b738eda..ba81bcc 100644 --- a/webclient/lib/managecollections.class.php +++ b/webclient/lib/managecollections.class.php @@ -25,14 +25,14 @@ class ManageCollections { * * @var mysqli */ - private $_DB; + private mysqli $_DB; /** * The user object to query with * * @var Doomguy */ - private $_User; + private Doomguy $_User; /** * ManageCollections constructor. @@ -534,11 +534,11 @@ class ManageCollections { * Update the rights from the group to the entries in this collection * * @param string $collectionId - * @param string|bool $owner - * @param string|bool $group - * @param string|bool $rights + * @param string $owner + * @param string $group + * @param string $rights */ - private function _updateEntryRights(string $collectionId, $owner=false, $group=false, $rights=false) { + private function _updateEntryRights(string $collectionId, string $owner='', string $group='', string $rights=''): void { if(!empty($collectionId)) { $queryStr = "UPDATE `".DB_PREFIX."_collection_entry_".$collectionId."` SET"; @@ -566,10 +566,10 @@ class ManageCollections { /** * Make a key=>value array of a comma seperated string and use the value as key * - * @param array $data + * @param string $data * @return array */ - private function _loadAdvancedSearchTableFields(array $data): array { + private function _loadAdvancedSearchTableFields(string $data): array { $ret = array(); $_t = explode(',',$data);