Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

classic Classic list List threaded Threaded
5 messages Options
umehner umehner
Reply | Threaded
Open this post in threaded view
|

Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

Hi,

I had some issues with my new and very first Windows 10 mobile phone using calendar sync through Exchange Activesync (EAS) and built in Outlook calendar app.
The calendar description is synched wrong or not at all.
I fixed it with editing file egroupware/activesync/inc/class.activesync_backend.inc.php :

First, for synching eGW to phone the items have their body set to $bodypreference[1] sent to function note2messagenote , the code there expects only $bodypreference[2] . So I changed the code to accept [1] as well as [2] to run through html wrapping for the message body (and truncation).

But this wasn't enough, W10mobile Outlook app seems not to be able to render <br />s properly. It needs paragraphs instead.
So I changed the html wrapping code to
'<body><p style="font-size: 14.0pt;">'.
str_replace(array("\n","\r","\r\n"),"</p><p style=\"font-size: 14.0pt;\">",$note).
'</p></body>'.

Second, when creating a new calendar item on the phone and synching it to eGW the description gets lost.
It turned out that the item had $airsyncbasebody->type set to 2 when sent to function messagenote2note in the same file as above, so I added a case '2' with
case '2' :    $body = html_entity_decode( strip_tags( str_replace('</p>', "\n", $airsyncbasebody->data) ) );
break;
Outlook app allows to create calendar description like an html email (for example colored text and stuff). These kind of decorations gets removed. Hope everyone can live with that.

Maybe my code suggestions help addressing (and fixing) the issues.

Cheers,
Ulle
 
eGroupware SVN Trunk
Ralf Becker Stylite AG Ralf Becker Stylite AG
Reply | Threaded
Open this post in threaded view
|

Re: Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

Hi Ulle,

