Using 16.1 template in own apps

classic Classic list List threaded Threaded
7 messages Options
sneakyX sneakyX
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using 16.1 template in own apps

Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

I have 2 questions:

First, I'd like to use the left navigation bar and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

If someone is interested in my invoice programm, source code is here:
https://sourceforge.net/projects/rosin/

Ready-to-use docker image is here:
https://hub.docker.com/r/sneaky/egroupware-extended/

Thanks for Your answers and suggestions

André


--
Rothaar Systems Andre Scholz

Hauptstr. 29
57319 Bad Berleburg
Tel: 02759/9479-000
Fax: 02759/9479-001

email: [hidden email]
Internet: http://www.rothaarsystems.de
Steuernummer: 342/5284/1230
USt-IdNr.: DE196134895
Amtsgericht Bad Berleburg


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps



On 25 January 2017 at 13:28, André Scholz <[hidden email]> wrote:
Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

Yes, it is.

In general, your best approach is to find an existing app that does what you want, and copy part of it.

First, I'd like to use the left navigation bar

Putting a regular menu in the sidebox is fairly easy:
N.B that the file name requirement has been removed, just set the hook in setup.inc.php appropriately.

Getting fancy with an etemplate in the sidebox is a little more difficult (eg. calendar, mail, projectmanager ), and I would have to carefully go through one of those apps if I had to do it again.


and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

"popup messages" is a little vague.
I'm pretty sure the email compose is just a normal popup. 
Notifications (eg: "4 entries deleted") can be done using:

Framework::message(...);

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

Yes, this is possible.
I believe you will be using api/src/Mailer.php

Depending on why you're sending an email, we also have a whole notification system that provides more options, and change tracking that can send notifications when something changes.

Hope that helps,
Nathan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
sneakyX sneakyX
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps

Hello Nathan,

thanks for Your answer. I couldn't respond earlier.
I have just a very dumb question: When I use
Framework::message("Hello World");
I just get a
PHP Fatal error:  Class 'Framework' not found in /usr/share/egroupware/rosine/index.php on line 19

I thought that all necessary files are included when I use
$GLOBALS['egw_info'] = array(
            'flags' => array(
                    'currentapp' => 'rosine',
                    'noheader'   => False,
                    'nonavbar'   => True
            ));

Thanks for Your answer.

André

Am 27.01.2017 um 16:44 schrieb Nathan Gray:


On 25 January 2017 at 13:28, André Scholz <[hidden email]> wrote:
Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

Yes, it is.

In general, your best approach is to find an existing app that does what you want, and copy part of it.

First, I'd like to use the left navigation bar

Putting a regular menu in the sidebox is fairly easy:
N.B that the file name requirement has been removed, just set the hook in setup.inc.php appropriately.

Getting fancy with an etemplate in the sidebox is a little more difficult (eg. calendar, mail, projectmanager ), and I would have to carefully go through one of those apps if I had to do it again.


and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

"popup messages" is a little vague.
I'm pretty sure the email compose is just a normal popup. 
Notifications (eg: "4 entries deleted") can be done using:

Framework::message(...);

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

Yes, this is possible.
I believe you will be using api/src/Mailer.php

Depending on why you're sending an email, we also have a whole notification system that provides more options, and change tracking that can send notifications when something changes.

Hope that helps,
Nathan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


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



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
filkaris filkaris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps

Include this in your php file:

use EGroupware\Api\Framework;


On Sat, Feb 4, 2017 at 7:11 PM, André Scholz <[hidden email]> wrote:
Hello Nathan,

thanks for Your answer. I couldn't respond earlier.
I have just a very dumb question: When I use
Framework::message("Hello World");
I just get a
PHP Fatal error:  Class 'Framework' not found in /usr/share/egroupware/rosine/index.php on line 19

I thought that all necessary files are included when I use
$GLOBALS['egw_info'] = array(
            'flags' => array(
                    'currentapp' => 'rosine',
                    'noheader'   => False,
                    'nonavbar'   => True
            ));

Thanks for Your answer.

André


Am 27.01.2017 um 16:44 schrieb Nathan Gray:


On 25 January 2017 at 13:28, André Scholz <[hidden email]> wrote:
Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

Yes, it is.

In general, your best approach is to find an existing app that does what you want, and copy part of it.

First, I'd like to use the left navigation bar

Putting a regular menu in the sidebox is fairly easy:
N.B that the file name requirement has been removed, just set the hook in setup.inc.php appropriately.

Getting fancy with an etemplate in the sidebox is a little more difficult (eg. calendar, mail, projectmanager ), and I would have to carefully go through one of those apps if I had to do it again.


and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

"popup messages" is a little vague.
I'm pretty sure the email compose is just a normal popup. 
Notifications (eg: "4 entries deleted") can be done using:

Framework::message(...);

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

Yes, this is possible.
I believe you will be using api/src/Mailer.php

Depending on why you're sending an email, we also have a whole notification system that provides more options, and change tracking that can send notifications when something changes.

Hope that helps,
Nathan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


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



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
sneakyX sneakyX
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps

Hello Filippos,

thank for Your answer, the PHP error is away, but it still doesn't show the message.
It also doesn't work when I use the second parameter like:
Framework::message('Hello World!','error');

Do I have to use the full egroupware template system to use this function?

Thanks for the answer!

André


Am 04.02.2017 um 18:32 schrieb Filippos Karailanidis:
Include this in your php file:

