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>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$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;
|
$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>';
|
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 '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Date").'</td>';
|
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>'.$langs->trans("Action").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("PDF").'</td>';
|
print '<td align="center">'.$langs->trans("PDF").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("Date").'</td>';
|
print '<td align="center">'.$langs->trans("Date").'</td>';
|
||||||
@ -122,7 +122,7 @@ if ($resql)
|
|||||||
print '<td align="center">'.$obj->cc.'</td>';
|
print '<td align="center">'.$obj->cc.'</td>';
|
||||||
|
|
||||||
print '<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>';
|
print '</td>';
|
||||||
|
|
||||||
$name = "actions-".$obj->month."-".$obj->year.".pdf";
|
$name = "actions-".$obj->month."-".$obj->year.".pdf";
|
||||||
|
|||||||
@ -138,7 +138,7 @@ if ($socid > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans('ProspectLevelShort');
|
print $langs->trans('ProspectLevelShort');
|
||||||
print '<td>';
|
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 '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'editlevel')
|
if ($action == 'editlevel')
|
||||||
|
|||||||
@ -189,7 +189,6 @@ if ($resql)
|
|||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$printline=false;
|
$printline=false;
|
||||||
//Search Description
|
//Search Description
|
||||||
if ($description) {
|
if ($description) {
|
||||||
@ -200,45 +199,45 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
}elseif ($objp->label==$description) {$printline=true;}
|
}elseif ($objp->label==$description) {$printline=true;}
|
||||||
}else {$printline=true;}
|
}else {$printline=true;}
|
||||||
|
|
||||||
if ($printline) {
|
if ($printline) {
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td align="left" nowrap="nowrap">';
|
print '<td align="left" nowrap="nowrap">';
|
||||||
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> ";
|
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> ";
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Date ope
|
// Date ope
|
||||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
||||||
|
|
||||||
// Date value
|
// Date value
|
||||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
||||||
|
|
||||||
// Payment type
|
// Payment type
|
||||||
print "<td align=\"center\">";
|
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');
|
$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");
|
if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance");
|
||||||
else print $labeltype;
|
else print $labeltype;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Num
|
// Num
|
||||||
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print "<td>";
|
print "<td>";
|
||||||
|
|
||||||
print "<a href=\"ligne.php?rowid=".$objp->rowid."&account=".$objp->fk_account."\">";
|
print "<a href=\"ligne.php?rowid=".$objp->rowid."&account=".$objp->fk_account."\">";
|
||||||
$reg=array();
|
$reg=array();
|
||||||
preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
|
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]);
|
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
|
||||||
else print dol_trunc($objp->label,40);
|
else print dol_trunc($objp->label,40);
|
||||||
print "</a> ";
|
print "</a> ";
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($objp->url_id)
|
if ($objp->url_id)
|
||||||
@ -252,7 +251,7 @@ if ($resql)
|
|||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Debit/Credit
|
// Debit/Credit
|
||||||
if ($objp->amount < 0)
|
if ($objp->amount < 0)
|
||||||
{
|
{
|
||||||
@ -262,7 +261,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bank account
|
// Bank account
|
||||||
print '<td align="left" nowrap="nowrap">';
|
print '<td align="left" nowrap="nowrap">';
|
||||||
$bankaccountstatic->id=$objp->bankid;
|
$bankaccountstatic->id=$objp->bankid;
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class Don extends CommonObject
|
|||||||
public $table_element='don';
|
public $table_element='don';
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
|
var $ref;
|
||||||
var $date;
|
var $date;
|
||||||
var $amount;
|
var $amount;
|
||||||
var $prenom;
|
var $prenom;
|
||||||
@ -689,11 +690,11 @@ class Don extends CommonObject
|
|||||||
|
|
||||||
$picto='generic';
|
$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) $result.=($lien.img_object($label,$picto).$lienfin);
|
||||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
if ($withpicto != 2) $result.=$lien.$this->id.$lienfin;
|
||||||
return $result;
|
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("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
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 "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||||
@ -496,7 +500,7 @@ if (! empty($id) && $action != 'edit')
|
|||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
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 "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
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("CompanyName").'</td>';
|
||||||
print '<td>'.$langs->trans("Town").'</td>';
|
print '<td>'.$langs->trans("Town").'</td>';
|
||||||
print '<td>'.$langs->trans("Country").'</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>'.$langs->trans("Fax").'</td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|||||||
@ -482,7 +482,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
|||||||
{
|
{
|
||||||
global $conf;
|
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);
|
$destexists=dol_is_file($destfile);
|
||||||
if (! $overwriteifexists && $destexists) return 0;
|
if (! $overwriteifexists && $destexists) return 0;
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,13 @@ if (! function_exists('json_encode'))
|
|||||||
*/
|
*/
|
||||||
function dol_json_encode($elements)
|
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
|
// determine type
|
||||||
if (is_numeric(key($elements)))
|
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]);
|
if (is_array($elements[$i]) || is_object($elements[$i])) $output.= json_encode($elements[$i]);
|
||||||
else $output .= _val($elements[$i]);
|
else $output .= _val($elements[$i]);
|
||||||
if($i !== $last) $output.= ',';
|
if ($i !== $last) $output.= ',';
|
||||||
}
|
}
|
||||||
$output.= ']';
|
$output.= ']';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
* 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
|
* 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
|
* 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))
|
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
|
// Defini contenu
|
||||||
$donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html";
|
$donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html";
|
||||||
$form = implode('', file($donmodel));
|
$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_ADDRESS__',$don->adresse,$form);
|
||||||
$form = str_replace('__DONATOR_ZIP__',$don->cp,$form);
|
$form = str_replace('__DONATOR_ZIP__',$don->cp,$form);
|
||||||
$form = str_replace('__DONATOR_TOWN__',$don->ville,$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('__NOW__',dol_print_date($now,'',false,$outputlangs),$form);
|
||||||
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
|
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
|
||||||
$form = str_replace('__DonationReceipt__',$outputlangs->trans("DonationReceipt"),$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
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($db);
|
$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; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
|
|||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($db);
|
$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; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
|
|||||||
@ -262,7 +262,7 @@ class InterfaceDemo
|
|||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
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);
|
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
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$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) {
|
if ($result < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1381,7 +1381,7 @@ else
|
|||||||
print '<td rowspan="'.$nbrows.'" valign="top">';
|
print '<td rowspan="'.$nbrows.'" valign="top">';
|
||||||
|
|
||||||
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,';
|
$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.= ' pf.amount,';
|
||||||
$sql.= ' ba.rowid as baid, ba.ref, ba.label';
|
$sql.= ' ba.rowid as baid, ba.ref, ba.label';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
|
||||||
@ -1415,7 +1415,9 @@ else
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$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 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))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
$bankaccountstatic->id=$objp->baid;
|
$bankaccountstatic->id=$objp->baid;
|
||||||
@ -2072,4 +2074,4 @@ else
|
|||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$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 (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 (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 (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 (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 (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);
|
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
|
AddThisArticle=Afegeix aquest article
|
||||||
RestartSelling=Reprendre la venda
|
RestartSelling=Reprendre la venda
|
||||||
SellFinished=Venda acabada
|
SellFinished=Venda acabada
|
||||||
PrintTicket=Imprimir tiquet
|
PrintTicket=Imprimir
|
||||||
NoProductFound=Cap article trobat
|
NoProductFound=Cap article trobat
|
||||||
ProductFound=Producte trobat
|
ProductFound=Producte trobat
|
||||||
ProductsFound=Productes trobats
|
ProductsFound=Productes trobats
|
||||||
@ -27,7 +27,7 @@ NoArticle=Cap article
|
|||||||
Identification=Identificació
|
Identification=Identificació
|
||||||
Article=Article
|
Article=Article
|
||||||
Difference=Diferència
|
Difference=Diferència
|
||||||
TotalTicket=Total ticket
|
TotalTicket=Total
|
||||||
NoVAT=Sense IVA per aquesta venda
|
NoVAT=Sense IVA per aquesta venda
|
||||||
Change=Canvi
|
Change=Canvi
|
||||||
CalTip=Feu clic per veure el calendari
|
CalTip=Feu clic per veure el calendari
|
||||||
|
|||||||
@ -10,6 +10,7 @@ LocalAgenda=Local calendar
|
|||||||
AffectedTo= Assigned to
|
AffectedTo= Assigned to
|
||||||
DoneBy= Done by
|
DoneBy= Done by
|
||||||
Events= Events
|
Events= Events
|
||||||
|
EventsNb=Number of events
|
||||||
MyEvents=My events
|
MyEvents=My events
|
||||||
OtherEvents=Other events
|
OtherEvents=Other events
|
||||||
ListOfActions=List of events
|
ListOfActions=List of events
|
||||||
|
|||||||
@ -7,6 +7,7 @@ Donor=Donor
|
|||||||
Donors=Donors
|
Donors=Donors
|
||||||
AddDonation=Add a donation
|
AddDonation=Add a donation
|
||||||
NewDonation=New donation
|
NewDonation=New donation
|
||||||
|
ShowDonation=Show donation
|
||||||
DonationPromise=Gift promise
|
DonationPromise=Gift promise
|
||||||
PromisesNotValid=Not validated promises
|
PromisesNotValid=Not validated promises
|
||||||
PromisesValid=Validated promises
|
PromisesValid=Validated promises
|
||||||
|
|||||||
@ -187,7 +187,7 @@ FeatureDisabledInDemo=Opción deshabilitada en demo
|
|||||||
Rights=Permisos
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
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
|
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
|
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
|
UrlGenerationParameters=Seguridad de las URLs
|
||||||
SecurityTokenIsUnique=¿Usar un parámetro securekey único para cada URL?
|
SecurityTokenIsUnique=¿Usar un parámetro securekey único para cada URL?
|
||||||
EnterRefToBuildUrl=Introduzca la referencia del objeto %s
|
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
|
EventsSetup=Configuración del registro de eventos
|
||||||
LogEvents=Auditoría de la seguridad de eventos
|
LogEvents=Auditoría de la seguridad de eventos
|
||||||
Audit=Auditoría
|
Audit=Auditoría
|
||||||
InfoDolibarr=Info Dolibarr
|
InfoDolibarr=Info. Dolibarr
|
||||||
InfoOS=Info SO
|
InfoOS=Info. SO
|
||||||
InfoWebServer=Info servidor
|
InfoWebServer=Info. servidor
|
||||||
InfoDatabase=Info base de datos
|
InfoDatabase=Info. base de datos
|
||||||
InfoPHP=Info PHP
|
InfoPHP=Info. PHP
|
||||||
ListEvents=Auditoría de eventos
|
ListEvents=Auditoría de eventos
|
||||||
ListOfSecurityEvents=Listado de eventos de seguridad Dolibarr
|
ListOfSecurityEvents=Listado de eventos de seguridad Dolibarr
|
||||||
SecurityEventsPurged=Eventos de seguridad purgados
|
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.
|
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.
|
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.
|
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
|
DisplayDesc=Puede encontrar aquí todos los parámetros relacionados con la apariencia de Dolibarr
|
||||||
AvailableModules=Módulos disponibles
|
AvailableModules=Módulos disponibles
|
||||||
ToActivateModule=Para activar los módulos, vaya al área de Configuración (Inicio->Configuración->Módulos).
|
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
|
AffectedTo=Asignada a
|
||||||
DoneBy=Realizado por
|
DoneBy=Realizado por
|
||||||
Events=Eventos
|
Events=Eventos
|
||||||
|
EventsNb=Número de eventos
|
||||||
MyEvents=Mis eventos
|
MyEvents=Mis eventos
|
||||||
OtherEvents=Otros eventos
|
OtherEvents=Otros eventos
|
||||||
ListOfActions=Listado de eventos
|
ListOfActions=Listado de eventos
|
||||||
|
|||||||
@ -19,7 +19,7 @@ BackOffice=Back office
|
|||||||
AddThisArticle=Añadir este artículo
|
AddThisArticle=Añadir este artículo
|
||||||
RestartSelling=Retomar la venta
|
RestartSelling=Retomar la venta
|
||||||
SellFinished=Venta terminada
|
SellFinished=Venta terminada
|
||||||
PrintTicket=Imprimir ticket
|
PrintTicket=Imprimir
|
||||||
NoProductFound=Ningún artículo encontrado
|
NoProductFound=Ningún artículo encontrado
|
||||||
ProductFound=Producto encontrado
|
ProductFound=Producto encontrado
|
||||||
ProductsFound=Productos encontrados
|
ProductsFound=Productos encontrados
|
||||||
@ -27,7 +27,7 @@ NoArticle=Ningún artículo
|
|||||||
Identification=Identificación
|
Identification=Identificación
|
||||||
Article=Artículo
|
Article=Artículo
|
||||||
Difference=Diferencia
|
Difference=Diferencia
|
||||||
TotalTicket=Total ticket
|
TotalTicket=Total
|
||||||
NoVAT=Sin IVA en esta venta
|
NoVAT=Sin IVA en esta venta
|
||||||
Change=Cambio
|
Change=Cambio
|
||||||
CalTip=Haga clic para ver el calendario
|
CalTip=Haga clic para ver el calendario
|
||||||
|
|||||||
@ -340,8 +340,8 @@ StatusProspect0=Nunca contactado
|
|||||||
StatusProspect1=A contactar
|
StatusProspect1=A contactar
|
||||||
StatusProspect2=Contacto en curso
|
StatusProspect2=Contacto en curso
|
||||||
StatusProspect3=Contacto realizado
|
StatusProspect3=Contacto realizado
|
||||||
ChangeDoNotContact=Cambiar el estado a ' no contactar '
|
ChangeDoNotContact=Cambiar el estado a 'No contactar'
|
||||||
ChangeNeverContacted=Cambiar el estado a 'nunca contactado'
|
ChangeNeverContacted=Cambiar el estado a 'Nunca contactado'
|
||||||
ChangeToContact=Cambiar el estado a 'A contactar'
|
ChangeToContact=Cambiar el estado a 'A contactar'
|
||||||
ChangeContactInProcess=Cambiar el estado a 'Contacto en curso'
|
ChangeContactInProcess=Cambiar el estado a 'Contacto en curso'
|
||||||
ChangeContactDone=Cambiar el estado a 'Contacto realizado'
|
ChangeContactDone=Cambiar el estado a 'Contacto realizado'
|
||||||
|
|||||||
@ -7,6 +7,7 @@ Donor=Donante
|
|||||||
Donors=Donantes
|
Donors=Donantes
|
||||||
AddDonation=Añadir donación
|
AddDonation=Añadir donación
|
||||||
NewDonation=Nueva donación
|
NewDonation=Nueva donación
|
||||||
|
ShowDonation=Mostrar donación
|
||||||
DonationPromise=Promesa de donación
|
DonationPromise=Promesa de donación
|
||||||
PromisesNotValid=Promesas no validadas
|
PromisesNotValid=Promesas no validadas
|
||||||
PromisesValid=Promesas 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
|
FileWithDataToImport=Archivo que contiene los datos a importar
|
||||||
FileToImport=Archivo origen a importar
|
FileToImport=Archivo origen a importar
|
||||||
FileMustHaveOneOfFollowingFormat=El archivo de importación debe tener uno de los siguientes formatos
|
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...
|
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 el picto %s para seleccionarlo como archivo origen de importación...
|
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
|
DownloadEmptyExample=Descargar archivo de ejemplo vacío
|
||||||
SourceFileFormat=Formato del archivo origen
|
SourceFileFormat=Formato del archivo origen
|
||||||
FieldsInSourceFile=Campos en el archivo origen
|
FieldsInSourceFile=Campos en el archivo origen
|
||||||
@ -125,6 +125,7 @@ DeskCode=Código oficina
|
|||||||
BankAccountNumber=Número cuenta
|
BankAccountNumber=Número cuenta
|
||||||
BankAccountNumberKey=Dígito Control
|
BankAccountNumberKey=Dígito Control
|
||||||
## filters
|
## filters
|
||||||
|
SelectFilterFields=Si quiere aplicar un filtro sobre algunos valores, introdúzcalos aquí.
|
||||||
FilterableFields=Campos filtrables
|
FilterableFields=Campos filtrables
|
||||||
FilteredFields=Campos filtrados
|
FilteredFields=Campos filtrados
|
||||||
FilteredFieldsValues=Valores de filtros
|
FilteredFieldsValues=Valores de filtros
|
||||||
@ -377,6 +377,7 @@ ResultOk=Éxito
|
|||||||
ResultKo=Error
|
ResultKo=Error
|
||||||
Reporting=Informe
|
Reporting=Informe
|
||||||
Reportings=Informes
|
Reportings=Informes
|
||||||
|
GenerateReport=Generar informe
|
||||||
Draft=Borrador
|
Draft=Borrador
|
||||||
Drafts=Borradores
|
Drafts=Borradores
|
||||||
Validated=Validado
|
Validated=Validado
|
||||||
@ -553,7 +554,7 @@ Canceled=Cancelado
|
|||||||
YouCanChangeValuesForThisListFromDictionnarySetup=Puede cambiar estos valores en el menú configuración->diccionarios
|
YouCanChangeValuesForThisListFromDictionnarySetup=Puede cambiar estos valores en el menú configuración->diccionarios
|
||||||
Color=Color
|
Color=Color
|
||||||
Documents=Documentos
|
Documents=Documentos
|
||||||
DocumentsNb=archivos aduntjos (%s)
|
DocumentsNb=archivos adjuntos (%s)
|
||||||
Documents2=Documentos
|
Documents2=Documentos
|
||||||
BuildDocuments=Documentos generados
|
BuildDocuments=Documentos generados
|
||||||
UploadDisabled=Subida desactivada
|
UploadDisabled=Subida desactivada
|
||||||
|
|||||||
@ -10,6 +10,7 @@ LocalAgenda=Calendrier local
|
|||||||
AffectedTo=Affecté à
|
AffectedTo=Affecté à
|
||||||
DoneBy=Réalisé par
|
DoneBy=Réalisé par
|
||||||
Events=Événements
|
Events=Événements
|
||||||
|
EventsNb=Nombre d'événements
|
||||||
MyEvents=Mes événements
|
MyEvents=Mes événements
|
||||||
OtherEvents=Autres événements
|
OtherEvents=Autres événements
|
||||||
ListOfActions=Liste des événements
|
ListOfActions=Liste des événements
|
||||||
|
|||||||
@ -7,6 +7,7 @@ Donor=Donateur
|
|||||||
Donors=Donateurs
|
Donors=Donateurs
|
||||||
AddDonation=Ajouter don
|
AddDonation=Ajouter don
|
||||||
NewDonation=Nouveau don
|
NewDonation=Nouveau don
|
||||||
|
ShowDonation=Montrer don
|
||||||
DonationPromise=Promesse de don
|
DonationPromise=Promesse de don
|
||||||
PromisesNotValid=Promesses non validées
|
PromisesNotValid=Promesses non validées
|
||||||
PromisesValid=Promesses validées
|
PromisesValid=Promesses validées
|
||||||
|
|||||||
@ -376,6 +376,7 @@ ResultOk=Succès
|
|||||||
ResultKo=Échec
|
ResultKo=Échec
|
||||||
Reporting=Rapport
|
Reporting=Rapport
|
||||||
Reportings=Rapports
|
Reportings=Rapports
|
||||||
|
GenerateReport=Générer le rapport
|
||||||
Draft=Brouillon
|
Draft=Brouillon
|
||||||
Drafts=Brouillons
|
Drafts=Brouillons
|
||||||
Validated=Validé
|
Validated=Validé
|
||||||
|
|||||||
@ -68,6 +68,8 @@ class AllTests
|
|||||||
$suite->addTestSuite('DateLibTest');
|
$suite->addTestSuite('DateLibTest');
|
||||||
require_once dirname(__FILE__).'/FilesLibTest.php';
|
require_once dirname(__FILE__).'/FilesLibTest.php';
|
||||||
$suite->addTestSuite('FilesLibTest');
|
$suite->addTestSuite('FilesLibTest');
|
||||||
|
require_once dirname(__FILE__).'/JsonLibTest.php';
|
||||||
|
$suite->addTestSuite('JsonLibTest');
|
||||||
require_once dirname(__FILE__).'/ImagesLibTest.php';
|
require_once dirname(__FILE__).'/ImagesLibTest.php';
|
||||||
$suite->addTestSuite('ImagesLibTest');
|
$suite->addTestSuite('ImagesLibTest');
|
||||||
require_once dirname(__FILE__).'/FunctionsTest.php';
|
require_once dirname(__FILE__).'/FunctionsTest.php';
|
||||||
|
|||||||
@ -224,10 +224,81 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
return $result;
|
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
|
* testDolCopyMoveDelete
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
|
*
|
||||||
|
* @depends testDolDeleteDir
|
||||||
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
public function testDolCopyMoveDelete()
|
public function testDolCopyMoveDelete()
|
||||||
{
|
{
|
||||||
@ -272,55 +343,13 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertTrue($result);
|
$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
|
* testDolCompressUnCompress
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
|
* @depends testDolCopyMoveDelete
|
||||||
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
public function testDolCompressUnCompress()
|
public function testDolCompressUnCompress()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,6 @@ global $conf,$user,$langs,$db;
|
|||||||
require_once 'PHPUnit/Autoload.php';
|
require_once 'PHPUnit/Autoload.php';
|
||||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.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/date.lib.php';
|
||||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php';
|
|
||||||
|
|
||||||
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||||
@ -478,37 +477,6 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertTrue($verifcond);
|
$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
|
* 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