Contacts: Add sort by last modified

Created on 27 Jul 2017  Â·  23Comments  Â·  Source: nextcloud/contacts

also a default sort that is perhaps more intuitive (is the current default sort documented somewhere?)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

1. to develop enhancement good first issue

Most helpful comment

@georgehrke he asked you because I'm trying to create a last modified sort option.

All 23 comments

In the settings
capture d ecran_2017-07-27_18-15-37

Please include 'Date Created', and 'Last Modified' as sorting options.

I don't see that option in my settings:

image

@dhowe You're using the latest official version, the current master has more than 200 commits. We're about to publish a new release! :)

Excellent: do I have to download it, or is there an auto-update ?

Will be available as usual on the store.

It doesn't look like there is an easy way to determine when a contact was created or updated:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
    <d:response>
        <d:href>/server/remote.php/dav/addressbooks/users/admin/contacts/8ee94958-71e2-4856-bf98-ebd335a13421.vcf</d:href>
        <d:propstat>
            <d:prop>
                <d:getetag>&quot;b8e32fc2f52f22e035176efb9345d5e5&quot;</d:getetag>
                <card:address-data>
                    BEGIN:VCARD&#13;
                    VERSION:3.0&#13;
                    FN:New csdfgontact&#13;
                    UID:8ee94958-71e2-4856-bf98-ebd335a13421&#13;
                    REV:20170808T141227Z&#13;
                    END:VCARD
                </card:address-data>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>

@georgehrke Or am I wrong?

@MorrisJobke wrong ticket?

To answer your question anyway: see http://sabre.io/dav/building-a-carddav-client/#finding-out-if-anything-changed

tl;dr: You have to keep a list of the etags.

@georgehrke he asked you because I'm trying to create a last modified sort option.

@jonatoni isn't it the purpose of the REV field?

Yes, REV seems to be the way to go: https://tools.ietf.org/html/rfc6350#section-6.7.4

In addition, the "REV" type described in Section 6.7.4 can be specified to indicate the last time that the vCard data was updated.

@jonatoni isn't it the purpose of the REV field?

Ah - I thought it is only by accident the last modified date (as it would allow to be the etag to be valid if you just use the date, but it of course can also be something completely different).

Thanks @skjnldsv

@MorrisJobke wrong ticket?

Not really. @jonatoni asked me about this one here:

Please include 'Date Created', and 'Last Modified' as sorting options.

It would be very much appreciated it the sort order would ont only be "first name" or "last name" but in fact "last name, first name", across all address books, as it was available in the old owncloud contacts app.

I've recently upgraded from ownloud 8.2.x to nextcloud 12, and even though this new app looks much smarter, this is one of the features that I'm missing in contacts 1.5.3.

Location sort order

Having a sort order of 'Location' would be amazing and very useful.
It could sort by the following priority:
Home Address
County > State > Town (if avail)
If no Home Address then
Work Address
Country > State > Town (if avail)
If no address then normal name sort order for the remainder.

Sorry, I only saw this now – @skjnldsv @MorrisJobke @jonatoni what’s the use-case of sorting by anything else than First name, or Last name? Does any other contacts app have a »last modified« sort option?

What would be a nice sort could be connecting from the mail app to sort it by »Most contacted«, or also sort favorites up top as described in #105.

The REV field is the last modified you're looking for! :)

giphy

@jancborchardt Eventually to see which contacts have recently been modified, e.g. uploaded from a smartphone after a new phone number has been added, or something. I've seen quite some times that vcards have been messed up in such cases, so it could be very useful to check the latest changes.
Concerning sorting by lastname or firstname: As mentioned earlier I'd find it very useful to really sort by "Lastname, Firstname" to have a proper sort order even if you have a huge number of family members with the same lastname, and it would be even more overseeable if this was reflected in the side bar on the left.

@jancborchardt
1) People add contacts on-the-go at meetings or parties, via their smartphone.
They will want to either remember who they are, or add extra information at a later stage.
Last modified and date created makes that much easier.
2) Sorting by location/country would be incredibly useful for obvious reasons (when people are visiting or dealing with a country or city and want a quick view of who to contact/visit).

Alright, recently modified seems to make sense. However not a priority since it’s a big overhead and also there doesn’t seem anything comparable in common apps.

Sorting by location/country would be incredibly useful for obvious reasons (when people are visiting or dealing with a country or city and want a quick view of who to contact/visit).

We have a search for this, which I also use for exactly this case. ;)

@olantrust recently created might be a good application for "smart groups".
I believe there already exists an issue regarding smart groups.

Sort by date created would actually be very helpful, also in a business context where you could see new customers at the top.

Sorting by date pull request is here: #992 :tada:
Please come and help review!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Peque picture Peque  Â·  3Comments

Spartachetto picture Spartachetto  Â·  3Comments

keunes picture keunes  Â·  4Comments

stvogel picture stvogel  Â·  3Comments

kangaroo72 picture kangaroo72  Â·  4Comments