use EGroupware\Api\Framework;


On Sat, Feb 4, 2017 at 7:11 PM, André Scholz <[hidden email]> wrote:
Hello Nathan,

thanks for Your answer. I couldn't respond earlier.
I have just a very dumb question: When I use
Framework::message("Hello World");
I just get a
PHP Fatal error:  Class 'Framework' not found in /usr/share/egroupware/rosine/index.php on line 19

I thought that all necessary files are included when I use
$GLOBALS['egw_info'] = array(
            'flags' => array(
                    'currentapp' => 'rosine',
                    'noheader'   => False,
                    'nonavbar'   => True
            ));

Thanks for Your answer.

André


Am 27.01.2017 um 16:44 schrieb Nathan Gray:


On 25 January 2017 at 13:28, André Scholz <[hidden email]> wrote:
Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

Yes, it is.

In general, your best approach is to find an existing app that does what you want, and copy part of it.

First, I'd like to use the left navigation bar

Putting a regular menu in the sidebox is fairly easy:
N.B that the file name requirement has been removed, just set the hook in setup.inc.php appropriately.

Getting fancy with an etemplate in the sidebox is a little more difficult (eg. calendar, mail, projectmanager ), and I would have to carefully go through one of those apps if I had to do it again.


and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

"popup messages" is a little vague.
I'm pretty sure the email compose is just a normal popup. 
Notifications (eg: "4 entries deleted") can be done using:

Framework::message(...);

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

Yes, this is possible.
I believe you will be using api/src/Mailer.php

Depending on why you're sending an email, we also have a whole notification system that provides more options, and change tracking that can send notifications when something changes.

Hope that helps,
Nathan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ eGroupWare-developers mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/egroupware-developers
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

-- 
Rothaar Systems
Schulungen & Beratung
IT * E-Technik * TK * Linux * Android * RaspberryPI/BananaPI
                                               
André Scholz
Hauptstr. 29
57319 Bad Berleburg
Tel: 02759/9479-000
Fax: 02759/9479-001

email: [hidden email]
Internet: http://www.rothaarsystems.de
Steuernummer: 342/5284/1230
USt-IdNr.: DE196134895
Amtsgericht Bad Berleburg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps



On 6 February 2017 at 04:05, André Scholz <[hidden email]> wrote:
Hello Filippos,

thank for Your answer, the PHP error is away, but it still doesn't show the message.
It also doesn't work when I use the second parameter like:
Framework::message('Hello World!','error');

While including the framework explicitly makes the error go away, it should not be needed.  Your Fatal error indicates something is not quite right in your code, or how it is called.  You should expect to encounter other errors, though I'm sorry I cannot guess the root cause.  Maybe namespace issues, maybe the autoloader is having trouble for some reason.  You might try:

use EGroupware\Api\Framework;

instead of the include.

Do I have to use the full egroupware template system to use this function?

Yes and no.
The etemplate system will bring the message to the client, and that's the easiest way.
If you're not going to use etemplate, you should still be able to call the function yourself using javascript on the client side:

egw.message('Hey');

Nathan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
sneakyX sneakyX
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using 16.1 template in own apps

In reply to this post by Nathan Gray
Hello all,

thank again for the answer with the problem sending an email with my application. I found out that I have to use the addHeader function for setting the subject of an email that function is not overwritten in the egroupware Mailerfunction, so it's not in the documentation. If someone else wants to know the original Horde Mail functions, the link is here:
https://dev.horde.org/api/master/lib/Mime/class-Horde_Mime_Mail.html

André

Am 27.01.2017 um 16:44 schrieb Nathan Gray:


On 25 January 2017 at 13:28, André Scholz <[hidden email]> wrote:
Hello 2 all,

I want to integrate my invoice program a bit more into egroupware, but
all information I found on the egroupware.org page seems to be outdated.

Yes, it is.

In general, your best approach is to find an existing app that does what you want, and copy part of it.

First, I'd like to use the left navigation bar

Putting a regular menu in the sidebox is fairly easy:
N.B that the file name requirement has been removed, just set the hook in setup.inc.php appropriately.

Getting fancy with an etemplate in the sidebox is a little more difficult (eg. calendar, mail, projectmanager ), and I would have to carefully go through one of those apps if I had to do it again.


and the popup messages -
like in "E-Mail send". Is there a documentation for using this?

"popup messages" is a little vague.
I'm pretty sure the email compose is just a normal popup. 
Notifications (eg: "4 entries deleted") can be done using:

Framework::message(...);

Second, I'd like to send an email with an attachment from my invoice
program using the mail app of egroupware. Is there a possibility to do this?

Yes, this is possible.
I believe you will be using api/src/Mailer.php

Depending on why you're sending an email, we also have a whole notification system that provides more options, and change tracking that can send notifications when something changes.

Hope that helps,
Nathan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


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


-- 
Rothaar Systems
Schulungen & Beratung
IT * E-Technik * TK * Linux * Android * RaspberryPI/BananaPI
                                               
André Scholz
Hauptstr. 29
57319 Bad Berleburg
Tel: 02759/9479-000
Fax: 02759/9479-001

email: [hidden email]
Internet: http://www.rothaarsystems.de
Steuernummer: 342/5284/1230
USt-IdNr.: DE196134895
Amtsgericht Bad Berleburg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
eGroupWare-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
Loading...