plugin tickets: added ticketsSet and ticketsSchemaGet methods:

those methods are high level methods specialised for tickets.

ticketsSet will use default tickets node if node is not set, set "created" and "updated" fields, create comments node if the ticket is new, and associate it with "comments_uri" field.

ticketsSchemaGet is like getUISchema with node defaulting to tickets default node.
This commit is contained in:
Goffi 2017-11-05 15:36:06 +01:00
commit 3b9659e52e

View file

@ -261,7 +261,7 @@ class PubsubSchema(object):
def sendDataFormItem(self, client, service, nodeIdentifier, values, schema=None, item_id=None, extra=None, deserialise=False):
"""Publish an item as a dataform when we know that there is a schema
@param values(dict[[iterable[object], object]): values set for the form
@param values(dict[key(unicode), [iterable[object], object]]): values set for the form
if not iterable, will be put in a list
@param schema(domish.Element, data_form.Form, None): data schema
None to retrieve data schema from node (need to do a additional XMPP call)
@ -270,6 +270,7 @@ class PubsubSchema(object):
This is done in this method and not directly in _sendDataFormItem because we need to know the data type
which is in the form, not availablable in _sendDataFormItem
other parameters as the same as for [self._p.sendItem]
@return (unicode): id of the created item
"""
form = yield self.getSchemaForm(client, service, nodeIdentifier, schema, form_type='submit')