Merge pull request #8156 from MrPetovan/task/7817-custom-fields-part-2

New custom profile fields feature part 2: Feature switcheroo
This commit is contained in:
Philipp 2020-01-24 20:17:52 +01:00 committed by GitHub
commit 09de4a5b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 2352 additions and 3855 deletions

View file

@ -34,7 +34,7 @@
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1330);
define('DB_UPDATE_VERSION', 1332);
}
return [
@ -277,7 +277,7 @@ return [
"reason" => ["type" => "text", "comment" => ""],
"closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
"info" => ["type" => "mediumtext", "comment" => ""],
"profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
"bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
"bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
"notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@ -1084,8 +1084,8 @@ return [
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
"is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
"profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"is-default" => ["type" => "boolean", "comment" => "Deprecated"],
"hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
@ -1095,29 +1095,29 @@ return [
"region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"with" => ["type" => "text", "comment" => ""],
"howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
"sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
"marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"with" => ["type" => "text", "comment" => "Deprecated"],
"howlong" => ["type" => "datetime", "comment" => "Deprecated"],
"sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"pub_keywords" => ["type" => "text", "comment" => ""],
"prv_keywords" => ["type" => "text", "comment" => ""],
"likes" => ["type" => "text", "comment" => ""],
"dislikes" => ["type" => "text", "comment" => ""],
"about" => ["type" => "text", "comment" => ""],
"summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"music" => ["type" => "text", "comment" => ""],
"book" => ["type" => "text", "comment" => ""],
"tv" => ["type" => "text", "comment" => ""],
"film" => ["type" => "text", "comment" => ""],
"interest" => ["type" => "text", "comment" => ""],
"romance" => ["type" => "text", "comment" => ""],
"work" => ["type" => "text", "comment" => ""],
"education" => ["type" => "text", "comment" => ""],
"contact" => ["type" => "text", "comment" => ""],
"likes" => ["type" => "text", "comment" => "Deprecated"],
"dislikes" => ["type" => "text", "comment" => "Deprecated"],
"about" => ["type" => "text", "comment" => "Deprecated"],
"summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
"music" => ["type" => "text", "comment" => "Deprecated"],
"book" => ["type" => "text", "comment" => "Deprecated"],
"tv" => ["type" => "text", "comment" => "Deprecated"],
"film" => ["type" => "text", "comment" => "Deprecated"],
"interest" => ["type" => "text", "comment" => "Deprecated"],
"romance" => ["type" => "text", "comment" => "Deprecated"],
"work" => ["type" => "text", "comment" => "Deprecated"],
"education" => ["type" => "text", "comment" => "Deprecated"],
"contact" => ["type" => "text", "comment" => "Deprecated"],
"homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1145,6 +1145,25 @@ return [
"PRIMARY" => ["id"],
]
],
"profile_field" => [
"comment" => "Custom profile fields",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"],
"order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
"psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this profile field - 0 = public"],
"label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
"value" => ["type" => "text", "comment" => "Value of the field"],
"created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
"edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
],
"indexes" => [
"PRIMARY" => ["id"],
"uid" => ["uid"],
"order" => ["order"],
"psid" => ["psid"],
]
],
"push_subscriber" => [
"comment" => "Used for OStatus: Contains feed subscribers",
"fields" => [

View file

@ -205,10 +205,9 @@ return [
'/probe' => [Module\Debug\Probe::class, [R::GET]],
'/profile' => [
'/{nickname}' => [Module\Profile::class, [R::GET]],
'/{nickname}/{to:\d{4}-\d{2}-\d{2}}/{from:\d{4}-\d{2}-\d{2}}' => [Module\Profile::class, [R::GET]],
'/{nickname}/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
'/{profile:\d+}/view' => [Module\Profile::class, [R::GET]],
'/{nickname}' => [Module\Profile\Index::class, [R::GET]],
'/{nickname}/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
'/{nickname}/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]],
],
'/proxy' => [
@ -239,6 +238,7 @@ return [
],
'/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class, [R::GET, R::POST]],
'/profile' => [
'[/]' => [Module\Settings\Profile\Index::class, [R::GET, R::POST]],
'/photo[/new]' => [Module\Settings\Profile\Photo\Index::class, [R::GET, R::POST]],
'/photo/crop/{guid}' => [Module\Settings\Profile\Photo\Crop::class, [R::GET, R::POST]],
],
@ -254,6 +254,9 @@ return [
'/starred/{item:\d+}' => [Module\Starred::class, [R::GET]],
'/toggle_mobile' => [Module\ToggleMobile::class, [R::GET]],
'/tos' => [Module\Tos::class, [R::GET]],
'/update_profile' => [Module\Update\Profile::class, [R::GET]],
'/view/theme/{theme}/style.pcss' => [Module\Theme::class, [R::GET]],
'/viewsrc/{item:\d+}' => [Module\Debug\ItemBody::class, [R::GET]],
'/webfinger' => [Module\Debug\WebFinger::class, [R::GET]],