Merge remote-tracking branch 'origin/3.3' into develop
Conflicts: htdocs/compta/bank/search.php
This commit is contained in:
commit
2d0dea18ce
@ -678,7 +678,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Tel").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
@ -102,7 +102,7 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Nb").'</td>';
|
||||
print '<td align="center">'.$langs->trans("EventsNb").'</td>';
|
||||
print '<td>'.$langs->trans("Action").'</td>';
|
||||
print '<td align="center">'.$langs->trans("PDF").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Date").'</td>';
|
||||
@ -122,7 +122,7 @@ if ($resql)
|
||||
print '<td align="center">'.$obj->cc.'</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=builddoc&page='.$page.'&month='.$obj->month.'&year='.$obj->year.'">'.img_picto('','filenew').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=builddoc&page='.$page.'&month='.$obj->month.'&year='.$obj->year.'">'.img_picto($langs->trans('GenerateReport'),'filenew').'</a>';
|
||||
print '</td>';
|
||||
|
||||
$name = "actions-".$obj->month."-".$obj->year.".pdf";
|
||||
|
||||
@ -138,7 +138,7 @@ if ($socid > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||
print $langs->trans('ProspectLevelShort');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editlevel')
|
||||
|
||||
@ -189,7 +189,6 @@ if ($resql)
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$printline=false;
|
||||
//Search Description
|
||||
if ($description) {
|
||||
@ -200,45 +199,45 @@ if ($resql)
|
||||
}
|
||||
}elseif ($objp->label==$description) {$printline=true;}
|
||||
}else {$printline=true;}
|
||||
|
||||
|
||||
if ($printline) {
|
||||
$var=!$var;
|
||||
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
// Ref
|
||||
print '<td align="left" nowrap="nowrap">';
|
||||
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> ";
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Date ope
|
||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
||||
|
||||
|
||||
// Date value
|
||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
||||
|
||||
|
||||
// Payment type
|
||||
print "<td align=\"center\">";
|
||||
$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 "</td>\n";
|
||||
|
||||
|
||||
// Num
|
||||
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||
|
||||
|
||||
// Description
|
||||
print "<td>";
|
||||
|
||||
|
||||
print "<a href=\"ligne.php?rowid=".$objp->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 "</a> ";
|
||||
|
||||
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Third party
|
||||
print "<td>";
|
||||
if ($objp->url_id)
|
||||
@ -252,7 +251,7 @@ if ($resql)
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Debit/Credit
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
@ -262,7 +261,7 @@ if ($resql)
|
||||
{
|
||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
||||
}
|
||||
|
||||
|
||||
// Bank account
|
||||
print '<td align="left" nowrap="nowrap">';
|
||||
$bankaccountstatic->id=$objp->bankid;
|
||||
|
||||
@ -36,6 +36,7 @@ class Don extends CommonObject
|
||||
public $table_element='don';
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
var $date;
|
||||
var $amount;
|
||||
var $prenom;
|
||||
@ -689,11 +690,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;
|
||||
}
|
||||
|
||||
|
||||
@ -405,7 +405,11 @@ if (! empty($id) && $action == 'edit')
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
||||
|
||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\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 "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||
@ -496,7 +500,7 @@ if (! empty($id) && $action != 'edit')
|
||||
|
||||
// Payment mode
|
||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
||||
print $don->modepaiement;
|
||||
print $form->form_modes_reglement(null, $don->modepaiementid,'none');
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||
|
||||
@ -658,7 +658,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
||||
print '<td>'.$langs->trans("CompanyName").'</td>';
|
||||
print '<td>'.$langs->trans("Town").'</td>';
|
||||
print '<td>'.$langs->trans("Country").'</td>';
|
||||
print '<td>'.$langs->trans("Tel").'</td>';
|
||||
print '<td>'.$langs->trans("Phone").'</td>';
|
||||
print '<td>'.$langs->trans("Fax").'</td>';
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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.= ']';
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* 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);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -1381,7 +1381,7 @@ else
|
||||
print '<td rowspan="'.$nbrows.'" valign="top">';
|
||||
|
||||
$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 '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.dol_print_date($db->jdate($objp->dp),'day')."</a></td>\n";
|
||||
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
|
||||
print '<td>';
|
||||
print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement;
|
||||
print '</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$bankaccountstatic->id=$objp->baid;
|
||||
@ -2072,4 +2074,4 @@ else
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 <a href="modules.php">módulo</a> activo.
|
||||
OnlyActiveElementsAreShown=Sólo los elementos de <a href="%s">módulos activados</a> 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
|
||||
@ -854,11 +856,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
|
||||
@ -866,7 +868,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).
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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é
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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()
|
||||
{
|
||||
|
||||
@ -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
|
||||
*
|
||||
|
||||
160
test/phpunit/JsonLibTest.php
Executable file
160
test/phpunit/JsonLibTest.php
Executable file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
* 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user