From 87434fa9c833d1857adfb55a84d0fdaaeea34b5a Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 28 Dec 2012 11:41:53 +0100 Subject: [PATCH 01/14] Trad: Update cashdesk ca_ES and es_ES to spanish rule RD1619/2012 --- htdocs/langs/ca_ES/cashdesk.lang | 4 ++-- htdocs/langs/es_ES/cashdesk.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/cashdesk.lang b/htdocs/langs/ca_ES/cashdesk.lang index 62f5e6a3b7b..88f76b3b8cf 100644 --- a/htdocs/langs/ca_ES/cashdesk.lang +++ b/htdocs/langs/ca_ES/cashdesk.lang @@ -19,7 +19,7 @@ BackOffice=Back office AddThisArticle=Afegeix aquest article RestartSelling=Reprendre la venda SellFinished=Venda acabada -PrintTicket=Imprimir tiquet +PrintTicket=Imprimir NoProductFound=Cap article trobat ProductFound=Producte trobat ProductsFound=Productes trobats @@ -27,7 +27,7 @@ NoArticle=Cap article Identification=Identificació Article=Article Difference=Diferència -TotalTicket=Total ticket +TotalTicket=Total NoVAT=Sense IVA per aquesta venda Change=Canvi CalTip=Feu clic per veure el calendari diff --git a/htdocs/langs/es_ES/cashdesk.lang b/htdocs/langs/es_ES/cashdesk.lang index 9cba2e3c687..469e85577c9 100644 --- a/htdocs/langs/es_ES/cashdesk.lang +++ b/htdocs/langs/es_ES/cashdesk.lang @@ -19,7 +19,7 @@ BackOffice=Back office AddThisArticle=Añadir este artículo RestartSelling=Retomar la venta SellFinished=Venta terminada -PrintTicket=Imprimir ticket +PrintTicket=Imprimir NoProductFound=Ningún artículo encontrado ProductFound=Producto encontrado ProductsFound=Productos encontrados @@ -27,7 +27,7 @@ NoArticle=Ningún artículo Identification=Identificación Article=Artículo Difference=Diferencia -TotalTicket=Total ticket +TotalTicket=Total NoVAT=Sin IVA en esta venta Change=Cambio CalTip=Haga clic para ver el calendario From 7ff5db33852bdb5c4cd9f3aed5d60715e55a4e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 22 Dec 2012 05:44:14 +0100 Subject: [PATCH 02/14] Improved and added missing es_ES translations --- htdocs/langs/es_ES/admin.lang | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 0ccde3434fc..797ff1f0d96 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -187,7 +187,7 @@ FeatureDisabledInDemo=Opción deshabilitada en demo Rights=Permisos BoxesDesc=Los paneles son pequeñas zonas de información que se muestran en algunas páginas. Puede elegir activar o desactivar un panel haciendo clic en 'Activar', o haciendo click en el cubo de basura para desactivarlo. Solo se muestran los paneles relacionados con un módulo activo. OnlyActiveElementsAreShown=Sólo los elementos de módulos activados son mostrados. -ModulesDesc=Los módulos Dolibarr definen las funcionalidades disponibles en la aplicación. Algunos módulos requieren derechos que deberán indicarse a los usuarios para que puedan acceder a sus funcionalidades. +ModulesDesc=Los módulos Dolibarr definen las funcionalidades disponibles en la aplicación. Algunos módulos requieren permisos que deberán indicarse a los usuarios para que puedan acceder a sus funcionalidades. ModulesInterfaceDesc=Los módulos de interfaz son módulos que permiten vincular a Dolibarr con sistemas, aplicaciones o servicios externos. ModulesSpecialDesc=Los módulos complementarios son módulos de uso muy específico o menos corriente que los módulos normales. ModulesJobDesc=Los módulos específicos permiten una preconfiguración simplificada de Dolibarr para un negocio en concreto. @@ -332,6 +332,8 @@ HideAnyVATInformationOnPDF=Ocultar toda la información relacionada con el IVA e HideDescOnPDF=Ocultar descripción de los productos en la generación de los PDF HideRefOnPDF=Ocultar referencia de los productos en la generación de los PDF HideDetailsOnPDF=Ocultar detalles de las líneas de productos en la generación de los PDF +Library=Librería +LibraryToBuildPDF=Librería usada para la creación de archivos PDF UrlGenerationParameters=Seguridad de las URLs SecurityTokenIsUnique=¿Usar un parámetro securekey único para cada URL? EnterRefToBuildUrl=Introduzca la referencia del objeto %s @@ -855,11 +857,11 @@ SetupDescription5=Las otras entradas de configuración gestionan parámetros opc EventsSetup=Configuración del registro de eventos LogEvents=Auditoría de la seguridad de eventos Audit=Auditoría -InfoDolibarr=Info Dolibarr -InfoOS=Info SO -InfoWebServer=Info servidor -InfoDatabase=Info base de datos -InfoPHP=Info PHP +InfoDolibarr=Info. Dolibarr +InfoOS=Info. SO +InfoWebServer=Info. servidor +InfoDatabase=Info. base de datos +InfoPHP=Info. PHP ListEvents=Auditoría de eventos ListOfSecurityEvents=Listado de eventos de seguridad Dolibarr SecurityEventsPurged=Eventos de seguridad purgados @@ -867,7 +869,7 @@ LogEventDesc=Puede habilitar el registro de eventos de seguridad Dolibarr aquí. AreaForAdminOnly=Estas funciones solo son accesibles a un usuario administrador. SystemInfoDesc=La información del sistema es información técnica accesible solamente en solo lectura a los administradores. SystemAreaForAdminOnly=Esta área solo es accesible a los usuarios de tipo administradores. Ningún permiso Dolibarr permite extender el círculo de usuarios autorizados a esta área. -CompanyFundationDesc=Editar en esta página toda la información conocida sobre la empresa o asociación a administrar (para ello haga clic en el botón "Modificar" a pie de página) +CompanyFundationDesc=Modifique en esta página toda la información conocida sobre la empresa o asociación a administrar (para ello haga clic en el botón "Modificar" a pie de página) DisplayDesc=Puede encontrar aquí todos los parámetros relacionados con la apariencia de Dolibarr AvailableModules=Módulos disponibles ToActivateModule=Para activar los módulos, vaya al área de Configuración (Inicio->Configuración->Módulos). @@ -1381,4 +1383,4 @@ TestGeoIPResult=Test de conversión IP -> País ##### Projects ##### ProjectsNumberingModules=Módulo de numeración para las referencias de los proyectos ProjectsSetup=Configuración del módulo Proyectos -ProjectsModelModule=Modelo de documento para informes de proyectos +ProjectsModelModule=Modelo de documento para informes de proyectos \ No newline at end of file From c8eac78a8d93ef8e761645fac61d76694169fce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 00:24:55 +0100 Subject: [PATCH 03/14] Translated labels that weren't being translated and improved es_ES translations --- htdocs/comm/prospect/fiche.php | 2 +- htdocs/fourn/facture/fiche.php | 12 +++++++----- htdocs/langs/es_ES/companies.lang | 4 ++-- htdocs/langs/es_ES/exports.lang | 5 +++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 1159907bcde..f129032ad58 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -138,7 +138,7 @@ if ($socid > 0) print ''; + if ($action != 'editlevel' && $user->rights->societe->creer) print ''; print '
'; print $langs->trans('ProspectLevelShort'); print ''; - if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetLevel'),1).'id.'">'.img_edit($langs->trans('Modify'),1).'
'; print ''; if ($action == 'editlevel') diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 8a4b4b2fe96..6fcbc3779ba 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -281,9 +281,9 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) if ($element == 'order_supplier') { $element = 'fourn'; $subelement = 'fournisseur.commande'; } - if ($element == 'project') - { - $element = 'projet'; + if ($element == 'project') + { + $element = 'projet'; } $object->origin = $_POST['origin']; $object->origin_id = $_POST['originid']; @@ -1381,7 +1381,7 @@ else print ''; $sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,'; - $sql.= ' c.libelle as paiement_type,'; + $sql.= ' c.id as paiement_type,'; $sql.= ' pf.amount,'; $sql.= ' ba.rowid as baid, ba.ref, ba.label'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; @@ -1415,7 +1415,9 @@ else $var=!$var; print ''; print ''.img_object($langs->trans('ShowPayment'),'payment').' '.dol_print_date($db->jdate($objp->dp),'day')."\n"; - print ''.$objp->paiement_type.' '.$objp->num_paiement.''; + print ''; + print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement; + print ''; if (! empty($conf->banque->enabled)) { $bankaccountstatic->id=$objp->baid; diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 511921a014b..42a02b74e1e 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -340,8 +340,8 @@ StatusProspect0=Nunca contactado StatusProspect1=A contactar StatusProspect2=Contacto en curso StatusProspect3=Contacto realizado -ChangeDoNotContact=Cambiar el estado a ' no contactar ' -ChangeNeverContacted=Cambiar el estado a 'nunca contactado' +ChangeDoNotContact=Cambiar el estado a 'No contactar' +ChangeNeverContacted=Cambiar el estado a 'Nunca contactado' ChangeToContact=Cambiar el estado a 'A contactar' ChangeContactInProcess=Cambiar el estado a 'Contacto en curso' ChangeContactDone=Cambiar el estado a 'Contacto realizado' diff --git a/htdocs/langs/es_ES/exports.lang b/htdocs/langs/es_ES/exports.lang index 5308c2fa9aa..ab3ac9d8181 100644 --- a/htdocs/langs/es_ES/exports.lang +++ b/htdocs/langs/es_ES/exports.lang @@ -60,8 +60,8 @@ TypeOfLineServiceOrProduct=Tipo de línea (0=producto, 1=servicio) FileWithDataToImport=Archivo que contiene los datos a importar FileToImport=Archivo origen a importar FileMustHaveOneOfFollowingFormat=El archivo de importación debe tener uno de los siguientes formatos -ChooseFormatOfFileToImport=Elija el formato de archivo que desea importar haciendo en el picto %s para seleccionarlo... -ChooseFileToImport=Elija el archivo de importación y haga clic en el picto %s para seleccionarlo como archivo origen de importación... +ChooseFormatOfFileToImport=Elija el formato de archivo que desea importar haciendo en la imagen %s para seleccionarlo... +ChooseFileToImport=Elija el archivo de importación y haga clic en la imagen %s para seleccionarlo como archivo origen de importación... DownloadEmptyExample=Descargar archivo de ejemplo vacío SourceFileFormat=Formato del archivo origen FieldsInSourceFile=Campos en el archivo origen @@ -125,6 +125,7 @@ DeskCode=Código oficina BankAccountNumber=Número cuenta BankAccountNumberKey=Dígito Control ## filters +SelectFilterFields=Si quiere aplicar un filtro sobre algunos valores, introdúzcalos aquí. FilterableFields=Campos filtrables FilteredFields=Campos filtrados FilteredFieldsValues=Valores de filtros \ No newline at end of file From 1b153aef934d62d57395233c5d2eb1987df01199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 00:46:25 +0100 Subject: [PATCH 04/14] Fixed donation payment mode translation and another problem with donation edit form --- htdocs/compta/dons/fiche.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index e6ec1a422ae..1955a0367ae 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -405,7 +405,11 @@ if (! empty($id) && $action == 'edit') print "".''.$langs->trans("EMail").''; print "".$langs->trans("PaymentMode")."\n"; - $form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1); + + if ($don->modepaiementid) $selected = $don->modepaiementid; + else $selected = ''; + + $form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1); print "\n"; print "".''.$langs->trans("Status").''.$don->getLibStatut(4).''; @@ -496,7 +500,7 @@ if (! empty($id) && $action != 'edit') // Payment mode print "".$langs->trans("PaymentMode").""; - print $don->modepaiement; + print $form->form_modes_reglement(null, $don->modepaiementid,'none'); print "\n"; print "".''.$langs->trans("Status").''.$don->getLibStatut(4).''; From 316552f4ea1247a6f33da8c78894a75682fb6236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 00:59:16 +0100 Subject: [PATCH 05/14] Added missing translation and fixed references to incorrect variable --- htdocs/compta/dons/class/don.class.php | 4 ++-- htdocs/langs/en_US/donations.lang | 1 + htdocs/langs/es_ES/donations.lang | 1 + htdocs/langs/fr_FR/donations.lang | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index 591df7333a5..4287a268f85 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -689,11 +689,11 @@ class Don extends CommonObject $picto='generic'; - $label=$langs->trans("ShowDonation").': '.$this->ref; + $label=$langs->trans("ShowDonation").': '.$this->id; if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; + if ($withpicto != 2) $result.=$lien.$this->id.$lienfin; return $result; } diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 0c32ae3c055..953fa2ac72e 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -7,6 +7,7 @@ Donor=Donor Donors=Donors AddDonation=Add a donation NewDonation=New donation +ShowDonation=Show donation DonationPromise=Gift promise PromisesNotValid=Not validated promises PromisesValid=Validated promises diff --git a/htdocs/langs/es_ES/donations.lang b/htdocs/langs/es_ES/donations.lang index 46261634278..3357226ce77 100644 --- a/htdocs/langs/es_ES/donations.lang +++ b/htdocs/langs/es_ES/donations.lang @@ -7,6 +7,7 @@ Donor=Donante Donors=Donantes AddDonation=Añadir donación NewDonation=Nueva donación +ShowDonation=Mostrar donación DonationPromise=Promesa de donación PromisesNotValid=Promesas no validadas PromisesValid=Promesas validadas diff --git a/htdocs/langs/fr_FR/donations.lang b/htdocs/langs/fr_FR/donations.lang index 76a6452411b..b5f0e0b32f3 100644 --- a/htdocs/langs/fr_FR/donations.lang +++ b/htdocs/langs/fr_FR/donations.lang @@ -7,6 +7,7 @@ Donor=Donateur Donors=Donateurs AddDonation=Ajouter don NewDonation=Nouveau don +ShowDonation=Montrer don DonationPromise=Promesse de don PromisesNotValid=Promesses non validées PromisesValid=Promesses validées From 354c00b9cad87cbddf3915fc8096a5a58b917279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 01:13:31 +0100 Subject: [PATCH 06/14] CerfaFR donation template wasn't translating payment mode --- htdocs/core/modules/dons/html_cerfafr.modules.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 8c96087c38d..7893f1de7eb 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,6 +119,17 @@ class html_cerfafr extends ModeleDon if (file_exists($dir)) { + $formclass = new Form($this->db); + + //This is not the proper way to do it but $formclass->form_modes_reglement + //prints the translation instead of returning it + if ($don->modepaiementid) + { + $formclass->load_cache_types_paiements(); + $paymentmode = $formclass->cache_types_paiements[$don->modepaiementid]['label']; + } + else $paymentmode = ''; + // Defini contenu $donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html"; $form = implode('', file($donmodel)); @@ -135,7 +147,7 @@ class html_cerfafr extends ModeleDon $form = str_replace('__DONATOR_ADDRESS__',$don->adresse,$form); $form = str_replace('__DONATOR_ZIP__',$don->cp,$form); $form = str_replace('__DONATOR_TOWN__',$don->ville,$form); - $form = str_replace('__PAYMENTMODE_LIB__ ',$don->modepaiement,$form); + $form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form); $form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form); $form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form); $form = str_replace('__DonationReceipt__',$outputlangs->trans("DonationReceipt"),$form); From 4af2a4f8756385e4762760124f19c6b77cbb9e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 02:21:00 +0100 Subject: [PATCH 07/14] Improved agenda translations --- htdocs/comm/action/rapport/index.php | 4 ++-- htdocs/langs/en_US/agenda.lang | 1 + htdocs/langs/es_ES/agenda.lang | 1 + htdocs/langs/es_ES/main.lang | 3 ++- htdocs/langs/fr_FR/agenda.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index e1154d435a1..c3b846776ff 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -102,7 +102,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -122,7 +122,7 @@ if ($resql) print ''; print ''; $name = "actions-".$obj->month."-".$obj->year.".pdf"; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 6bd04970611..3d180e7b747 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -10,6 +10,7 @@ LocalAgenda=Local calendar AffectedTo= Assigned to DoneBy= Done by Events= Events +EventsNb=Number of events MyEvents=My events OtherEvents=Other events ListOfActions=List of events diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index d23a658373d..70dcc71f09c 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -10,6 +10,7 @@ LocalAgenda=Calendario local AffectedTo=Asignada a DoneBy=Realizado por Events=Eventos +EventsNb=Número de eventos MyEvents=Mis eventos OtherEvents=Otros eventos ListOfActions=Listado de eventos diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 1f876a02d2a..61872d90607 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -377,6 +377,7 @@ ResultOk=Éxito ResultKo=Error Reporting=Informe Reportings=Informes +GenerateReport=Generar informe Draft=Borrador Drafts=Borradores Validated=Validado @@ -553,7 +554,7 @@ Canceled=Cancelado YouCanChangeValuesForThisListFromDictionnarySetup=Puede cambiar estos valores en el menú configuración->diccionarios Color=Color Documents=Documentos -DocumentsNb=archivos aduntjos (%s) +DocumentsNb=archivos adjuntos (%s) Documents2=Documentos BuildDocuments=Documentos generados UploadDisabled=Subida desactivada diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index e98e87e57aa..d91f836d9b9 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -10,6 +10,7 @@ LocalAgenda=Calendrier local AffectedTo=Affecté à DoneBy=Réalisé par Events=Événements +EventsNb=Nombre d'événements MyEvents=Mes événements OtherEvents=Autres événements ListOfActions=Liste des événements diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index a3176d748e0..345f0c94f5a 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -376,6 +376,7 @@ ResultOk=Succès ResultKo=Échec Reporting=Rapport Reportings=Rapports +GenerateReport=Générer le rapport Draft=Brouillon Drafts=Brouillons Validated=Validé From bae8a749b888be921713bcb25b1146c7bf2725d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 02:51:35 +0100 Subject: [PATCH 08/14] Replaced 'Tel' string with 'Phone' to allow translation --- htdocs/admin/company.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0bee6992ec1..52129cf7530 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -678,7 +678,7 @@ else print ''; $var=!$var; - print ''; + print ''; $var=!$var; print ''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 8ddf40e2abf..659e1e8edc9 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -653,7 +653,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') print ''; print ''; print ''; - print ''; + print ''; print ''; print ""; print ""; From 7d60c33c1a3f9ef9ad082b7e765bb20df868cf26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Dec 2012 12:16:45 +0100 Subject: [PATCH 09/14] Fix: typo --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1ff48ef858a..4799406f369 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -482,7 +482,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1) { global $conf; - dol_syslog("files.lib.php::dol_copy srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwritifexists=".$overwriteifexists); + dol_syslog("files.lib.php::dol_copy srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwriteifexists=".$overwriteifexists); $destexists=dol_is_file($destfile); if (! $overwriteifexists && $destexists) return 0; From ca6e9643ea39dbe4bfe2041f6f6f4df0b3a05f4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Dec 2012 12:21:13 +0100 Subject: [PATCH 10/14] Fix: Pb in json function for objects --- htdocs/core/lib/json.lib.php | 10 ++- test/phpunit/AllTests.php | 2 + test/phpunit/FilesLibTest.php | 119 ++++++++++++++---------- test/phpunit/FunctionsTest.php | 32 ------- test/phpunit/JsonLibTest.php | 160 +++++++++++++++++++++++++++++++++ 5 files changed, 244 insertions(+), 79 deletions(-) create mode 100755 test/phpunit/JsonLibTest.php diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 73907fd5f23..8b1328ae8c0 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -45,7 +45,13 @@ if (! function_exists('json_encode')) */ function dol_json_encode($elements) { - $num = count($elements); + $num=count($elements); + if (is_object($elements)) // Count number of properties for an object + { + $num=0; + foreach($elements as $key => $value) $num++; + } + //var_dump($num); // determine type if (is_numeric(key($elements))) @@ -56,7 +62,7 @@ function dol_json_encode($elements) { if (is_array($elements[$i]) || is_object($elements[$i])) $output.= json_encode($elements[$i]); else $output .= _val($elements[$i]); - if($i !== $last) $output.= ','; + if ($i !== $last) $output.= ','; } $output.= ']'; } diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 0d81438bd3c..cc11e42e93e 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -68,6 +68,8 @@ class AllTests $suite->addTestSuite('DateLibTest'); require_once dirname(__FILE__).'/FilesLibTest.php'; $suite->addTestSuite('FilesLibTest'); + require_once dirname(__FILE__).'/JsonLibTest.php'; + $suite->addTestSuite('JsonLibTest'); require_once dirname(__FILE__).'/ImagesLibTest.php'; $suite->addTestSuite('ImagesLibTest'); require_once dirname(__FILE__).'/FunctionsTest.php'; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 9b66ff96aee..ecbad4050bc 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -224,10 +224,81 @@ class FilesLibTest extends PHPUnit_Framework_TestCase return $result; } + /** + * testDolMimeType + * + * @return string + */ + public function testDolMimeType() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + // file.png + $result=dol_mimetype('file.png','',0); + $this->assertEquals('image/png',$result); + $result=dol_mimetype('file.png','',1); + $this->assertEquals('png',$result); + $result=dol_mimetype('file.png','',2); + $this->assertEquals('image.png',$result); + $result=dol_mimetype('file.png','',3); + $this->assertEquals('',$result); + // file.odt + $result=dol_mimetype('file.odt','',0); + $this->assertEquals('application/vnd.oasis.opendocument.text',$result); + $result=dol_mimetype('file.odt','',1); + $this->assertEquals('vnd.oasis.opendocument.text',$result); + $result=dol_mimetype('file.odt','',2); + $this->assertEquals('ooffice.png',$result); + $result=dol_mimetype('file.odt','',3); + $this->assertEquals('',$result); + // file.php + $result=dol_mimetype('file.php','',0); + $this->assertEquals('text/plain',$result); + $result=dol_mimetype('file.php','',1); + $this->assertEquals('plain',$result); + $result=dol_mimetype('file.php','',2); + $this->assertEquals('php.png',$result); + $result=dol_mimetype('file.php','',3); + $this->assertEquals('php',$result); + // file.php.noexe + $result=dol_mimetype('file.php.noexe','',0); + $this->assertEquals('text/plain',$result); + } + + + /** + * testDolDeleteDir + * + * @return int + */ + public function testDolDeleteDir() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $dirout=$conf->admin->dir_temp.'/test'; + + $count=0; + $result=dol_delete_dir_recursive($dirout,$count,1); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it + print __METHOD__." result=".$result."\n"; + $this->assertGreaterThanOrEqual(0,$result); + } + + /** * testDolCopyMoveDelete * * @return int + * + * @depends testDolDeleteDir + * The depends says test is run only if previous is ok */ public function testDolCopyMoveDelete() { @@ -272,55 +343,13 @@ class FilesLibTest extends PHPUnit_Framework_TestCase $this->assertTrue($result); } - /** - * testDolMimeType - * - * @return string - */ - public function testDolMimeType() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - // file.png - $result=dol_mimetype('file.png','',0); - $this->assertEquals('image/png',$result); - $result=dol_mimetype('file.png','',1); - $this->assertEquals('png',$result); - $result=dol_mimetype('file.png','',2); - $this->assertEquals('image.png',$result); - $result=dol_mimetype('file.png','',3); - $this->assertEquals('',$result); - // file.odt - $result=dol_mimetype('file.odt','',0); - $this->assertEquals('application/vnd.oasis.opendocument.text',$result); - $result=dol_mimetype('file.odt','',1); - $this->assertEquals('vnd.oasis.opendocument.text',$result); - $result=dol_mimetype('file.odt','',2); - $this->assertEquals('ooffice.png',$result); - $result=dol_mimetype('file.odt','',3); - $this->assertEquals('',$result); - // file.php - $result=dol_mimetype('file.php','',0); - $this->assertEquals('text/plain',$result); - $result=dol_mimetype('file.php','',1); - $this->assertEquals('plain',$result); - $result=dol_mimetype('file.php','',2); - $this->assertEquals('php.png',$result); - $result=dol_mimetype('file.php','',3); - $this->assertEquals('php',$result); - // file.php.noexe - $result=dol_mimetype('file.php.noexe','',0); - $this->assertEquals('text/plain',$result); - } - /** * testDolCompressUnCompress * * @return string + * + * @depends testDolCopyMoveDelete + * The depends says test is run only if previous is ok */ public function testDolCompressUnCompress() { diff --git a/test/phpunit/FunctionsTest.php b/test/phpunit/FunctionsTest.php index 92400d36e9f..6efbb176dbb 100755 --- a/test/phpunit/FunctionsTest.php +++ b/test/phpunit/FunctionsTest.php @@ -28,7 +28,6 @@ global $conf,$user,$langs,$db; require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php'; if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); @@ -478,37 +477,6 @@ class FunctionsTest extends PHPUnit_Framework_TestCase $this->assertTrue($verifcond); } - /** - * testJsonencode - * - * @return void - */ - public function testJsonEncode() - { - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - - $arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "')); - - $encoded=json_encode($arraytotest); - //var_dump($encoded); - $this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded); - $decoded=json_decode($encoded,true); - //var_dump($decoded); - $this->assertEquals($arraytotest,$decoded); - - $encoded=dol_json_encode($arraytotest); - //var_dump($encoded); - $this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded); - $decoded=dol_json_decode($encoded,true); - //var_dump($decoded); - $this->assertEquals($arraytotest,$decoded); - } - /** * testGetDefaultTva * diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php new file mode 100755 index 00000000000..8a174fcb84d --- /dev/null +++ b/test/phpunit/JsonLibTest.php @@ -0,0 +1,160 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/JsonLibTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php'; + +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class JsonLibTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return CoreTest + */ + function __construct() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + //$db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + } + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testJsonEncode + * + * @return void + */ + public function testJsonEncode() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + $arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "')); + + $encoded=json_encode($arraytotest); + //var_dump($encoded); + $this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded); + $decoded=json_decode($encoded,true); + //var_dump($decoded); + $this->assertEquals($arraytotest,$decoded); + + $encoded=dol_json_encode($arraytotest); + //var_dump($encoded); + $this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded); + $decoded=dol_json_decode($encoded,true); + //var_dump($decoded); + $this->assertEquals($arraytotest,$decoded); + + $now=gmmktime(12,0,0,1,1,1970); + $objecttotest=new stdClass(); + $objecttotest->property1='abc'; + $objecttotest->property2=1234; + $objecttotest->property3=$now; + $encoded=dol_json_encode($objecttotest); + $this->assertEquals('{"property1":"abc","property2":1234,"property3":43200}',$encoded); + + } + +} +?> \ No newline at end of file From 32966fe25f57094528c748e03e0eeb9b7a0314c7 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 29 Dec 2012 16:02:02 +0100 Subject: [PATCH 11/14] Fix [ bug #658 ] Seacrh on bank do not work for description --- htdocs/compta/bank/search.php | 153 ++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 73 deletions(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 868420a5a6c..96c6244f739 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -117,11 +117,6 @@ if (is_numeric($credit)) { $si++; $sqlw[$si] .= " b.amount = " . $credit; } -// Search criteria description -if ($description) { - $si++; - $sqlw[$si] .= " b.label like '%" . $description . "%'"; -} // Other search criteria for ($i = 1 ; $i <= $si; $i++) { $sql .= " AND " . $sqlw[$i]; @@ -195,75 +190,87 @@ if ($resql) { $objp = $db->fetch_object($resql); - $var=!$var; - - print ""; - - // Ref - print ''; - - // Date ope - print '\n"; - - // Date value - print '\n"; - - // Payment type - print "\n"; - - // Num - print '\n"; - - // Description - print "'; - - // Third party - print ""; + + // Ref + print ''; + + // Date ope + print '\n"; + + // Date value + print '\n"; + + // Payment type + print "\n"; + + // Num + print '\n"; + + // Description + print "'; + + // Third party + print "'; + + // Debit/Credit + if ($objp->amount < 0) + { + print "\n"; + } + else + { + print "\n"; + } + + // Bank account + print '\n"; + print ""; } - else - { - print ' '; - } - print ''; - - // Debit/Credit - if ($objp->amount < 0) - { - print "\n"; - } - else - { - print "\n"; - } - - // Bank account - print '\n"; - print ""; - $i++; } From 44fe52d5b28947abe5868469cba4a24bad2fe94f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Dec 2012 16:32:47 +0100 Subject: [PATCH 12/14] Fix: Missing field --- htdocs/compta/dons/class/don.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index 591df7333a5..416e0d9434c 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -36,6 +36,7 @@ class Don extends CommonObject public $table_element='don'; var $id; + var $ref; var $date; var $amount; var $prenom; From 1667228d74790975318d6384d4c424b32662ee93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Dec 2012 16:42:30 +0100 Subject: [PATCH 13/14] Fix: Normalize new trigger names. --- .../core/modules/supplier_order/modules_commandefournisseur.php | 2 +- htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index e7b7a1ad8f8..f73e5276eed 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -229,7 +229,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('SUPPLIER_ORDER_BUILDDOC',$object,$user,$langs,$conf); + $result=$interface->run_triggers('ORDER_SUPPLIER_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 40baabf2a33..d143a82ad36 100755 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -262,7 +262,7 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') + elseif ($action == 'ORDER_SUPPLIER_BUILDDOC') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c01815816c4..4ad86ca66e8 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -605,7 +605,7 @@ class FactureFournisseur extends CommonInvoice // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('INVOICE_SUPPLIER_DELETE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('BILL_SUPPLIER_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } From 5e05e0aa5536cf62ac6c20f0519964daf179374f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Dec 2012 17:34:52 +0100 Subject: [PATCH 14/14] Fix: Trigger names --- .../modules/supplier_invoice/modules_facturefournisseur.php | 2 +- htdocs/install/mysql/data/llx_c_action_trigger.sql | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index cc31c234d49..1994f16b57d 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -148,7 +148,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('SUPPLIER_INVOICE_BUILDDOC',$object,$user,$langs,$conf); + $result=$interface->run_triggers('BILL_INVOICE_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index ea7353104d8..2c5bb4e60eb 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -36,9 +36,6 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (4,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',12); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (5,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (6,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); -insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (7,'WITHDRAW_TRANSMIT','Withdraw command transmitted','Executed when a withdrawal command is transmited','withdraw',25); -insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (8,'WITHDRAW_CREDIT','Withdraw credited','Executed when a withdrawal is credited','withdraw',26); -insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'WITHDRAW_EMIT','Withdraw emit','Executed when a withdrawal is emited','withdraw',27); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (10,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (11,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',17); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (12,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);
'.$langs->trans("Date").''.$langs->trans("Nb").''.$langs->trans("EventsNb").''.$langs->trans("Action").''.$langs->trans("PDF").''.$langs->trans("Date").''.$obj->cc.''; - print 'month.'&year='.$obj->year.'">'.img_picto('','filenew').''; + print 'month.'&year='.$obj->year.'">'.img_picto($langs->trans('GenerateReport'),'filenew').''; print '
'.$langs->trans("Tel").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("CompanyName").''.$langs->trans("Town").''.$langs->trans("Country").''.$langs->trans("Tel").''.$langs->trans("Phone").''.$langs->trans("Fax").' 
'; - print "rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."   "; - print ''.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day").""; - $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle'); - if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance"); - else print $labeltype; - print "'.($objp->num_chq?$objp->num_chq:"").""; - - print "rowid."&account=".$objp->fk_account."\">"; - $reg=array(); - preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction - if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); - else print dol_trunc($objp->label,40); - print " "; - - print '"; - if ($objp->url_id) - { - $companystatic->id=$objp->url_id; - $companystatic->nom=$objp->labelurl; - print $companystatic->getNomUrl(1); + $printline=false; + //Search Description + if ($description) { + preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction + if ($reg[1]) { + if ($langs->transnoentities($reg[1])==$description) { + $printline=true; + } + }elseif ($objp->label==$description) {$printline=true;} + }else {$printline=true;} + + if ($printline) { + $var=!$var; + + print "
'; + print "rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."   "; + print ''.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day").""; + $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle'); + if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance"); + else print $labeltype; + print "'.($objp->num_chq?$objp->num_chq:"").""; + + print "rowid."&account=".$objp->fk_account."\">"; + $reg=array(); + preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction + if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); + else print dol_trunc($objp->label,40); + print " "; + + print '"; + if ($objp->url_id) + { + $companystatic->id=$objp->url_id; + $companystatic->nom=$objp->labelurl; + print $companystatic->getNomUrl(1); + } + else + { + print ' '; + } + print '".price($objp->amount * -1)."  ".price($objp->amount)."'; + $bankaccountstatic->id=$objp->bankid; + $bankaccountstatic->label=$objp->bankref; + print $bankaccountstatic->getNomUrl(1); + print "
".price($objp->amount * -1)."  ".price($objp->amount)."'; - $bankaccountstatic->id=$objp->bankid; - $bankaccountstatic->label=$objp->bankref; - print $bankaccountstatic->getNomUrl(1); - print "