From: Banana Date: Fri, 16 Dec 2022 18:32:15 +0000 (+0100) Subject: new sort direction field in collection edit view X-Git-Tag: v1.4~13 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=881862289fd77086c70185579e822e11d5887f39;p=bibliotheca-php.git new sort direction field in collection edit view --- diff --git a/CHANGELOG b/CHANGELOG index 68b185a..a3f4cb9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,7 @@ 1.4 - Depths Of Rrajigar + * Added new default sort direction field in collection edit view. See upgrade file for more needed details + * Fixed #13 + * Fixed Some layout alignements 1.3 - Rrajigar Mine 2022-10-08 * Fixed install sql file. diff --git a/documentation/setup/bibliotheca.sql b/documentation/setup/bibliotheca.sql index 2f3ee6c..f67bfa3 100644 --- a/documentation/setup/bibliotheca.sql +++ b/documentation/setup/bibliotheca.sql @@ -34,6 +34,7 @@ CREATE TABLE `#REPLACEME#_collection` ( `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `defaultSearchField` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `defaultSortField` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `defaultSortOrder` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `advancedSearchTableFields` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/upgrade/from-version-1.3.tx b/upgrade/from-version-1.3.tx new file mode 100644 index 0000000..301b8e4 --- /dev/null +++ b/upgrade/from-version-1.3.tx @@ -0,0 +1,3 @@ +# DB changes. Run each line against your bibliotheca DB. +# Replace #REPLACEME# with your table prefix. Default is bib +ALTER TABLE `#REPLACEME#_collection` ADD `defaultSortOrder` VARCHAR(4) CHARACTER SET utf8mb4_unicode_ci COLLATE utf8mb4_bin NOT NULL AFTER `defaultSortField`; diff --git a/webclient/lib/managecollections.class.php b/webclient/lib/managecollections.class.php index 6c40141..c744e06 100644 --- a/webclient/lib/managecollections.class.php +++ b/webclient/lib/managecollections.class.php @@ -184,6 +184,7 @@ class ManageCollections { `rights` = '".$this->_DB->real_escape_string($data['rights'])."', `defaultSearchField` = '".$this->_DB->real_escape_string($data['defaultSearchField'])."', `defaultSortField` = '".$this->_DB->real_escape_string($data['defaultSortField'])."', + `defaultSortOrder` = '".$this->_DB->real_escape_string($data['defaultSortOrder'])."', `advancedSearchTableFields` = '".$this->_DB->real_escape_string($data['advancedSearchTableFields'])."'"; if(QUERY_DEBUG) error_log("[QUERY] ".__METHOD__." query: ".var_export($queryStr,true)); $this->_DB->query($queryStr); @@ -252,6 +253,7 @@ class ManageCollections { $queryStr = "SELECT `c`.`id`, `c`.`name`, `c`.`description`, `c`.`created`, `c`.`owner`, `c`.`group`, `c`.`rights`, `c`.`defaultSearchField`, `c`.`defaultSortField`, `c`.`advancedSearchTableFields`, + `c`.`defaultSortOrder`, `u`.`name` AS username, `g`.`name` AS groupname FROM `".DB_PREFIX."_collection` AS c LEFT JOIN `".DB_PREFIX."_user` AS u ON `c`.`owner` = `u`.`id` @@ -300,6 +302,7 @@ class ManageCollections { `rights` = '".$this->_DB->real_escape_string($data['rights'])."', `defaultSearchField` = '".$this->_DB->real_escape_string($data['defaultSearchField'])."', `defaultSortField` = '".$this->_DB->real_escape_string($data['defaultSortField'])."', + `defaultSortOrder` = '".$this->_DB->real_escape_string($data['defaultSortOrder'])."', `advancedSearchTableFields` = '".$this->_DB->real_escape_string($data['advancedSearchTableFields'])."' WHERE `id` = '".$this->_DB->real_escape_string($data['id'])."'"; if(QUERY_DEBUG) error_log("[QUERY] ".__METHOD__." query: ".var_export($queryStr,true)); diff --git a/webclient/lib/trite.class.php b/webclient/lib/trite.class.php index 0c42f58..48f97e0 100644 --- a/webclient/lib/trite.class.php +++ b/webclient/lib/trite.class.php @@ -120,6 +120,7 @@ class Trite { $queryStr = "SELECT `c`.`id`, `c`.`name`, `c`.`description`, `c`.`created`, `c`.`owner`, `c`.`group`, `c`.`rights`, `c`.`defaultSearchField`, `c`.`defaultSortField`,`c`.`advancedSearchTableFields`, + `c`.`defaultSortOrder`, `u`.`name` AS username, `g`.`name` AS groupname FROM `".DB_PREFIX."_collection` AS c LEFT JOIN `".DB_PREFIX."_user` AS u ON `c`.`owner` = `u`.`id` diff --git a/webclient/view/default/collections/collections.html b/webclient/view/default/collections/collections.html index b8c1059..5f32bc9 100644 --- a/webclient/view/default/collections/collections.html +++ b/webclient/view/default/collections/collections.html @@ -11,7 +11,7 @@
+
+ +
+ +
+
diff --git a/webclient/view/default/managecolletions/managecolletions.php b/webclient/view/default/managecolletions/managecolletions.php index 1dd057e..58864e1 100644 --- a/webclient/view/default/managecolletions/managecolletions.php +++ b/webclient/view/default/managecolletions/managecolletions.php @@ -69,6 +69,7 @@ if(isset($_POST['submitForm'])) { $_saveData['rights'] = Summoner::prepareRightsString($fdata['rights']); $_saveData['defaultSearchField'] = $fdata['defaultSearchField']; $_saveData['defaultSortField'] = $fdata['defaultSortField']; + $_saveData['defaultSortOrder'] = $fdata['defaultSortOrder']; $_saveData['id'] = $_id; $_saveData['tool'] = array();