Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
24c3607403
@ -110,7 +110,7 @@ if ($sall)
|
||||
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
|
||||
$sql.=" d.firstname LIKE '%".$db->escape($sall)."%' OR d.lastname LIKE '%".$db->escape($sall)."%' OR d.societe LIKE '%".$db->escape($sall)."%'";
|
||||
$sql.=" OR d.email LIKE '%".$db->escape($sall)."%' OR d.login LIKE '%".$db->escape($sall)."%' OR d.address LIKE '%".$db->escape($sall)."%'";
|
||||
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note LIKE '%".$db->escape($sall)."%')";
|
||||
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note_public LIKE '%".$db->escape($sall)."%' OR d.note_private LIKE '%".$db->escape($sall)."%')";
|
||||
}
|
||||
}
|
||||
if ($type > 0)
|
||||
|
||||
@ -386,7 +386,7 @@ if ($rowid > 0)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note_public LIKE '%".$sall."%' OR d.note_private LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
|
||||
@ -3880,7 +3880,7 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8',$
|
||||
$newstring=strtr($newstring,array('__and__'=>'&','__lt__'=>'<','__gt__'=>'>','__dquot__'=>'"'));
|
||||
}
|
||||
else
|
||||
{
|
||||
{print 'eee';
|
||||
if ($removelasteolbr) $newstring=preg_replace('/(\r\n|\r|\n)$/i','',$newstring); // Remove last \n (may remove several)
|
||||
$newstring=dol_nl2br(dol_htmlentities($newstring,ENT_COMPAT,$pagecodefrom),$nl2brmode);
|
||||
}
|
||||
@ -4064,7 +4064,8 @@ function dol_textishtml($msg,$option=0)
|
||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(img)\s+[^<>]*>/i',$msg)) return true; // must accept <img src="http://mydomain.com/aaa.png" />
|
||||
elseif (preg_match('/<img\s+[^<>]*src[^<>]*>/i',$msg)) return true; // must accept <img src="http://mydomain.com/aaa.png" />
|
||||
elseif (preg_match('/<a\s+[^<>]*href[^<>]*>/i',$msg)) return true; // must accept <a href="http://mydomain.com/aaa.png" />
|
||||
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
|
||||
elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
|
||||
@ -16,117 +16,134 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/lib/functionsnumbertoword.lib.php
|
||||
* \brief A set of functions for Dolibarr
|
||||
* This file contains all frequently used functions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function to return number or amount in text.
|
||||
*
|
||||
* @param float $numero Number to convert
|
||||
* @param Lang $langs Language
|
||||
* @param string $numorcurrency 'number' or 'amount'
|
||||
* @return string Text of the number
|
||||
* @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99)
|
||||
*/
|
||||
function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
||||
{
|
||||
$entexto=$numero;
|
||||
|
||||
if ($langs->default == 'es_MX' && $numorcurrency == 'currency')
|
||||
{
|
||||
$veintis = array("VEINTE","VEINTIUN","VEINTIDÓS","VEINTITRÉS","VEINTICUATRO","VEINTICINCO","VEINTISÉIS","VEINTISIETE","VEINTIOCHO","VEINTINUEVE");
|
||||
$unidades = array("UN","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE");
|
||||
$decenas = array("","","TREINTA ","CUARENTA ","CINCUENTA ","SESENTA ","SETENTA ","OCHENTA ","NOVENTA ");
|
||||
$centenas = array("CIENTO","DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS");
|
||||
$number = $numero;
|
||||
$parte_decimal = $numero - (int) $numero;
|
||||
$parte_decimal = (int) round($parte_decimal*100);
|
||||
if ($parte_decimal < 10)
|
||||
$parte_decimal = "0".$parte_decimal;
|
||||
$entexto ="";
|
||||
if ($numero>=1 && $numero<2) {
|
||||
$entexto .= " UN PESO ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
elseif ($numero>=0 && $numero<1){
|
||||
$entexto .= " CERO PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
elseif ($numero>=100 && $numero<101){
|
||||
$entexto .= " CIEN PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
else {
|
||||
$cdm = (int) ($numero / 100000);
|
||||
$numero = $numero - $cdm * 100000;
|
||||
$ddm = (int) ($numero / 10000);
|
||||
$numero = $numero - $ddm * 10000;
|
||||
$udm = (int) ($numero / 1000);
|
||||
$numero = $numero - $udm * 1000;
|
||||
$c = (int) ($numero / 100);
|
||||
$numero = $numero - $c * 100;
|
||||
$d = (int) ($numero / 10);
|
||||
$u = (int) $numero - $d * 10;
|
||||
$completo=FALSE;
|
||||
if ($cdm==1 && $ddm==0 && $udm==0){
|
||||
$entexto .= "CIEN";
|
||||
$completo = TRUE;
|
||||
// If the number is negative convert to positive and return -1 if is too long
|
||||
if ($numero < 0) $numero *= -1;
|
||||
if ($numero >= 1000000000001)
|
||||
return -1;
|
||||
// Get 2 decimals to cents, another functions round or truncate
|
||||
$strnumber = number_format ($numero,10);
|
||||
for ($i=0; $i<strlen($strnumber); $i++){
|
||||
if ($strnumber[$i]=='.') {
|
||||
$parte_decimal = $strnumber[$i+1].$strnumber[$i+2];
|
||||
break;
|
||||
}
|
||||
if ($cdm!=0 && !$completo){
|
||||
$entexto .= $centenas[$cdm-1]." ";
|
||||
}
|
||||
$completo=FALSE;
|
||||
if ($ddm>2){
|
||||
$entexto .= " ".$decenas[$ddm-1];
|
||||
if ($udm!=0){
|
||||
$entexto .= " Y ";
|
||||
}
|
||||
}
|
||||
elseif ($ddm!=0){
|
||||
$completo=TRUE;
|
||||
if ($ddm==1){
|
||||
$entexto .= " ".$diecis[$udm];
|
||||
}
|
||||
else{
|
||||
$entexto .= " ".$veintis[$udm];
|
||||
}
|
||||
}
|
||||
if ($udm!=0 && !$completo){
|
||||
$entexto .= $unidades[$udm-1];
|
||||
}
|
||||
$completo=FALSE;
|
||||
if ($number>=1000){
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
|
||||
if ($c==1 && $d==0 && $u==0){
|
||||
$entexto .= "CIEN";
|
||||
$completo = TRUE;
|
||||
}
|
||||
if ($c!=0 && !$completo){
|
||||
$entexto .= $centenas[$c-1]." ";
|
||||
}
|
||||
if ($d>2){
|
||||
$entexto .= " ".$decenas[$d-1];
|
||||
if ($u!=0){
|
||||
$entexto .= " Y ";
|
||||
}
|
||||
}
|
||||
elseif ($d!=0){
|
||||
$completo=TRUE;
|
||||
if ($d==1){
|
||||
$entexto .= " ".$diecis[$u];
|
||||
}
|
||||
else{
|
||||
$entexto .= " ".$veintis[$u];
|
||||
}
|
||||
}
|
||||
if ($u!=0 && !$completo){
|
||||
$entexto .= $unidades[$u-1];
|
||||
}
|
||||
$entexto .= " PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
}
|
||||
|
||||
return $entexto;
|
||||
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
|
||||
in case exist why ask $lang like a parameter?*/
|
||||
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||
{
|
||||
if ($numero>=1 && $numero<2) {
|
||||
return ("UN PESO ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=0 && $numero<1){
|
||||
return ("CERO PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000 && $numero<1000001){
|
||||
return ("UN MILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000000000 && $numero<1000000000001){
|
||||
return ("UN BILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
else {
|
||||
$entexto ="";
|
||||
$number = $numero;
|
||||
if ($number >= 1000000000){
|
||||
$CdMMillon = (int) ($numero / 100000000000);
|
||||
$numero = $numero - $CdMMillon * 100000000000;
|
||||
$DdMMillon = (int) ($numero / 10000000000);
|
||||
$numero = $numero - $DdMMillon * 10000000000;
|
||||
$UdMMillon = (int) ($numero / 1000000000);
|
||||
$numero = $numero - $UdMMillon * 1000000000;
|
||||
$entexto .= hundreds2text ($CdMMillon, $DdMMillon, $UdMMillon);
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
if ($number >= 1000000){
|
||||
$CdMILLON = (int) ($numero / 100000000);
|
||||
$numero = $numero - $CdMILLON * 100000000;
|
||||
$DdMILLON = (int) ($numero / 10000000);
|
||||
$numero = $numero - $DdMILLON * 10000000;
|
||||
$udMILLON = (int) ($numero / 1000000);
|
||||
$numero = $numero - $udMILLON * 1000000;
|
||||
$entexto .= hundreds2text ($CdMILLON, $DdMILLON, $udMILLON);
|
||||
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1)
|
||||
$entexto .= " MILLÓN ";
|
||||
else
|
||||
$entexto .= " MILLONES ";
|
||||
}
|
||||
if ($number >= 1000) {
|
||||
$cdm = (int) ($numero / 100000);
|
||||
$numero = $numero - $cdm * 100000;
|
||||
$ddm = (int) ($numero / 10000);
|
||||
$numero = $numero - $ddm * 10000;
|
||||
$udm = (int) ($numero / 1000);
|
||||
$numero = $numero - $udm * 1000;
|
||||
$entexto .= hundreds2text ($cdm, $ddm, $udm);
|
||||
if ($cdm || $ddm || $udm)
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
$c = (int) ($numero / 100);
|
||||
$numero = $numero - $c * 100;
|
||||
$d = (int) ($numero / 10);
|
||||
$u = (int) $numero - $d * 10;
|
||||
$entexto .= hundreds2text ($c, $d, $u);
|
||||
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000)
|
||||
$entexto .= " DE";
|
||||
$entexto .= " PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
}
|
||||
|
||||
function hundreds2text ($hundreds, $tens, $units){
|
||||
if ($hundreds==1 && $tens==0 && $units==0){
|
||||
return "CIEN";
|
||||
}
|
||||
$centenas = array("CIENTO","DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS");
|
||||
$decenas = array("","","TREINTA ","CUARENTA ","CINCUENTA ","SESENTA ","SETENTA ","OCHENTA ","NOVENTA ");
|
||||
$veintis = array("VEINTE","VEINTIUN","VEINTIDÓS","VEINTITRÉS","VEINTICUATRO","VEINTICINCO","VEINTISÉIS","VEINTISIETE","VEINTIOCHO","VEINTINUEVE");
|
||||
$diecis = array("DIEZ","ONCE","DOCE","TRECE","CATORCE","QUINCE","DIECISÉIS","DIECISIETE","DIECIOCHO","DIECINUEVE");
|
||||
$unidades = array("UN","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE");
|
||||
$entexto = "";
|
||||
if ($hundreds!=0){
|
||||
$entexto .= $centenas[$hundreds-1];
|
||||
}
|
||||
if ($tens>2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
$entexto .= $decenas[$tens-1];
|
||||
if ($units!=0){
|
||||
$entexto .= " Y ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
$entexto .= " ".$veintis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==1){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
$entexto .= $diecis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
if ($units!=0) {
|
||||
if ($hundreds!=0 || $tens!=0) $entexto .= " ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
|
||||
@ -143,9 +143,9 @@ class modBanque extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='Ecritures bancaires et releves';
|
||||
$this->export_permission[$r]=array(array("banque","export"));
|
||||
$this->export_fields_array[$r]=array('b.rowid'=>'IdTransaction','ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.dateo'=>'DateOperation','b.label'=>'Label','b.num_chq'=>'ChequeOrTransferNumber','-b.amount'=>'Debit','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode");
|
||||
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','-b.amount'=>'Number','b.amount'=>'Number','b.num_releve'=>'Text','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text");
|
||||
$this->export_entities_array[$r]=array('b.rowid'=>'account','ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.dateo'=>'account','b.label'=>'account','b.num_chq'=>'account','-b.amount'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account","bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company");
|
||||
$this->export_fields_array[$r]=array('b.rowid'=>'IdTransaction','ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.dateo'=>'DateOperation','b.label'=>'Label','b.num_chq'=>'ChequeOrTransferNumber','b.fk_bordereau'=>'ChequeBordereau','-b.amount'=>'Debit','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode");
|
||||
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Number','b.amount'=>'Number','b.num_releve'=>'Text','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text");
|
||||
$this->export_entities_array[$r]=array('b.rowid'=>'account','ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.dateo'=>'account','b.label'=>'account','b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account","bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company");
|
||||
$this->export_special_array[$r]=array('-b.amount'=>'NULLIFNEG','b.amount'=>'NULLIFNEG');
|
||||
if (empty($conf->fournisseur->enabled))
|
||||
{
|
||||
@ -164,11 +164,11 @@ class modBanque extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='Bordereaux remise Chq/Fact';
|
||||
$this->export_permission[$r]=array(array("banque","export"));
|
||||
$this->export_fields_array[$r]=array("bch.number"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
|
||||
$this->export_fields_array[$r]=array("bch.rowid"=>"bordereauid","bch.number"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
|
||||
"bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","f.facnumber"=>"InvoiceRef"
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Number','b.num_releve'=>'Text','b.datec'=>"Date",
|
||||
"bch.date_bordereau"=>"Date","bch.number"=>"Number","bch.ref_ext"=>"Text","bch.amount"=>"Number","bch.nbcheque"=>"NumBer","bu.url_id"=>"Text","s.nom"=>"Text","f.facnumber"=>"Text"
|
||||
"bch.date_bordereau"=>"Date","bch.rowid"=>"Number","bch.number"=>"Number","bch.ref_ext"=>"Text","bch.amount"=>"Number","bch.nbcheque"=>"NumBer","bu.url_id"=>"Text","s.nom"=>"Text","f.facnumber"=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r]=array('ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.num_chq'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account",
|
||||
"bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.facnumber"=>"invoice");
|
||||
|
||||
@ -49,7 +49,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (41
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '0','0','VAT Rate 0',1);
|
||||
|
||||
-- BRASIL (id country=59)
|
||||
-- BRASIL (id country=56)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT reduced rate',1);
|
||||
|
||||
-- BULGARIA (id country=59)
|
||||
@ -219,6 +219,11 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 2
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (861, 86, '13', '0', 'IVA 13', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (862, 86, '0', '0', 'SIN IVA', 1);
|
||||
|
||||
-- SENEGAL (id country=22)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (221, 22, '18', '0', 'VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (222, 22, '10', '0', 'VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (223, 22, '0', '0', 'VAT Rate 0', 1);
|
||||
|
||||
-- SLOVAKIA (id country=201)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '19', '0', 'VAT standard rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT reduced rate', 1);
|
||||
|
||||
@ -50,4 +50,4 @@ ArcticNumRefModelError=Failed to activate
|
||||
PacificNumRefModelDesc1=Return numero with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
|
||||
PacificNumRefModelError=An intervention card starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module.
|
||||
PrintProductsOnFichinter=Print products on intervention card
|
||||
PrintProductsOnFichinterDetails=forinterventions generated from orders
|
||||
PrintProductsOnFichinterDetails=interventions generated from orders
|
||||
|
||||
@ -53,7 +53,7 @@ DocumentModelSimple=Simple document model
|
||||
DocumentModelMerou=Merou A5 model
|
||||
WarningNoQtyLeftToSend=Warning, no products waiting to be shipped.
|
||||
StatsOnShipmentsOnlyValidated=Statistics conducted on shipments only validated. Date used is date of validation of shipment (planed delivery date is not always known).
|
||||
DateDeliveryPlanned=Planed date of delivery
|
||||
DateDeliveryPlanned=Planned date of delivery
|
||||
DateReceived=Date delivery received
|
||||
SendShippingByEMail=Send shipment by EMail
|
||||
SendShippingRef=Submission of shipment %s
|
||||
|
||||
@ -90,7 +90,7 @@ if (g)
|
||||
var barText = "Resource";
|
||||
var graphFormat = "day";
|
||||
|
||||
g.setDateInputFormat('yyyy-mm-dd'); // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
|
||||
g.setDateInputFormat('mm/dd/yyyy'); // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', does not work with 'yyyy-mm-dd')
|
||||
g.setDateDisplayFormat('<?php echo $dateformat; ?>');
|
||||
/* For JSGanttImproved g.setDateTaskDisplayFormat('<?php echo $datehourformat; ?>'); */
|
||||
/* For JSGanttImproved g.setDayMajorDateDisplayFormat('dd mon'); */
|
||||
@ -143,8 +143,8 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
|
||||
$start_date = $task["task_start_date"];
|
||||
$end_date = $task["task_end_date"];
|
||||
if (!$end_date) $end_date = $start_date;
|
||||
$start_date = dol_print_date($start_date,"%Y-%m-%d");
|
||||
$end_date = dol_print_date($end_date,"%Y-%m-%d");
|
||||
$start_date = dol_print_date($start_date,"%m/%d/%Y");
|
||||
$end_date = dol_print_date($end_date,"%m/%d/%Y");
|
||||
// Resources
|
||||
$resources = $task["task_resources"];
|
||||
// Define depend (ex: "", "4,13", ...)
|
||||
|
||||
@ -150,8 +150,9 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
* Buttons actions
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
@ -205,6 +206,7 @@ if (count($tasksarray)>0)
|
||||
$tasks[$taskcursor]['task_milestone']=0;
|
||||
$tasks[$taskcursor]['task_percent_complete']=$val->progress;
|
||||
//$tasks[$taskcursor]['task_name']=$task->getNomUrl(1);
|
||||
//print dol_print_date($val->date_start).dol_print_date($val->date_end).'<br>'."\n";
|
||||
$tasks[$taskcursor]['task_name']=$val->label;
|
||||
$tasks[$taskcursor]['task_start_date']=$val->date_start;
|
||||
$tasks[$taskcursor]['task_end_date']=$val->date_end;
|
||||
@ -243,7 +245,6 @@ if (count($tasksarray)>0)
|
||||
//print "xxx".$val->id.$tasks[$taskcursor]['task_resources'];
|
||||
$taskcursor++;
|
||||
}
|
||||
//var_dump($tasks);
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
@ -233,9 +233,12 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$input='<h2>abc</h2>';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertTrue($after);
|
||||
$input='<img src="https://xxx.com/aaa/image.png" />';
|
||||
$input='<img id="abc" src="https://xxx.com/aaa/image.png" />';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertTrue($after,'Failure on test of img tag');
|
||||
$input='<a class="azerty" href="https://xxx.com/aaa/image.png" />';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertTrue($after,'Failure on test of a tag');
|
||||
|
||||
// False
|
||||
$input='xxx < br>';
|
||||
@ -247,6 +250,10 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$input='xxx <brstyle="ee">';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertFalse($after);
|
||||
$input='This is a text with html comments <!-- comment -->'; // we suppose this is not enough to be html content
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertFalse($after);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user