Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#474 closed new feature (worksforme)

Messages Application in Rox

Reported by: lemon-head Owned by: micha
Priority: major Milestone: 0.6.1-long
Component: unknown Keywords:
Cc:

Description

Yes, time to move to Rox!

I will use again the RoxPageView mechanism .. it turns out to work quite well :)

Change History (26)

comment:1 Changed 11 years ago by lemon-head

[4378] - first taste of messages application

http://test.bewelcome.org/messages

comment:2 Changed 11 years ago by lemon-head

  • Owner set to lemon-head
  • Status changed from new to assigned

comment:3 Changed 11 years ago by lemon-head

  • follow_up changed from none to test

Please test, and then give it some layout-love!

(Don't move to alpha for now!)

comment:4 Changed 11 years ago by feuerdaemon

Bug: Drafts are also listed in the tab "sent"
Bug: Click on "mailbox" on any shown message produce a error message (Notice: Trying to get property of non-object in /var/www/test_html/build/messages/messages.view.php on line 202) -> It cannot get the other member name "Messages between and henri ( = myself)".
Bug: After sending a Message "Message date : 0000-00-00 00:00:00"
Question: Why is there a edit button for sent messages?
Suggestion: Maybe impelment a function to resend a message.

But so far it works fine. Tested with Acc Henri on WinXP FF 2.0.0.13 IE 6.0.2900.2180

comment:5 Changed 11 years ago by lemon-head

I will try to fix these things.

Please have a special look at what happens with your form input when you are logged out, when your session is expired, or when you resend the form.

comment:6 Changed 11 years ago by lemon-head

Some things should be fixed now.

For testing expired sessions, you can delete your sidTB cookie and then send the form.

comment:7 Changed 11 years ago by feuerdaemon

Workes fine so far. Tested with Kubuntu 7.10 FF 2.0.0.13, WinXP FF 2.0.0.13, MS IE 6

Maybe add a button to be able to delete the messages, would be very nice. But the rest is working.

comment:8 Changed 11 years ago by lemon-head

cool

Could you have a look at the old messages application, and make a list of what is different, or what is still missing in the new one? I'm sure there must be more things to do :)

comment:9 Changed 11 years ago by lemon-head

ah, one thing i have to remember is to check if after logout and login it is still the same person writing!

comment:10 Changed 11 years ago by lemon-head

  • Milestone changed from unassigned to Applications using Rox Framework

comment:11 Changed 11 years ago by philipp

  • Milestone changed from Applications using Rox Framework to 0.5.2-long

Milestone Applications using Rox Framework deleted

comment:12 Changed 10 years ago by globetrotter_tt

I am not sure if it's good to display the whole content of each single message in the received/send folder.

Better: Display only the 100 first characters - Even better: Add a subject field to every message

  • The delete and mark spam button are missing.
  • The checkbox to select a message are missing
  • It is not possible to sort your messages anymore
  • The layout cold also be improved. (padding!, confusing from/to)

I have worked a bit on my local BW on this, but i need some help some with php :-(

comment:13 Changed 10 years ago by lemon-head

I am not sure if it's good to display the whole content of each single message in the received/send folder.

Better: Display only the 100 first characters

yes. And ideally break at a space or linebreak, not at a character.
This is what I was playing with on localhost. It counts words, not characters.
Even better would be to count the characters, but break the words..

class MailboxWidget extends ItemlistWithPagination
{
    ....
    protected function tableCell_title($message)
    {
        $link = 'messages/'.$message->id;
        $text = $message->Message;
        $text_fragments = preg_split("/(\s)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
        if (count($text_fragments) > 38) {
            $text = implode('', array_slice($text_fragments, 0, 35)).' ...';
        }
        echo '
        <a href="'.$link.'">'.$text.'</a>';
    }
    ....
}


Even better: Add a subject field to every message

this will need modifications in the DB, and also the mailbot. And, for existing messages we don't have a subject field. I suggest we do this when the rest is finished.


The delete and mark spam button are missing.

You mean, in the list, or in the single message view? We need both, I think.


The checkbox to select a message are missing

For the list, something like this will do:
(If this is for more than one list, then add it to class MailboxWidget?)

class MailboxWidget extends ItemlistWithPagination
{
    ....
    protected function getTableColumns()
    {
        return array(
            'checkbox' => 'Select',   // or choose a different column title...
            'contact' => 'From/To',
            'title' => 'Text',
            'dateSent' => 'Date'
        );
    }
    
    protected function tableCell_checkbox($message)
    {
        echo '<input type="checkbox" name="'.$message->id.'"/>';
    }
    
    function render()
    {
        echo '
        <form method="post" ...>';
        
        parent::render();
        
        echo '
        <select ..> ... </select>
        <input type="submit" .../>
        </form>';
    }
    ....
}


It is not possible to sort your messages anymore

Ok, this is less trivial. You/We? need to change the way the mailbox widget obtains its messages. This is a good idea anyway, because currently it is only sub-efficient. The key methods in MailboxWidget? / ItemlistWithPagination? are

  • getAllItems()
  • getItemsInRange($begin, $count)
  • getItemsTotalCount()

Ideally, we would set a $widget->mailbox = $model->getReceivedMailbox($username);. Then, inside MailboxWidget?, we can write

class MailboxWidget extends ItemlistWithPagination
{
    ....
    protected function getItemsTotalCount() {
        return $this->mailbox->getMessagesTotalCount();
    }
    
    protected function getItemsInRange($begin, $count) {
        return $this->mailbox->getMessagesInRange($begin, $count);
    }
    ....
}

Somehow the mailbox has to be implemented somewhere. This could happen as a new class for every mailbox, or as using class PrefixWrap (I can explain that, if you want).


The layout cold also be improved. (padding!, confusing from/to)

Ok, that's why you are working on it :)


I have worked a bit on my local BW on this, but i need some help some with php :-(

If you have specific questions, feel free to ask!

btw, this trac comment with quotes looks incredibly ugly. Even plain text is nicer! (could be partly my fault, the trac css..)

comment:14 Changed 10 years ago by globetrotter_tt

  • Owner changed from lemon-head to globetrotter_tt
  • Status changed from assigned to new

comment:15 Changed 10 years ago by globetrotter_tt

  • Status changed from new to assigned

comment:16 Changed 10 years ago by globetrotter_tt

  • Owner changed from globetrotter_tt to globetrotter_tt, lemon-head
  • Status changed from assigned to new

comment:17 Changed 10 years ago by globetrotter_tt

  • Owner changed from globetrotter_tt, lemon-head to globetrotter_tt
  • Status changed from new to assigned

comment:18 Changed 10 years ago by globetrotter_tt

  • Owner changed from globetrotter_tt to lemon-head
  • Status changed from assigned to new

comment:19 Changed 10 years ago by midsch

  • follow_up changed from test to review code

http://test.bewelcome.org/messages

Above the mails:

Formkit::setPostCallback
callback method MessagesController::mailBoxCallback
does not exist!

Below the mails:

Notice: Undefined variable: actionurl in /var/www/test.bewelcome.org/build/messages/mailbox.page.php on line 52

Warning: MessagesPageWithMailbox::require_once(templates/actions.php) [function.MessagesPageWithMailbox-require-once]: failed to open stream: No such file or directory in /var/www/test.bewelcome.org/build/messages/mailbox.page.php on line 20

Fatal error: MessagesPageWithMailbox::require_once() [function.require]: Failed opening required 'templates/actions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test.bewelcome.org/build/messages/mailbox.page.php on line 20

Instead of the filter ("all messages with one person") I'd prefer standard mail tools: reply, forward and so on as I've probably read the message in my mailbox before and want to go to action straight. BTW: It's very hard to find the link to READ the message, but that's much more important than "all messages with".

comment:20 Changed 10 years ago by micha

  • Owner changed from lemon-head to micha

It's a shame that this has been somehow forgotten. I fixed the bugs above. (r7217) Please test the message-app again at test.bewelcome.org/messages

comment:21 Changed 10 years ago by micha

  • follow_up changed from review code to test

comment:22 Changed 10 years ago by globetrotter_tt

Looks better, here my points:

  • the received, sent, spam, drafts link appear as tabs and in the left column.
  • It's not possible to sort the messages anymore
  • a click on the username directs to "all messages with...". A link to a username should always link to the profile.
  • I would put the link "all messages with..." on the message page next to the userpic instead showing it on the overview page next to every message.
  • an icon that marks replied messages would be neat.

comment:23 Changed 10 years ago by micha

  • freq_reported changed from 1 to >10

Thanks for the feedback. Got it all working now. Only thing that is hard to realize yet: The icon for replied messages. But maybe soon we can just show all the messages in conversation style as gmail does...

Any bugs and the newest version?

comment:24 Changed 10 years ago by globetrotter_tt

Thanks for fixing this, Micha :-)

Conversion style and labels would be cool. But first here are more things that i would like to fix:

  • the thumbnails of users in the "sent" section is always the same. (my own)
  • a select box in the table header to select all/none messages (needs some js) would be also cool
  • what is the sense of the "edimessage" button that appears after you sent a message ?
  • maybe showing the date like "09 MAR 2009" or "09/03/2009" would be more expressive than just "one month ago" as you probably receive more than one message in a month ;)

So far i haven't found any serious errors, but would be better if more people have a look on it.

comment:25 Changed 10 years ago by micha

  • Milestone changed from 0.5.2-long to 0.6.1-long
  • Resolution set to worksforme
  • Status changed from new to closed

as it's already on production, we should open new tickets for problems with this..

comment:26 Changed 10 years ago by micha

  • follow_up changed from test to none
Note: See TracTickets for help on using tickets.