Seite 1 von 1

Customer document

Verfasst: Fr 20. Mär 2015, 17:10
von ounos
Hey,

my customers have the ability to create wE documents, using some php code and we:write. Is there any way to store also customer owner in the document ? What I would manually do if I open a we document and under Tab: Customer > 'Connect with Customer' assing a customer.

Can I do that using php ?

Thank you in advance!

Re: Customer document

Verfasst: Fr 20. Mär 2015, 18:35
von mokraemer
currentliy only using php before calling <we:write>

Code: Alles auswählen

<?php
$GLOBALS['we_' . $type][$name]->WebUserID=$_SESSION['webuser']['ID'];
?>
where $name is the attribute formname and $type is one of (document,object)

Re: Customer document

Verfasst: Fr 20. Mär 2015, 21:14
von e_herrmann
@Marc: isn't it possible to use protected in we:write to do this. I think that's what's it for, no?

Re: Customer document

Verfasst: Sa 21. Mär 2015, 13:43
von mokraemer
@elko: unfortunately not, protected states only, that the document must have the same customer associated to successfully write the document. So this is only in effect on editing documents, not to write new ones. Even if it would write the customer on new documents, it can't update existing ones.

Re: Customer document

Verfasst: Sa 21. Mär 2015, 14:17
von e_herrmann
ah, I just saw: it works with objects, but not with documents.
The differences in details between objects and documents are really shitty.

Re: Customer document

Verfasst: Sa 21. Mär 2015, 14:50
von mokraemer
Ups, no, you're right, both for both this should be written with we:write if protected is set & it's a new document.
The documentation has to be updated on this.

Re: Customer document

Verfasst: Sa 21. Mär 2015, 15:33
von e_herrmann
@Marc: ich hatte das auch so verstanden, dass es dafür da ist.
Hab gerade noch einmal geschaut, es geht bei Dokumenten und Objekten!

Re: Customer document

Verfasst: Di 31. Mär 2015, 10:01
von ounos
JFTR: It worked using we:write attirbute protected=true.