sorry it took so long to respond :(

The following commit, which will be part of 2. RC contains your
suggested fixes:

   
https://github.com/EGroupware/activesync/commit/e55c1fb03a4f8adb27a3fc35179f1249add63df0

Ralf

Am 14.01.16 um 22:35 schrieb umehner:

> Hi,
>
> I had some issues with my new and very first Windows 10 mobile phone using
> calendar sync through Exchange Activesync (EAS) and built in Outlook
> calendar app.
> The calendar description is synched wrong or not at all.
> I fixed it with editing file
> egroupware/activesync/inc/class.activesync_backend.inc.php :
>
> First, for synching eGW to phone the items have their body set to
> $bodypreference[1] sent to function note2messagenote , the code there
> expects only $bodypreference[2] . So I changed the code to accept [1] as
> well as [2] to run through html wrapping for the message body (and
> truncation).
>
> But this wasn't enough, W10mobile Outlook app seems not to be able to render
> <br />s properly. It needs paragraphs instead.
> So I changed the html wrapping code to
>
>
> Second, when creating a new calendar item on the phone and synching it to
> eGW the description gets lost.
> It turned out that the item had $airsyncbasebody->type set to 2 when sent to
> function messagenote2note in the same file as above, so I added a case '2'
> with
>
> Outlook app allows to create calendar description like an html email (for
> example colored text and stuff). These kind of decorations gets removed.
> Hope everyone can live with that.
>
> Maybe my code suggestions help addressing (and fixing) the issues.
>
> Cheers,
> Ulle
>  
>
>
>
>
> -----
> eGroupware SVN Trunk
>
> --
> View this message in context: http://egroupware.219119.n3.nabble.com/Activesync-eSync-z-push-in-current-trunk-of-egroupware-Calendar-and-Windows-10-mobile-tp4010839.html
> Sent from the egroupware-developers mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> eGroupWare-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/egroupware-developers

--
Ralf Becker
Director Software Development

Stylite AG

Isaac-Fulda-Allee 9 | Tel. +49 6131 32702-0
D-55124 Mainz       | Fax. +49 6131 32702-70

Email: [hidden email]

www.stylite.de | www.egroupware.org

Managing Directors: Andre Keller | Ralf Becker | Gudrun Mueller
Chairman of the supervisory board: Prof. Dr. Birger Leon Kropshofer

VAT DE214280951 | Registered HRB 46224 Mainz Germany



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

signature.asc (817 bytes) Download Attachment
umehner umehner
Reply | Threaded
Open this post in threaded view
|

Re: Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

Hi Ralf,

I switched from svn-trunk to github 16.x master recently. Thanks for considering my suggestions!

Apparently it seems as if MS has released an update since my last post - the paragraphs and linebreaks are now being rendered correctly. So this can be set back from <p> to <br /> again. Description text is tiny, but can be zoomed with two fingers (no font sizing needed).
But: Last time I was missing an important detail for W10mobile html body. It comes with $bodypreference[1] instead of $bodypreference[2] .
So together with the truncation part my working code looks now like
                        if (isset($bodypreference[1]) || isset($bodypreference[2]))
                        {
                                ZLog::Write(LOGLEVEL_DEBUG, "HTML Body");
                                $airsyncbasebody->type = 2;
                                $html = '<html>'.
                                                '<head>'.
                                                '<meta name="Generator" content="eGroupware/Z-Push">'.
                                                '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'.
                                                '</head>'.
                                                '<body>'.
                                                str_replace(array("\n","\r","\r\n"),"<br />",$note).
                                                '</body>'.
                                                '</html>';
                                if ( isset($bodypreference[1]["TruncationSize"]) && strlen($html) > $bodypreference[1]["TruncationSize"])
                                {
                                        $html = utf8_truncate($html,$bodypreference[1]["TruncationSize"]);
                                        $airsyncbasebody->truncated = 1;
                                }
                                if ( (isset($bodypreference[1]["TruncationSize"]) || isset($bodypreference[2]["TruncationSize"])) && strlen($html) > $bodypreference[2][
"TruncationSize"])
                                {
                                        $html = utf8_truncate($html,$bodypreference[2]["TruncationSize"]);
                                        $airsyncbasebody->truncated = 1;
                                }
                                $airsyncbasebody->estimateddatasize = strlen($html);
                                $airsyncbasebody->data = StringStreamWrapper::Open($html);

Cheers,
Ulle
eGroupware SVN Trunk
Ralf Becker Stylite AG Ralf Becker Stylite AG
Reply | Threaded
Open this post in threaded view
|

Re: Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

Hi Ulle,

Am 30.07.16 um 22:08 schrieb umehner:

> Hi Ralf,
>
> I switched from svn-trunk to github 16.x master recently. Thanks for
> considering my suggestions!
>
> Apparently it seems as if MS has released an update since my last post - the
> paragraphs and linebreaks are now being rendered correctly. So this can be
> set back from <p> to <br /> again. Description text is tiny, but can be
> zoomed with two fingers (no font sizing needed).
> But: Last time I was missing an important detail for W10mobile html body. It
> comes with $bodypreference[1] instead of $bodypreference[2] .
> So together with the truncation part my working code looks now like
Unfortunately there is no code here, maybe Nabble forum or mailing list
eat it.

Most easy for use would be to fork our code on Github and send a pull
request, then we can discuss everything in there.
Anyway I'm happy for however you send comments :)

Ralf

--
Ralf Becker
Director Software Development

Stylite AG

Isaac-Fulda-Allee 9 | Tel. +49 6131 32702-0
D-55124 Mainz       | Fax. +49 6131 32702-70

Email: [hidden email]

www.stylite.de | www.egroupware.org

Managing Directors: Andre Keller | Gudrun Mueller
Chairman of the supervisory board: Prof. Dr. Birger Leon Kropshofer

VAT DE214280951 | Registered HRB 46224 Mainz Germany



------------------------------------------------------------------------------

_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

signature.asc (817 bytes) Download Attachment
umehner umehner
Reply | Threaded
Open this post in threaded view
|

Re: Activesync, eSync, z-push in current trunk of egroupware: Calendar and Windows 10 mobile

Ralf Becker Stylite AG wrote
> But: Last time I was missing an important detail for W10mobile html body. It
> comes with $bodypreference[1] instead of $bodypreference[2] .
> So together with the truncation part my working code looks now like

Unfortunately there is no code here, maybe Nabble forum or mailing list
eat it.
Okay, didn't know that it gets lost somewhere as it is still shown here:
http://www.egroupware.org/discover/egroupware-forum#nabble-td4010839|a4013773

Ralf Becker Stylite AG wrote
Most easy for use would be to fork our code on Github and send a pull
request, then we can discuss everything in there.
Getting familiar with git seems to be too much effort to me currently. I could barely do a pull (I was used to "checkout") for getting 16.x/master ...

Cheers,
Ulle
eGroupware SVN Trunk