Printed Forms: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 1: Line 1:
Este tutorial describe como crear formularios "estandarizados" u "oficiales" en PDF en base a los datos del sistema. Esto puede ser útil para generar certificados de capacitación, cartas de formularios en un cambio de puesto o validar quién trabaja en las instalaciones o en el distrito.
This tutorial describes how to create "standardized" or "official" PDF forms based upon the data in the system.  This could be useful for generating training certificates, generating form letters on a position change, or validating who works in a facility or district.


Este módulo primero aparece en la versión 4.0.5 de la Suite iHRIS.
This module first appears in version 4.0.5 of the iHRIS Suite.


Dependiendo de sus necesidades, podría querer ver estos otros métodos para la generación de formularios estandarizados:
Depending on your needs, you may wish to look at these other methods for standardized form generation:
*[[Printed Forms form Relationships (ODT)]]
*[[Printed Forms form Relationships (ODT)]]
*[[Standardized Letters (ODT)]]
*[[Standardized Letters (ODT)]]
*[[Printed Forms with Reports (ODT)]]
*[[Printed Forms with Reports (ODT)]]


==Datos Fuente==
==Source Data==
Los datos fuente para el formulario impreso estarán basados en una [[Custom Reporting -- Creating Form Relationships|Relación de Formularios]].
The source data for the printed form will be  based on a [[Custom Reporting -- Creating Form Relationships|form relationship]].


