new Template()
Template serves as a starting point for a document or asset label
Properties:
Name | Type | Description |
---|---|---|
name |
string | the name |
status |
string | the status |
body |
string | the body (in html, xml, text, ... depending on the |
format |
string | the format (pdf, label, dymo) |
kind |
string | the kind of pdf (order, reservation, customer) |
askSignature |
boolean | should we ask for a signature when generating a pdf |
width |
float | the width of the template |
height |
float | the height of the template |
unit |
string | this unit that is used for dimensions (mm, inch) |
system |
boolean | is it a system template which cannot be changed? |
archived |
Moment | is the template archived |
createdBy |
string | the user that created the template (null for system templates) |
createdOn |
Moment | when the template was created |
modifiedBy |
string | the user that modified the template (null for system templates) |
modifiedOn |
Moment | when the template was modified |
Extends
Members
-
activate
-
Activates this template
-
archive
-
Archives this template
-
canActivate
-
Checks if we can activate a template
-
canArchive
-
Checks if we can archive a template
-
canDeactivate
-
Checks if we can deactivate a template
-
canUndoArchive
-
Checks if we can undoArchive a template
-
clone
-
Clones the template to a new one
-
deactivate
-
Deactivates this template
-
undoArchive
-
Unarchives this template
Methods
-
canDelete(){boolean}
-
Checks if we can delete the Template document
-
inherited create(skipRead){promise}
-
Creates an object by the default api.create
Name Type Description skipRead
skips reading the response via _fromJson (false)
-
inherited delete(){promise}
-
Deletes an object by the default api.delete
-
inherited discardChanges(){promise}
-
Discards any changes made to the object from the previously loaded raw response or resets it when no old raw response was found
-
inherited existsInDb(){boolean}
-
Checks if the document exists in the database
-
inherited get(_fields){promise}
-
Gets an object by the default api.get
Name Type Description _fields
-
isArchived(){boolean}
-
Checks if the object is archived
-
inherited isDirty(){boolean}
-
Checks if the object needs to be saved We don't check any of the keyvalues (or comments, attachments) here
-
isEmpty(){boolean}
-
Checks if the object is empty, it never is
-
isValid(){boolean}
-
Checks if the template has any validation errors
-
isValidName(){Boolean}
-
Checks if name is valid
-
inherited reload(_fields){promise}
-
Reloads the object from db
Name Type Description _fields
-
inherited reset(){promise}
-
Resets the object
-
inherited update(skipRead){promise}
-
Updates an object by the default api.update
Name Type Description skipRead
skips reading the response via _fromJson (false)