BUG 13400 "Adjuntar dos archivos con el mismo..." SOLVED

- Adjuntar dos archivos con el mismo nombre en un correo (PM v. 2.5.1).
- Problema resuelto:
  Se agrega un nuevo metodo "PMFAddAttachmentToArray" el cual permite validar el indice de un array, si los indices
  son iguales se diferenciara, si no lo son, se mantendra el mismo indice.

  El metodo recibe los siguientes parametros:
    > $arrayData: Array, valor de entrada, en donde contendra los nuevos datos.
    > $index: Nuevo nombre de indice
    > $value: Nuevo valor que contendra el indice
    > $suffix: Cadena que se concatenara al indice diferente por default es: "$suffix = Copy({i})"
               Ejemplo de cadena de concatenacio:
                       Fotografia Copy(1).jpg

      Nota.- Suffix es un parametro opcional como se muestra en los ejemplos y su aplicabilidad:

            PMFAddAttachmentToArray($array(), "notas.txt", "Notas de estudiantes");
            PMFAddAttachmentToArray($array(), "notas.txt", "Notas de estudiantes", " Numero de copias-({i})");
            PMFAddAttachmentToArray($array(), "notas.txt", "Notas de estudiantes", "");

    > La nueva funcion es:

    function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i})")
    {
        ...
    }

    Este metodo puede ser utilizado al momento de crear triggers en: DESIGNER>Triggers>New

  Disponible para la version 2.5.2
This commit is contained in:
Luis Fernando Saisa Lopez
2013-11-22 12:37:10 -04:00
parent f5bb7d341a
commit 40d43369be

View File

@@ -2799,9 +2799,9 @@ function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendM
/**
*@method
*
* Document Add Element array.
* It adds an element to the asociative array of attached documents that will be sent by mail, if it exists a file with the same name, it wll return a generated name with an autoincrementable sequential number.
*
* @name arrayDocumentAddElement
* @name PMFAddAttachmentToArray
* @label Add Element in Array
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#arrayDocumentAddElement.28.29
*
@@ -2813,7 +2813,7 @@ function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendM
*
*/
function arrayDocumentAddElement($arrayData, $index, $value, $suffix = " Copy({i})")
function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i})")
{
if (isset($suffix) && $suffix == "") {
$suffix = " Copy ({i})";