From: Banana Date: Mon, 19 Feb 2024 13:14:57 +0000 (+0100) Subject: some cleanup. X-Git-Tag: 1.7~44 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=7a711c17455efda377e532ac07c66b44e5bce83a;p=bibliotheca-php.git some cleanup. added group info to profile view --- diff --git a/CHANGELOG b/CHANGELOG index 4878812..83d67c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 1.x - The Ceremonial Chambers + * Added group infos to profile view. 1.6 - Chizra 2024-02-03 diff --git a/TODO b/TODO index b4e81b0..c613771 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,8 @@ * Better error handling and display while adding / update and delete ** Maybe some message "store" -* query optimization and default indexes on columns * make documentation markdown to be nicer * change multiple-attachment to a field which tells it is used for a image gallery * update JS and remove deprecations -* complete profile view. Groups still missing. * minimal theme ** https://watercss.kognise.dev/ * create a real fallback theme, which does not depend on any styling/css diff --git a/webclient/config/config-googlebooks.php.default b/webclient/config/config-googlebooks.php.default index f4bccbf..2a4a645 100644 --- a/webclient/config/config-googlebooks.php.default +++ b/webclient/config/config-googlebooks.php.default @@ -2,7 +2,7 @@ /** * Bibliotheca * - * Copyright 2018-2023 Johannes Keßler + * Copyright 2018-2024 Johannes Keßler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/webclient/config/config-imdbweb.php.default b/webclient/config/config-imdbweb.php.default index 6523918..030e5c2 100644 --- a/webclient/config/config-imdbweb.php.default +++ b/webclient/config/config-imdbweb.php.default @@ -2,7 +2,7 @@ /** * Bibliotheca * - * Copyright 2018-2023 Johannes Keßler + * Copyright 2018-2024 Johannes Keßler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/webclient/config/config-musicbrainz.php.default b/webclient/config/config-musicbrainz.php.default index 589b132..7f62ffa 100644 --- a/webclient/config/config-musicbrainz.php.default +++ b/webclient/config/config-musicbrainz.php.default @@ -2,7 +2,7 @@ /** * Bibliotheca * - * Copyright 2018-2023 Johannes Keßler + * Copyright 2018-2024 Johannes Keßler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/webclient/config/config.php.default b/webclient/config/config.php.default index ffe5915..54b285e 100644 --- a/webclient/config/config.php.default +++ b/webclient/config/config.php.default @@ -2,7 +2,7 @@ /** * Bibliotheca * - * Copyright 2018-2023 Johannes Keßler + * Copyright 2018-2024 Johannes Keßler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/webclient/lib/gorenest.class.php b/webclient/lib/gorenest.class.php index c6c98ef..540cc5d 100644 --- a/webclient/lib/gorenest.class.php +++ b/webclient/lib/gorenest.class.php @@ -2,7 +2,7 @@ /** * Bibliotheca * - * Copyright 2018-2023 Johannes Keßler + * Copyright 2018-2024 Johannes Keßler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -100,7 +100,7 @@ class GoreNest { # reset the menu $this->_menuData = array(); - $queryStr = "SELECT id, text, action, icon, category, contextaction + $queryStr = "SELECT `id`, `text`, `action`, `icon`, `category`, `contextaction` FROM `".DB_PREFIX."_menu` WHERE ".$this->_User->getSQLRightsString()." ORDER BY position"; diff --git a/webclient/lib/mancubus.class.php b/webclient/lib/mancubus.class.php index 1d69963..8173ff5 100644 --- a/webclient/lib/mancubus.class.php +++ b/webclient/lib/mancubus.class.php @@ -349,92 +349,7 @@ class Mancubus { return $ret; } - /** - * Get entries for loaded collection by looking for the given value in given field - * - * @TODO: unused? - * - * @param string $fieldId Number ID of the field to search in - * @param string $fieldValue Value of the field - * @return array - */ - public function getEntriesByFieldValue(string $fieldId, string $fieldValue): array { - $ret = array(); - - $_entryFields = $this->_getEntryFields(); - if(isset($_entryFields[$fieldId])) { - $fieldData = $_entryFields[$fieldId]; - } - - if(empty($fieldData)) return $ret; - - if($fieldData['type'] !== "lookupmultiple") { - return $this->getEntries( - array( - 0 => array( - 'colName' => $fieldData['identifier'], - 'colValue' => $fieldValue, - 'fieldData' => $fieldData - ) - ) - ); - - } - - $querySelect = "SELECT `fk_entry`"; - $queryFrom = " FROM `".DB_PREFIX."_collection_entry2lookup_".$this->_DB->real_escape_string($this->_collectionId)."` AS t"; - $queryWhere = " WHERE t.fk_field = '".$this->_DB->real_escape_string($fieldId)."' - AND t.value = '".$this->_DB->real_escape_string($fieldValue)."'"; - - $queryOrder = " ORDER BY"; - if(!empty($this->_queryOptions['sort'])) { - $queryOrder .= ' t.'.$this->_queryOptions['sort']; - } - else { - $queryOrder .= " t.value"; - } - if(!empty($this->_queryOptions['sortDirection'])) { - $queryOrder .= ' '.$this->_queryOptions['sortDirection']; - } - else { - $queryOrder .= " ASC"; - } - - $queryLimit = ''; - if(!empty($this->_queryOptions['limit'])) { - $queryLimit .= " LIMIT ".$this->_queryOptions['limit']; - # offset can be 0 - if($this->_queryOptions['offset'] !== false) { - $queryLimit .= " OFFSET ".$this->_queryOptions['offset']; - } - } - - $queryStr = $querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit; - if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr)); - try { - $query = $this->_DB->query($queryStr); - - if($query !== false && $query->num_rows > 0) { - while(($result = $query->fetch_assoc()) != false) { - $_r = $this->getEntry($result['fk_entry']); - $ret['results'][$_r['id']] = $_r; - } - - $queryCountStr = "SELECT COUNT(t.value) AS amount ".$queryFrom.$queryWhere; - if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryCountStr)); - $query = $this->_DB->query($queryCountStr); - $result = $query->fetch_assoc(); - $ret['amount'] = $result['amount']; - } - } - catch (Exception $e) { - Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage()); - } - - return $ret; - } - - /** + /** * Return the storage info for loaded collection * Used by API * diff --git a/webclient/view/default/profile/profile.html b/webclient/view/default/profile/profile.html index f20eb26..4fd1a80 100644 --- a/webclient/view/default/profile/profile.html +++ b/webclient/view/default/profile/profile.html @@ -26,9 +26,16 @@
- +