==Interacción de Páginas==
==Page Interaction==
===Imprimir===
===Print===
En la primera fase de este módulo, la única interacción es para producir los formularios impresos en base a lo que se ha guardado en los [[#Magic Data Details|datos magic]].  No habrá un componente de "diseño de documento" .  Se podrá tener acceso al formulario estándar a través de un URL con el nombre del formulario estandarizado y una variable GET/POST que contenga una o más de las id del formulario primario en la relación. Por ejemplo:
At the first phase of this module, the only interaction is to produce the printed forms based on what is stored in [[#Magic Data Details|magic data]].  There will be no "document design" componentThe standard form will be accessed through a URL with the name of the standardized form and a GET/POST variable containing one or more of the id's for the primary form in the form relationship. For example:
  http://'''<SITE_URL>'''/PrintedForms/print/'''registration'''?ids[]=person|12&ids[]=person|14&ids=[]person|22
  http://'''<SITE_URL>'''/PrintedForms/print/'''registration'''?ids[]=person|12&ids[]=person|14&ids=[]person|22


Utilizar este URL causaría lo siguiente:
Hitting this URL would cause the following to happen:
*verificar que existe un formulario estandarizado llamado '''registration'''  
*verify that a standardized form called '''registration''' exists
*verificar que el usuario tiene los permisos apropiados para ver este formulario estandarizado:  
*verify that the user has the appropriate permission to view this standardized form:  
**Revisar si el usuario tiene la tarea 'printed_forms_all_generate''''
**Check to see if the user has the task 'printed_forms_all_generate''''
**Si no, revisar si la tarea 'printed_forms_generate_'''registration'''' existe y el usuario tiene esta tarea
**If not, check to see if the task 'printed_forms_generate_'''registration'''' exists and the user has this task
*pra cada id, ''person|12'', ''person|14'', ''person|22'' llenar los detalles del informe estandarizado utilizando las filas correspondientes en la tabla de informes si existe (ver abajo).
*for each of the ids, ''person|12'', ''person|14'', ''person|22'' fill out the details of the standardized report by using the corresponding row in the report table if it exists (see below).


===Menú===
===Menu===


Es posible ver cuales formularios se pueden generar para una id dada haciendo el siguiente llamado
One should be able to see which forms can be generated for a given id.  Calling
  http://'''<SITE_URL>'''/PrintedForms/menu?id=person|12
  http://'''<SITE_URL>'''/PrintedForms/menu?id=person|12
mostrará todos los formularios impresos cuyo formulario primario es person.  Entonces para cada uno de estos tendrá un link a la página de impresión correspondiente.   
will show all the printed forms whose primary form is person.  Then for each of these you will have a link to the corresponding print page.   


También debe vincular a la página de archivo correspondiente y mostrar cuales formularios en PDF ya se han archivado para esa persona clasificados por tipo y fecha.
You should also link to the corresponding archive page and show which PDF forms have already been archived for that person sorted by type and date.


===Archivo===
===Archive===
También debe crear un formulario, por ejemplo ''generated_doc'' que contenga los siguientes campos:
You should also create a form, say ''generated_doc'' which contains the following fields:
*document: Un campo binario que contendrá el PDF
*document: A binary field which will contain the PDF it
*date: la fecha en la que fue generado
*date: the date it was generated by
*type: el formulario standard impreso (es decir, registro en el ejemplo anterior)
*type: the print standard form  (e.g. registration in the above example)
Al llamar a la página de archivo como:
When calling the archive page as:
  http://'''<SITE_URL>'''/PrintedForms/archive/'''registration'''?ids[]=person|12&ids[]=person|14&ids=[]person|22
  http://'''<SITE_URL>'''/PrintedForms/archive/'''registration'''?ids[]=person|12&ids[]=person|14&ids=[]person|22
Se ejecutará lo siguiente:
It will:
*revisar si 'generated_form' es un formulario secundario de person.  Si no, la ejecución se detiene.
*check to see if 'generated_form' is a child form of person.  If not execution stops.
*para cada id crear el formulario PDF (solo uno en cada página/documento) y guardarlo como un formulario secundario ''generated_doc''
*for each of the id's it will created the PDF form (only one on each page/document) and save it as a child ''generated_doc'' form


==Detalles de Datos Magic==
==Magic Data Details==
Todos los formularios estandarizados se guardarán en el nodo de datos magic:
All standardized forms will be stored under the magic data node:
  /modules/PrintedForms/forms
  /modules/PrintedForms/forms
En el ejemplo anterior los detalles que definen el formulario de registro se guardarían bajo:
In the example above the details defining the registration form would stored under:
  /modules/PrintedForms/forms/registration
  /modules/PrintedForms/forms/registration


Los detalles de un formulario específico son los siguientes (todas las medidas son en mm):
The details for a specific form are as follows (all measurements are in mm):
*relationship: Nodo escalar requerido. El nombre de la relación de formulario en la que se basa este formulario. Debe ser el nombre de un nodo secundario de ''/modules/CustomReports/relationships''
*relationship: Required scalar node. the name of the form relationship that this form is based off of. It needs to be the name of a child node of ''/modules/CustomReports/relationships''
*displayName: Nodo escalar opcionalEl nombre de la carta impresa como se muestra al usuario final.
*displayName: Optional scalar nodeThe name of the printed letter as displayed to the end user.
*archive: Nodo escalar opcionalSi se ha establecido, debe ser un formulario nombrado en la relación. Si es un formulario de nombre válido, entonces permitirá la archivación de esta carta impresa como un formulario secundario del formulario nombrado correspondiente. Debe asegurarse que este formulario tiene un ''generated_doc'' como un [[Defining Forms | formulario secundario]] válido.
*archive: Optional scalar nodeIf set it should be a named form in the relationship. If it is a valid named form, then it will enable archiving of this printed letter as a child form of the corresponding named form. You should ensure that this form has ''generated_doc'' as a valid [[Defining Forms | child form]].
*layout_details: Nodo primario opcional que describe los detalles de de la diagramación de la página. Contiene los siguientes nodos secundarios.
*layout_details: Optional parent node describing the page layout details for the form. It contains the following child nodes.
**encoding:  Nodo escalar opcional. La codificación utilizada por el renderer(PDF). Por defecto es ASCII
**encoding:  Optional scalar node. The encoding used by the renderer(PDF). Defaults to ASCII
**hyphenation_file: Nodo escalar opcionalArchivo utilizado para la separación. Por defecto en hyph_en_US.dic'
**hyphenation_file: Optional scalar nodeFile used for hyphenation. Defaults to hyph_en_US.dic'
**orientation:  Nodo escalar opcionalPor defecto a 'P' de portrait.  La otra opción es 'L' de landscape
**orientation:  Optional scalar nodeDefaults to 'P' for portrait.  The other option is 'L' for landscape
**size: Nodo escalar opcional. Por defecto 'A4' para describer el papel que se utilizará. Debe ser uno de los tamaños de papel ISO 216 estándar, es decir 'A4', o uno de los tamaños de papel Norteamericanos como 'carta' o 'legal'   
**size: Optional scalar node. Defaults to 'A4' to describe the paper to be used. Should be one of the  ISO 216 standard paper sizes, e.g. 'A4', or one of the North American paper sizes, e.g. 'letter' or 'legal'   
**rows:  Nodo escalar opcionaPor defecto 1.  El número de filas de de formularios a imprimir en una página.
**rows:  Optional scalar nodeDefaults to 1.  The number of rows of forms to be printed on the page.
**cols:  Nodo escalar opcionalPor defecto 1.  El número de columnas de formularios a imprimir en la página.
**cols:  Optional scalar nodeDefaults to 1.  The number of columns of forms to be printed on the page.
**border: Nodo escalar opcionalPor defecto 0 si las filas y columnas son 1, de lo contrario por defecto es 1.  El ancho del borde dibujado alrededor de los formularios.  
**border: Optional scalar nodeDefaults to 0 if rows and columns are 1, otherwise it to defaults to 1.  The width of the border drawn around the forms.  
**vert_pad: Nodo escalar opcional. Por defecto 10.  El espacio vertical utilizado en el límite de la página
**vert_pad: Optional scalar node. Defaults to 10.  The vertical padding used on the page boundary
**horiz_pad: Nodo escalar opcional. Por defecto 10.  El espacio horizontal utilizado en el límite de la página
**horiz_pad: Optional scalar node. Defaults to 10.  The horizontal padding used on the page boundary
**vert_pad_border: Por defecto 0. El espacio vertical utilizado entre formularios
**vert_pad_border: Defaults to 0. The vertical padding used between forms
**horiz_pad_border: Por defecto 0. El espacio vertical utilizado entre formularios
**horiz_pad_border: Defaults to 0. The vertical padding used between forms
*text_properties: Un nodo primario opcional que define las propiedades de texto por defecto de los tipos de elementos en el documentoLos nombres de los nodos secundarios son los nombres de los tipos de elementos (imágen o texto).  Los valores posibles son:
*text_properties: An optional parent node defining the default text properties  of the element types of the documentChild node names are the name of the element types (image or text).  Possible values are:
**font:  Nodo escalar opcionalPor defecto helvetica.  Debe limitarse a uno de los tipos de letra standard de pdf: times,helvetica, courier
**font:  Optional scalar nodeDefaults to helvetica.  Should be limited to one of the standard pdf fonts: times,helvetica, courier
**size: Nodo entero positive opcional. Tamaño en puntos de tipo de letra. Por defecto 12.
**size: Optional positive integer node.Size in points of font. Defaults to 12.
**alignment: Nodo escalar opcionalPor defecto 'L' por left.  Puede ser 'R' o 'J', 'L' o 'C'
**alignment: Optional scalar nodeDefaults to 'L' for left.  Can be 'R' or 'J', 'L' or 'C'
**color: Color opcional del primer plano/texto . Utiliza colores estilo html hex .  Por defecto negro #000000 ,  
**color: Optional color foreground/text color. Use html style hex colorsDefaults to black #000000 ,  
**bg_color: Color opcional de fondo. Utiliza colores estilo html hex .  Por defecto  'none' para transparente.
**bg_color: Optional background color. Use html style hex colorsDefaults to 'none' for transparent.
**style: Nodo escalar opcionalPor defecto ningunoPuede contener cualquiera de los siguientes caracteres, N de Negrita, S de subrayado , K para cursiva
**style: Optional scalar nodeDefault to blankCan contain any of the following characters, B for bold, U for underline, I for italic
*elements: Nodo primario. Los secundarios Deben tener un índice numéricoLos elementos se agregan al document estándar en orden nemérico ascendente del nombre del nodo del elementoCada nodo secundario contendrá lo siguiente:
*elements: Parent node. Children should be numerically indexedElements are added to the standard document in increasing numeric order of the node name of the elementEach of the child nodes will contain the following:
**text_properties: Un nodo primario opcional que define las propiedades que aplican a este nodo y a todos los sub-elementos de este. La definición es la misma que la anterior.
**text_properties: An optional parent node defining the properties which applies to this node and all of its sub-elements of this. The definition is the same as above.
**type: Nodo escalar requeridoDebe ser 'text' 'image' o 'value'     
**type: Required scalar nodeShould be one of 'text' 'image' or 'value'     
**definition:  Depende del tipoVer abajo.  
**definition:  Depends on the typeSee below.  


===Definición del tipo: Texto===
===Definition for type: Text===
El elemento del texto es determinado tesxto a ubicarse en el documento. Debe consistir de los siguientes nodos:
The text element is just certain text to be placed in the document. It should consist of the following nodes:
*printf:  Nodo escalar opcional . La cadena printf debe ubicarse aquíPor defecto ''.  Ejemplo: "%s, %s has registation number %s"
*printf:  Optional scalar node. The a printf string to be placed hereDefaults to ''.  Example: "%s, %s has registation number %s"
*printf_args:  Nodo primario opcional Un arreglo de argumentos a sustituirse en el printf de la siguiente manera
*printf_args:  Optional parent nodeAn array of arguments to subsititute into the printf as follows
**'''formname'''+'''field''': un informe de campos de formularios a sustituirse en el printf.  E.g. "person+surname,person+fisrtname,registation+number":
**'''formname'''+'''field''': a report form fields to substitute into the printf.  E.g. "person+surname,person+fisrtname,registation+number":
**+'''relationshipFunction''':  La evaluación de la función nombrada función en la relación del formularioEjemplo +age65 cual sera el año en que la persona cumpla 65 años en la relacion de personal
**+'''relationshipFunction''':  The evaluation of the named function in the the form relationshipExample +age65 which be the year the person turns 65 in the staff relationship
**++date('''XYZ'''): Los datos formateados de acuerdo a '''XYZ'''  (sin comillas) usando las funciones [http://us2.php.net/manual/en/function.strftime.php strfrtime] .  Ejemplo ++date(%Y) es el año de cuatro dígitos
**++date('''XYZ'''): The data formatted according to '''XYZ'''  (unquoted) via [http://us2.php.net/manual/en/function.strftime.php strfrtime] functionsExample ++date(%Y) is the four digit year
**++date:  La fechaEste es el mismo de  ++date(%x).     
**++date:  The dateThis is the same as ++date(%x).     
**++user:  El nombre del usuario que imprime el formulario
**++user:  The name of the user printing the form
**++eval('''XYZ'''):  Evaluar el código php '''XYZ'''.  Ejemplo  ++eval(strftime("%Y")+60)  añadiría 60 al año actual
**++eval('''XYZ'''):  Evaluate the php code '''XYZ'''.  Example is ++eval(strftime("%Y")+60)  would add 60 to the current year
*horiz_min:  nodo escalar numérico requerido. Si la alineación es 'L' es la coordenada que está más a la izquierda para ubicar el texto. Si la alineación es 'R' es la coordenada qeu está más a la izquierda del texto
*horiz_min:  Required numeric scalar node. If the alignment is 'L' it is the left most coordinate to place this textIf the alignment is 'R' it is the right-most cooridnate of the text
*horiz_max: Nodo escalar numérico. Si no está establecido y la alineación es 'J' entonces la alineación se revierte a 'L'.    Si esta establecida y la alineación es 'L' es la coordenada que está más a la derechaSi está establecida y la alineación es 'R' entonces es la coordenada que está más a la izquierdaSi está establecida y la alineación es 'J' entonces es la coordenada que está más a la derecha y ''horiz-min'' es la coordenada que está más a la izquierda.
*horiz_max: Optional numeric scalar node. If not set and the allignment is 'J' then the alignment reverts to 'L'.    If set and allignment if 'L' is the right-most coordinateIf set and alignment is 'R' then it is the left-most coordinateIf set and alignment is 'J' then the this is the right-most coordinate and ''horiz-min'' is the left-most coodinate.
*vert_max: Optional numeric scalar node.  La coordenada que está más al fondo para ubicar el texto.  
*vert_max: Optional numeric scalar node.  The  bottom most coordinate to place this text.  
*vert_min: Valor escalar numérico requeridoLa coordenada de más arriba para ubicar el texto.
*vert_min: Required numeric scalar valueThe top most coordinate to place this text.


===Definición del Tipo: Imágen===
===Definition for Type: Image===
*image: Nodo standard Requerido. El nombre del archivo de imágen a ubicar. Puede ser:
*image: Required standard node. the name of the image file to place. It can either be:
**Un nombre de archivo, en cual caso la ruta de búsqueda utilizada es "PDF_IMAGES"
**A file name, in which case the search path used is "PDF_IMAGES"
**Una cadena "form://'''form+field'''"  donde el formulario se nombra form en la relación y el campo es un campo de tiempo IMAGE (e.g. "form://passport+image")
**A string like "form://'''form+field'''"  where form is a named form in the relationship and field is a field of time IMAGE (e.g. "form://passport+image")
*horiz_min:  Nodo escalar numérico requerido. El de más a la izquierda coordina para ubicar la imágen.
*horiz_min:  Required numeric scalar node. The left most coordinate to place the image.
*vert_min: Nodo escalar numérico requeridoEl de más arriba coordina para ubicar la imágen
*vert_min: Required numeric scalar nodeThe  top most coordinate to place the image
*horiz_max:  Nodo escalar numérico opcional. El de más a la derecha coordina para ubicar la imágenSi esta establecido, la imágen se reescala si es necesario.
*horiz_max:  Optional numeric scalar node. The right most coordinate to place the imageIf set, image is rescaled if needed.
*vert_max: Nodo escalar numérico opcionalEl de más abajo coordina para ubicar la imágenSi esta establecido, la imágen se reescala si es necesario.
*vert_max: Optional numeric scalar nodeThe  bottom most coordinate to place the imageIf set, image is rescaled if needed.


==Ejemplo==  
==Example==  
===Definir las características del Formulario Impreso===
===Defining the Printed Form features===
Por ejemplo, para producir una Staff Hire Letter en iHRIS Manage podría definirla como:
For example, to produce a Staff Hire Letter in iHRIS Manage you could define it as:
<source lang='xml'>
<source lang='xml'>
   <configurationGroup name="sample-hire-letter" path="/modules/PrintedForms/forms/sample_hire_letter">
   <configurationGroup name="sample-hire-letter" path="/modules/PrintedForms/forms/sample_hire_letter">
Line 196: Line 196:
</source>
</source>


===Crear un link para imprimir el formulario===
===Creating a link to print the form===
Después de que esto se ha establecido, debe abrir la plantilla de vista del formulario donde quiere ubicar el link a PrinteForm.
After that is set, then you need to open the view template for the form where you wish to place the link to print the PrinteForm.
<source lang="xml">
<source lang="xml">
<span type="module" name="PrintedForms" ifenabled="true">
<span type="module" name="PrintedForms" ifenabled="true">
Line 205: Line 205:
</span>
</span>
</source>
</source>
Lo descrito arriba sigificaría que el nombre de PrintedForm es sample_hire_letter y es primario de person.
The above would mean the name of the PrintedForm is sample_hire_letter and its parent form is person.


Esta parte del código debe insertarse favorablemente bajo el link para actualizar la información de un formulario. (view_form_name.html)
This piece of code should be inserted favorably below the link to update the information of a form. (view_form_name.html)


[[Category:Technical Overview]][[Category:Forms]][[Category:Review2013]][[Category:Needs Intro]]
[[Category:Technical Overview]][[Category:Forms]][[Category:Review2013]][[Category:Needs Intro]]

Revision as of 22:13, 30 September 2013

This tutorial describes how to create "standardized" or "official" PDF forms based upon the data in the system. This could be useful for generating training certificates, generating form letters on a position change, or validating who works in a facility or district.

This module first appears in version 4.0.5 of the iHRIS Suite.

Depending on your needs, you may wish to look at these other methods for standardized form generation:

Source Data

The source data for the printed form will be based on a form relationship.

Page Interaction

Print

At the first phase of this module, the only interaction is to produce the printed forms based on what is stored in magic data. There will be no "document design" component. The standard form will be accessed through a URL with the name of the standardized form and a GET/POST variable containing one or more of the id's for the primary form in the form relationship. For example:

http://<SITE_URL>/PrintedForms/print/registration?ids[]=person|12&ids[]=person|14&ids=[]person|22

Hitting this URL would cause the following to happen:

  • verify that a standardized form called registration exists
  • verify that the user has the appropriate permission to view this standardized form:
    • Check to see if the user has the task 'printed_forms_all_generate'
    • If not, check to see if the task 'printed_forms_generate_registration' exists and the user has this task
  • for each of the ids, person|12, person|14, person|22 fill out the details of the standardized report by using the corresponding row in the report table if it exists (see below).

Menu

One should be able to see which forms can be generated for a given id. Calling

http://<SITE_URL>/PrintedForms/menu?id=person|12

will show all the printed forms whose primary form is person. Then for each of these you will have a link to the corresponding print page.

You should also link to the corresponding archive page and show which PDF forms have already been archived for that person sorted by type and date.

Archive

You should also create a form, say generated_doc which contains the following fields:

  • document: A binary field which will contain the PDF it
  • date: the date it was generated by
  • type: the print standard form (e.g. registration in the above example)

When calling the archive page as:

http://<SITE_URL>/PrintedForms/archive/registration?ids[]=person|12&ids[]=person|14&ids=[]person|22

It will:

  • check to see if 'generated_form' is a child form of person. If not execution stops.
  • for each of the id's it will created the PDF form (only one on each page/document) and save it as a child generated_doc form

Magic Data Details

All standardized forms will be stored under the magic data node:

/modules/PrintedForms/forms

In the example above the details defining the registration form would stored under:

/modules/PrintedForms/forms/registration

The details for a specific form are as follows (all measurements are in mm):

  • relationship: Required scalar node. the name of the form relationship that this form is based off of. It needs to be the name of a child node of /modules/CustomReports/relationships
  • displayName: Optional scalar node. The name of the printed letter as displayed to the end user.
  • archive: Optional scalar node. If set it should be a named form in the relationship. If it is a valid named form, then it will enable archiving of this printed letter as a child form of the corresponding named form. You should ensure that this form has generated_doc as a valid child form.
  • layout_details: Optional parent node describing the page layout details for the form. It contains the following child nodes.
    • encoding: Optional scalar node. The encoding used by the renderer(PDF). Defaults to ASCII
    • hyphenation_file: Optional scalar node. File used for hyphenation. Defaults to hyph_en_US.dic'
    • orientation: Optional scalar node. Defaults to 'P' for portrait. The other option is 'L' for landscape
    • size: Optional scalar node. Defaults to 'A4' to describe the paper to be used. Should be one of the ISO 216 standard paper sizes, e.g. 'A4', or one of the North American paper sizes, e.g. 'letter' or 'legal'
    • rows: Optional scalar node: Defaults to 1. The number of rows of forms to be printed on the page.
    • cols: Optional scalar node: Defaults to 1. The number of columns of forms to be printed on the page.
    • border: Optional scalar node. Defaults to 0 if rows and columns are 1, otherwise it to defaults to 1. The width of the border drawn around the forms.
    • vert_pad: Optional scalar node. Defaults to 10. The vertical padding used on the page boundary
    • horiz_pad: Optional scalar node. Defaults to 10. The horizontal padding used on the page boundary
    • vert_pad_border: Defaults to 0. The vertical padding used between forms
    • horiz_pad_border: Defaults to 0. The vertical padding used between forms
  • text_properties: An optional parent node defining the default text properties of the element types of the document. Child node names are the name of the element types (image or text). Possible values are:
    • font: Optional scalar node. Defaults to helvetica. Should be limited to one of the standard pdf fonts: times,helvetica, courier
    • size: Optional positive integer node.Size in points of font. Defaults to 12.
    • alignment: Optional scalar node. Defaults to 'L' for left. Can be 'R' or 'J', 'L' or 'C'
    • color: Optional color foreground/text color. Use html style hex colors. Defaults to black #000000 ,
    • bg_color: Optional background color. Use html style hex colors. Defaults to 'none' for transparent.
    • style: Optional scalar node. Default to blank. Can contain any of the following characters, B for bold, U for underline, I for italic
  • elements: Parent node. Children should be numerically indexed. Elements are added to the standard document in increasing numeric order of the node name of the element. Each of the child nodes will contain the following:
    • text_properties: An optional parent node defining the properties which applies to this node and all of its sub-elements of this. The definition is the same as above.
    • type: Required scalar node. Should be one of 'text' 'image' or 'value'
    • definition: Depends on the type. See below.

Definition for type: Text

The text element is just certain text to be placed in the document. It should consist of the following nodes:

  • printf: Optional scalar node. The a printf string to be placed here. Defaults to . Example: "%s, %s has registation number %s"
  • printf_args: Optional parent node. An array of arguments to subsititute into the printf as follows
    • formname+field: a report form fields to substitute into the printf. E.g. "person+surname,person+fisrtname,registation+number":
    • +relationshipFunction: The evaluation of the named function in the the form relationship. Example +age65 which be the year the person turns 65 in the staff relationship
    • ++date(XYZ): The data formatted according to XYZ (unquoted) via strfrtime functions. Example ++date(%Y) is the four digit year
    • ++date: The date. This is the same as ++date(%x).
    • ++user: The name of the user printing the form
    • ++eval(XYZ): Evaluate the php code XYZ. Example is ++eval(strftime("%Y")+60) would add 60 to the current year
  • horiz_min: Required numeric scalar node. If the alignment is 'L' it is the left most coordinate to place this text. If the alignment is 'R' it is the right-most cooridnate of the text
  • horiz_max: Optional numeric scalar node. If not set and the allignment is 'J' then the alignment reverts to 'L'. If set and allignment if 'L' is the right-most coordinate. If set and alignment is 'R' then it is the left-most coordinate. If set and alignment is 'J' then the this is the right-most coordinate and horiz-min is the left-most coodinate.
  • vert_max: Optional numeric scalar node. The bottom most coordinate to place this text.
  • vert_min: Required numeric scalar value. The top most coordinate to place this text.

Definition for Type: Image

  • image: Required standard node. the name of the image file to place. It can either be:
    • A file name, in which case the search path used is "PDF_IMAGES"
    • A string like "form://form+field" where form is a named form in the relationship and field is a field of time IMAGE (e.g. "form://passport+image")
  • horiz_min: Required numeric scalar node. The left most coordinate to place the image.
  • vert_min: Required numeric scalar node. The top most coordinate to place the image
  • horiz_max: Optional numeric scalar node. The right most coordinate to place the image. If set, image is rescaled if needed.
  • vert_max: Optional numeric scalar node. The bottom most coordinate to place the image. If set, image is rescaled if needed.

Example

Defining the Printed Form features

For example, to produce a Staff Hire Letter in iHRIS Manage you could define it as: <source lang='xml'>

 <configurationGroup name="sample-hire-letter" path="/modules/PrintedForms/forms/sample_hire_letter">
   <configuration name="relationship">
     <value>staff</value>
   </configuration>
   <configuration name="archive">
     <value>person</value>
   </configuration>
   <configuration name="displayName">
     <value>Staff Hire Letter</value>
   </configuration>
   <configurationGroup name="elements">
     <configurationGroup name="0">
       <configuration name="type">
         <value>image</value>
       </configuration>
       <configuration name="definition" values='many' type='delimited'>
         <value>image:iHRISManage_logo_whiteBG.png</value>
         <value>horiz_min:5</value>
         <value>vert_min:1</value>
       </configuration>
     </configurationGroup>
     <configurationGroup name="50">
       <configuration name="type">
         <value>text</value>
       </configuration>
       <configuration name="text_properties" values='many' type='delimited'>
         <value>style:I</value>
       </configuration>
       <configuration name="definition" values='many' type='delimited'>
         <value>horiz_min:33</value>
         <value>vert_min:6</value>
         <value>printf:Certification of Employment</value>
       </configuration>
     </configurationGroup>
     <configurationGroup name="51">
       <configuration name="type">
         <value>text</value>
       </configuration>
       <configuration name="text_properties" values='many' type='delimited'>
         <value>style:BU</value>
       </configuration>
       <configuration name="definition" values='many' type='delimited'>
         <value>horiz_min:33</value>
         <value>vert_min:12</value>
         <value>printf:Ministry of Health</value>
       </configuration>
     </configurationGroup>
     <configurationGroup name="52">
       <configuration name="type">
         <value>text</value>
       </configuration>
       <configuration name="definition" values='many' type='delimited'>
         <value>horiz_min:160</value>
         <value>vert_min:6</value>
         <value>printf:%s</value>
       </configuration>
       <configuration name="printf_args" path='definition/printf_args' values='many' type='delimited'>
         <value>0:++date(%e %B %Y)</value>

</configuration>

     </configurationGroup>
     <configurationGroup name="100">
       <configuration name="type">
         <value>text</value>
       </configuration>
       <configuration name="definition" values='many' type='delimited'>
         <value>horiz_min:3</value>
         <value>vert_min:50</value>
         <value>printf:Dir Sir/Madam, 
Please accept this letter as certification of employment for %s %s. 

On %s, employment began as %s in the %s department of %s.

Sincerely, %s</value>

       </configuration>
       <configuration name="printf_args" path='definition/printf_args' values='many' type='delimited'>
         <value>0:person+firstname</value>
         <value>1:person+surname</value>
         <value>2:staff+start_date</value>
         <value>3:position+title</value>
         <value>4:department+name</value>
         <value>5:facility+name</value>
         <value>6:++user</value>
       </configuration>
     </configurationGroup>
   </configurationGroup>
 </configurationGroup>

</source>

Creating a link to print the form

After that is set, then you need to open the view template for the form where you wish to place the link to print the PrinteForm. <source lang="xml">

 hasValidForms('sample_hire_letter')">
  • Sample Hire Letter
  • </source> The above would mean the name of the PrintedForm is sample_hire_letter and its parent form is person. This piece of code should be inserted favorably below the link to update the information of a form. (view_form_name.html)