Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2015-03-15 23:22:58 +01:00
commit 73581931cb
122 changed files with 2976 additions and 1058 deletions

View File

@ -18,10 +18,15 @@ services:
language: php language: php
php: php:
# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available # - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available
- "5.3" - 5.3
- "5.4" - 5.4
- "5.5" - 5.5
- "5.6" - 5.6
- 7.0
matrix:
allow_failures:
- php: 7.0
env: env:
- DB=mysql - DB=mysql

View File

@ -162,6 +162,7 @@ For translators:
- New: When a translation is not available we always jump to en_US and only en_US. - New: When a translation is not available we always jump to en_US and only en_US.
For developers: For developers:
- New: Syslog module can be set to use ChromePHP plugin to output log server into browser console.
- New: Add a css style "cursorpointer". - New: Add a css style "cursorpointer".
- New: Select list of users can return user into hierarchy. - New: Select list of users can return user into hierarchy.
- New: getBrowserInfo can return type of layout of browser (classic/phone/tablet) - New: getBrowserInfo can return type of layout of browser (classic/phone/tablet)
@ -226,12 +227,14 @@ Dolibarr better:
- Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes
- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL - Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object - Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object
- Fix: [ bug #1833 ] user permissions in contact/note.php not working
- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php - Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php
- Fix: [ bug #1830 ] Salaries payment only allows checking accounts - Fix: [ bug #1830 ] Salaries payment only allows checking accounts
- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
- Fix: Bad SEPA xml file creation - Fix: Bad SEPA xml file creation
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment - Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
- Fix: Showing system error if not enough stock of product into orders creation with lines
***** ChangeLog for 3.6.2 compared to 3.6.1 ***** ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.

54
dev/fixaltlanguages.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/sh
# Recursively deduplicate file lines on a per file basis
# Useful to deduplicate language files
#
# Needs awk 4.0 for the inplace fixing command
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Scan alternate language files and remove entries found into parent file"
echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]"
exit
fi
if [ "x$2" = "x" ]
then
echo "Scan alternate language files and remove entries found into parent file"
echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]"
exit
fi
# To detect
if [ "x$1" = "xlist" ]
then
echo Feature not available
fi
# To fix
if [ "x$1" = "xfix" ]
then
for dir in `find htdocs/langs/$3* -type d`
do
dirshort=`basename $dir`
#echo $dirshort
export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" ]
then
reflang="htdocs/langs/"$aa"_"$aaupper
if [ -d $reflang ]
then
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
echo $dirshort est une langue alternative de $reflang
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
fi
fi
done;
fi

View File

@ -10,7 +10,7 @@
# Syntax # Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ] if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then then
echo "This script clean files with CR+LF into files with LF only. All source files are included, also files into includes." echo "This script detect or clean files with CR+LF into files with LF only. All source files are included, also files into includes."
echo "Usage: fixdosfiles.sh [list|fix]" echo "Usage: fixdosfiles.sh [list|fix]"
fi fi

View File

@ -7,6 +7,7 @@
# Syntax # Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ] if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then then
echo "Detect duplicate translation keys inside a file (there is no cross file check)."
echo "Usage: detectduplicatelangkey.sh (list|fix)" echo "Usage: detectduplicatelangkey.sh (list|fix)"
fi fi

View File

@ -9,17 +9,19 @@
# Syntax # Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ] if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then then
echo "Find exact duplicated lines into file (not cross file checking)"
echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]" echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]"
fi fi
# To detect # To detect
if [ "x$1" = "xlist" ] if [ "x$1" = "xlist" ]
then then
for file in `find . -type f -name *.lang` for file in `find htdocs/langs/en_US -type f -name *.lang`
do do
if [ `sort "$file" | uniq -d | wc -l` -gt 0 ] if [ `sort "$file" | grep -v '^$' | uniq -d | wc -l` -gt 0 ]
then then
echo "$file" echo "***** $file"
sort "$file" | grep -v '^$' | uniq -d
fi fi
done done
fi fi
@ -27,7 +29,7 @@ fi
# To fix # To fix
if [ "x$1" = "xfix" ] if [ "x$1" = "xfix" ]
then then
for file in `find . -type f -name *.lang` for file in `find htdocs/langs/en_US -type f -name *.lang`
do do
awk -i inplace ' !x[$0]++' "$file" awk -i inplace ' !x[$0]++' "$file"
done; done;

View File

@ -10,6 +10,7 @@
# Syntax # Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ] if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then then
echo "Fix permissions of files"
echo "Usage: fixperms.sh (list|fix)" echo "Usage: fixperms.sh (list|fix)"
fi fi

View File

@ -12,6 +12,7 @@
# Syntax # Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ] if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then then
echo "Detect and fix bad UTF8 encoded files (UTF8 must not use BOM char)"
echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]" echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
fi fi

View File

@ -25,7 +25,7 @@
* *
* Usage: * Usage:
* cd htdocs/langs * cd htdocs/langs
* ../../dev/translation/strip_language_file.php <primary_lang_dir> <secondary_lang_dir> [file.lang|all] * ./dev/translation/strip_language_file.php <primary_lang_dir> <secondary_lang_dir> [file.lang|all]
* *
* To rename all .delta files, you can do * To rename all .delta files, you can do
* for fic in `ls *.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done * for fic in `ls *.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
@ -66,7 +66,7 @@ if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
{ {
$rc = 1; $rc = 1;
$msg = '***** Script to clean language files *****'."\n"; $msg = '***** Script to clean language files *****'."\n";
$msg.= 'Usage: ../../dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n"; $msg.= 'Usage: ./dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n";
print $msg . "(rc=$rc).\n"; print $msg . "(rc=$rc).\n";
exit($rc); exit($rc);
} }
@ -77,7 +77,7 @@ $aSecondary = array();
// Define array $filesToProcess // Define array $filesToProcess
if ($filesToProcess == 'all') if ($filesToProcess == 'all')
{ {
$dir = new DirectoryIterator($lPrimary); $dir = new DirectoryIterator('htdocs/langs/'.$lPrimary);
while($dir->valid()) { while($dir->valid()) {
if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) { if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) {
$files[] = $dir->getFilename(); $files[] = $dir->getFilename();
@ -94,8 +94,8 @@ else $filesToProcess=explode(',',$filesToProcess);
// Loop on each file // Loop on each file
foreach($filesToProcess as $fileToProcess) foreach($filesToProcess as $fileToProcess)
{ {
$lPrimaryFile = $lPrimary.'/'.$fileToProcess; $lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
$lSecondaryFile = $lSecondary.'/'.$fileToProcess; $lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
$output = $lSecondaryFile . '.delta'; $output = $lSecondaryFile . '.delta';
print "---- Process language file ".$lSecondaryFile."\n"; print "---- Process language file ".$lSecondaryFile."\n";
@ -270,8 +270,8 @@ foreach($filesToProcess as $fileToProcess)
print "Output can be found at $output.\n"; print "Output can be found at $output.\n";
print "To rename all .delta files, you can do\n"; print "To rename all .delta files, you can do:\n";
print 'for fic in `ls *.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n"; print '> for fic in `ls htdocs/langs/'.$lSecondary.'/*.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n";
} }

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com> * Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@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
@ -316,7 +316,7 @@ $tabcond[13]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabl
$tabcond[14]= (! empty($conf->product->enabled) && ! empty($conf->ecotax->enabled)); $tabcond[14]= (! empty($conf->product->enabled) && ! empty($conf->ecotax->enabled));
$tabcond[15]= true; $tabcond[15]= true;
$tabcond[16]= (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); $tabcond[16]= (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
$tabcond[17]= ! empty($conf->deplacement->enabled); $tabcond[17]= (! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled));
$tabcond[18]= ! empty($conf->expedition->enabled); $tabcond[18]= ! empty($conf->expedition->enabled);
$tabcond[19]= ! empty($conf->societe->enabled); $tabcond[19]= ! empty($conf->societe->enabled);
$tabcond[20]= ! empty($conf->fournisseur->enabled); $tabcond[20]= ! empty($conf->fournisseur->enabled);

View File

@ -120,7 +120,7 @@ print "</td>";
print '</tr>'; print '</tr>';
// Use a flip-hide menu // Use a flip-hide menu
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 1)
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";

View File

@ -66,6 +66,11 @@ else if ($conf->db->type == 'mssql')
//$sqls[0] = ""; //$sqls[0] = "";
//$base=3; //$base=3;
} }
else if ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
{
//$sql = "SELECT name, type FROM sqlite_master";
$base = 4;
}
if (! $base) if (! $base)
@ -169,6 +174,40 @@ else
} }
print '</table>'; print '</table>';
} }
if ($base == 4)
{
// Sqlite by PDO or by Sqlite3
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td>'.$langs->trans("NbOfRecord").'</td>';
print "</tr>\n";
$sql = "SELECT name, type FROM sqlite_master where type='table' and name not like 'sqlite%' ORDER BY name";
$resql = $db->query($sql);
if ($resql)
{
$var=True;
while ($row = $db->fetch_row($resql)) {
$rescount = $db->query("SELECT COUNT(*) FROM " . $row[0]);
if ($rescount) {
$row_count = $db->fetch_row($rescount);
$count = $row_count[0];
} else {
$count = '?';
}
print "<tr ".$bc[$var].">";
print '<td>'.$row[0].'</td>';
print '<td>'.$count.'</td>';
print '</tr>';
}
}
}
} }
llxFooter(); llxFooter();

View File

@ -179,7 +179,7 @@ $c=getServerTimeZoneInt('summer');
$daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown'; $daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown';
//print $a." ".$b." ".$c." ".$daylight; //print $a." ".$b." ".$c." ".$daylight;
$val=($a>=0?'+':'').$a; $val=($a>=0?'+':'').$a;
$val.=' ('.($a==='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')'; $val.=' ('.($a=='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')';
$val.=' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString(); $val.=' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
$val.=' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')':''))); $val.=' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')':'')));
print $form->textwithtooltip($val,$txt,2,1,img_info('')); print $form->textwithtooltip($val,$txt,2,1,img_info(''));

View File

@ -24,6 +24,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("other"); $langs->load("other");
@ -105,7 +106,41 @@ llxHeader('',$langs->trans("Upgrade"),$wikihelp);
print_fiche_titre($langs->trans("Upgrade"),'','setup'); print_fiche_titre($langs->trans("Upgrade"),'','setup');
print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>'; print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("FeatureNotYetAvailable").'</b><br>';
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
$sfurl = simplexml_load_string($result['content']);
if ($sfurl)
{
$title=$sfurl->channel[0]->item[0]->title;
function word_limiter($text, $limit = 30, $chars = '0123456789.')
{
if (strlen( $text ) > $limit)
{
$words = str_word_count($text, 2, $chars);
$words = array_reverse($words, TRUE);
foreach($words as $length => $word) {
if ($length + strlen( $word ) >= $limit)
{
array_shift($words);
} else {
break;
}
}
$words = array_reverse($words);
$text = implode(" ", $words) . '';
}
return $text;
}
$str = $title;
print $langs->trans("LastStableVersion").' : <b>'. word_limiter( $str ).'</b><br>';
}
else
{
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
}
print '<br>'; print '<br>';
print $langs->trans("Upgrade").'<br>'; print $langs->trans("Upgrade").'<br>';

View File

@ -235,7 +235,9 @@ if ($socid)
$soc = new Societe($db); $soc = new Societe($db);
$result = $soc->fetch($socid); $result = $soc->fetch($socid);
llxHeader("","",$langs->trans("Category")); $title=$langs->trans("Category");
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$soc->name." - ".$title;
llxHeader("",$title);
// Show tabs // Show tabs
$head = societe_prepare_head($soc); $head = societe_prepare_head($soc);

View File

@ -1000,7 +1000,7 @@ class Categorie extends CommonObject
/** /**
* Check if no category with same label already exists for this cat's parent or root and for this cat's type * Check if no category with same label already exists for this cat's parent or root and for this cat's type
* *
* @return boolean 1 if already exist, 0 otherwise, -1 if error * @return integer 1 if already exist, 0 otherwise, -1 if error
*/ */
function already_exists() function already_exists()
{ {
@ -1295,11 +1295,9 @@ class Categorie extends CommonObject
* *
* @param string $sdir Repertoire destination finale * @param string $sdir Repertoire destination finale
* @param string $file Nom du fichier uploade * @param string $file Nom du fichier uploade
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
* @return void * @return void
*/ */
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) function add_photo($sdir, $file)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -1321,36 +1319,11 @@ class Categorie extends CommonObject
if (file_exists($originImage)) if (file_exists($originImage))
{ {
// Cree fichier en taille vignette // Cree fichier en taille vignette
$this->add_thumb($originImage,$maxWidth,$maxHeight); $this->add_thumb($originImage);
} }
} }
} }
/**
* Build thumb
*
* @param string $file Chemin du fichier d'origine
* @return void
*/
function add_thumb($file)
{
global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
if (file_exists($file))
{
// Create small thumbs for company (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
// Create mini thumbs for company (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality);
}
}
/** /**
* Return tableau de toutes les photos de la categorie * Return tableau de toutes les photos de la categorie
* *

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 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
@ -347,7 +348,6 @@ if (! empty($conf->use_javascript_ajax))
$s=''; $s='';
$s.='<script type="text/javascript">' . "\n"; $s.='<script type="text/javascript">' . "\n";
$s.='jQuery(document).ready(function () {' . "\n"; $s.='jQuery(document).ready(function () {' . "\n";
$s.='jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n"; $s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
$s.='jQuery(".family_birthday").toggle();' . "\n"; $s.='jQuery(".family_birthday").toggle();' . "\n";
if ($action=="show_week" || $action=="show_month" || empty($action)) if ($action=="show_week" || $action=="show_month" || empty($action))
@ -361,18 +361,20 @@ if (! empty($conf->use_javascript_ajax))
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' &nbsp; </div>'; $s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' &nbsp; </div>';
if (is_array($showextcals) && count($showextcals) > 0) if (is_array($showextcals) && count($showextcals) > 0)
{ {
$s.='<script type="text/javascript">' . "\n";
$s.='jQuery(document).ready(function () {
jQuery("table input[name^=\"check_ext\"]").click(function() {
var name = $(this).attr("name");
jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
});
});' . "\n";
$s.='</script>' . "\n";
foreach ($showextcals as $val) foreach ($showextcals as $val)
{ {
$htmlname = md5($val['name']); $htmlname = md5($val['name']);
$s.='<script type="text/javascript">' . "\n"; $s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val['name'] . ' &nbsp; </div>';
$s.='jQuery(document).ready(function () {' . "\n";
$s.=' jQuery("#check_ext' . $htmlname . '").click(function() {';
$s.=' /* alert("'.$htmlname.'"); */';
$s.=' jQuery(".family_ext' . $htmlname . '").toggle();';
$s.=' });' . "\n";
$s.='});' . "\n";
$s.='</script>' . "\n";
$s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>';
} }
} }
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>'; $s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>';

View File

@ -614,7 +614,7 @@ else
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
$sql.= " WHERE u.entity IN (".getEntity('user',1).")"; $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
if ($usergroup > 0) $sql.= " AND ug.fk_usergroup = ".$usergroup; if ($usergroup > 0) $sql.= " AND ug.fk_usergroup = ".$usergroup;
if (GETPOST("usertodo","int",3) > 0) $sql.=" AND u.rowid = ".GETPOST("usertodo","int",3); //if (GETPOST("usertodo","int",3) > 0) $sql.=" AND u.rowid = ".GETPOST("usertodo","int",3);
//print $sql; //print $sql;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@ -68,10 +68,15 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="nom"; if (! $sortfield) $sortfield="nom";
$cancelbutton = GETPOST('cancel'); $cancelbutton = GETPOST('cancel');
$object = new Client($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('commcard','globalcard')); $hookmanager->initHooks(array('commcard','globalcard'));
$object = new Societe($db);
/* /*
* Actions * Actions
@ -425,9 +430,9 @@ if ($id > 0)
print '</tr>'; print '</tr>';
} }
// Level of prospect
if ($object->client == 2 || $object->client == 3) if ($object->client == 2 || $object->client == 3)
{ {
// Level of prospect
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('ProspectLevel'); print $langs->trans('ProspectLevel');
@ -453,7 +458,16 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
} }
// Sales representative // Other attributes
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields);
}
// Sales representative
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent

View File

@ -779,8 +779,21 @@ if (empty($reshook))
$desc = dol_concatdesc($desc, $product_desc); $desc = dol_concatdesc($desc, $product_desc);
// Add dimensions into product description
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
{
$text='';
if ($prod->weight) $text.=($text?"\n":"").$outputlangs->trans("Weight").': '.$prod->weight.' '.$prod->weight_units;
if ($prod->length) $text.=($text?"\n":"").$outputlangs->trans("Length").': '.$prod->length.' '.$prod->length_units;
if ($prod->surface) $text.=($text?"\n":"").$outputlangs->trans("Surface").': '.$prod->surface.' '.$prod->surface_units;
if ($prod->volume) $text.=($text?"\n":"").$outputlangs->trans("Volume").': '.$prod->volume.' '.$prod->volume_units;
$desc = dol_concatdesc($desc, $text);
}*/
// Add custom code and origin country into description // Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt = '('; $tmptxt = '(';
if (! empty($prod->customcode)) if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
@ -2003,8 +2016,7 @@ if ($action == 'create')
// Amount HT // Amount HT
print '<tr><td height="10" width="25%">' . $langs->trans('AmountHT') . '</td>'; print '<tr><td height="10" width="25%">' . $langs->trans('AmountHT') . '</td>';
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>'; print '<td align="right" class="nowrap" colspan="2"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
print '<td></td>';
// Margin Infos // Margin Infos
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
@ -2016,27 +2028,27 @@ if ($action == 'create')
// Amount VAT // Amount VAT
print '<tr><td height="10">' . $langs->trans('AmountVAT') . '</td>'; print '<tr><td height="10">' . $langs->trans('AmountVAT') . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap" colspan="2">' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td></td></tr>'; print '</tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1 if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap" colspan="2">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td></td></tr>'; print '<td></td></tr>';
} }
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap" colspan="2">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td></td></tr>'; print '</tr>';
} }
// Amount TTC // Amount TTC
print '<tr><td height="10">' . $langs->trans('AmountTTC') . '</td>'; print '<tr><td height="10">' . $langs->trans('AmountTTC') . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap" colspan="2">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td></td></tr>'; print '</tr>';
// Statut // Statut
print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>'; print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
@ -111,6 +111,11 @@ class Commande extends CommonOrder
var $location_incoterms; var $location_incoterms;
var $libelle_incoterms; //Used into tooltip var $libelle_incoterms; //Used into tooltip
/**
* ERR Not engouch stock
*/
const STOCK_NOT_ENOUGH_FOR_ORDER = -3;
/** /**
* Constructor * Constructor
@ -752,8 +757,11 @@ class Commande extends CommonOrder
); );
if ($result < 0) if ($result < 0)
{ {
$this->error=$this->db->lasterror(); if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER)
dol_print_error($this->db); {
$this->error=$this->db->lasterror();
dol_print_error($this->db);
}
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1192,10 +1200,12 @@ class Commande extends CommonOrder
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
$product_type=$product->type; $product_type=$product->type;
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) { if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough'); $this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback(); $this->db->rollback();
return -3; return self::STOCK_NOT_ENOUGH_FOR_ORDER;
} }
} }

View File

@ -368,7 +368,7 @@ if ($resql)
$nbprod++; // order contains real products $nbprod++; // order contains real products
$generic_product->id = $generic_commande->lines[$lig]->fk_product; $generic_product->id = $generic_commande->lines[$lig]->fk_product;
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
$generic_product->load_stock(true); $generic_product->load_stock();
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel; $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
} else { } else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel']; $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];

View File

@ -196,7 +196,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
{ {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.date_debut as date, x.tms as dm, x.total_ttc"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE u.rowid = x.fk_user_author"; $sql.= " WHERE u.rowid = x.fk_user_author";
@ -218,7 +218,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses",min($max,$num)).'</td>'; print '<td colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses",min($max,$num)).'</td>';
print '<td align="right">'.$langs->trans("FeesAmount").'</td>'; print '<td align="right">'.$langs->trans("TotalTTC").'</td>';
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>'; print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -239,9 +239,9 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>'; print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(1).'</td>'; print '<td>'.$userstatic->getNomUrl(1).'</td>';
print '<td align="right">'.$obj->total_ttc.'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
//print '<td>'.$expensereportstatic->LibStatut($obj->fk_statut,3).'</td>'; print '<td>'.$expensereportstatic->LibStatut($obj->status,3).'</td>';
print '</tr>'; print '</tr>';
$var=!$var; $var=!$var;
$i++; $i++;

View File

@ -1294,7 +1294,7 @@ class BonPrelevement extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
$this->total = $this->total + $obj->somme; $this->total = $this->total + $obj->somme;
$i++; $i++;
} }
@ -1496,6 +1496,20 @@ class BonPrelevement extends CommonObject
} }
/**
* Build RUM number for a customer bank account
*
* @param string $row_code_client Customer code (soc.code_client)
* @param int $row_datec Creation date of bank account (rib.datec)
* @param string $row_drum Id of customer bank account (rib.rowid)
* @return string RUM number
*/
static function buildRumNumber($row_code_client, $row_datec, $row_drum)
{
$pre = ($row_datec > 1359673200) ? 'Rum' : '++R';
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
}
/** /**
* Write recipient of request (customer) * Write recipient of request (customer)
* *
@ -1514,7 +1528,7 @@ class BonPrelevement extends CommonObject
* @param string $row_iban rib.iban_prefix AS iban, * @param string $row_iban rib.iban_prefix AS iban,
* @param string $row_bic rib.bic AS bic, * @param string $row_bic rib.bic AS bic,
* @param string $row_datec rib.datec, * @param string $row_datec rib.datec,
* @param string $row_drum rib.rowid AS drum * @param string $row_drum rib.rowid used to generate rum
* @return string Return string with SEPA part DrctDbtTxInf * @return string Return string with SEPA part DrctDbtTxInf
*/ */
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
@ -1524,10 +1538,11 @@ class BonPrelevement extends CommonObject
// Define value for RUM // Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Date_Rum = strtotime($row_datec); $Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum);
// Define date of RUM signature
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');
$pre = ($date_Rum > 1359673200) ? 'Rum' : '++R';
$Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum);
$XML_DEBITOR =''; $XML_DEBITOR ='';
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf; $XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
$XML_DEBITOR .=' <PmtId>'.$CrLf; $XML_DEBITOR .=' <PmtId>'.$CrLf;

View File

@ -156,7 +156,7 @@ class RejetPrelevement
} }
else else
{ {
$result=$pai->addPaymentToBank($user,'payment','(InvoiceRefused)',$bankaccount); $result=$pai->addPaymentToBank($user,'payment','(InvoiceRefused)',$bankaccount,'','');
if ($result < 0) if ($result < 0)
{ {
dol_syslog("RejetPrelevement::Create AddPaymentToBan Error"); dol_syslog("RejetPrelevement::Create AddPaymentToBan Error");

View File

@ -373,7 +373,7 @@ if ($id)
print "<div class=\"tabsAction\">\n"; print "<div class=\"tabsAction\">\n";
if ($salpayment->rappro == 0) if ($salpayment->rappro == 0)
{ {
if (! empty($user->rights->tax->charges->supprimer)) if (! empty($user->rights->salaries->delete))
{ {
print '<a class="butActionDelete" href="card.php?id='.$salpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="card.php?id='.$salpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
} }

View File

@ -77,8 +77,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
// Add social contribution // Add social contribution
if ($action == 'add' && $user->rights->tax->charges->creer) if ($action == 'add' && $user->rights->tax->charges->creer)
{ {
$dateech=@dol_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]); $dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=@dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]); $dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
$amount=GETPOST('amount');
$actioncode=GETPOST('actioncode');
if (! $dateech) if (! $dateech)
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
@ -89,12 +91,12 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
$action = 'create'; $action = 'create';
} }
elseif (! $_POST["actioncode"] > 0) elseif (! $actioncode > 0)
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
$action = 'create'; $action = 'create';
} }
elseif (! $_POST["amount"]) elseif (empty($amount))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
$action = 'create'; $action = 'create';
@ -103,11 +105,11 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
{ {
$chargesociales=new ChargeSociales($db); $chargesociales=new ChargeSociales($db);
$chargesociales->type=$_POST["actioncode"]; $chargesociales->type=$actioncode;
$chargesociales->lib=$_POST["label"]; $chargesociales->lib=GETPOST('label');
$chargesociales->date_ech=$dateech; $chargesociales->date_ech=$dateech;
$chargesociales->periode=$dateperiod; $chargesociales->periode=$dateperiod;
$chargesociales->amount=$_POST["amount"]; $chargesociales->amount=price2num($amount);
$id=$chargesociales->create($user); $id=$chargesociales->create($user);
if ($id <= 0) if ($id <= 0)
@ -120,32 +122,39 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->creer) if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->creer)
{ {
$dateech=dol_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]); $dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]); $dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
if (! $dateech) $amount=GETPOST('amount');
{ if (! $dateech)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); {
$action = 'edit'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
} $action = 'edit';
elseif (! $dateperiod) }
{ elseif (! $dateperiod)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); {
$action = 'edit'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
} $action = 'edit';
}
elseif (empty($amount))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
$action = 'edit';
}
else else
{ {
$chargesociales=new ChargeSociales($db); $chargesociales=new ChargeSociales($db);
$result=$chargesociales->fetch($_GET["id"]); $result=$chargesociales->fetch($id);
$chargesociales->lib=$_POST["label"]; $chargesociales->lib=GETPOST('label');
$chargesociales->date_ech=$dateech; $chargesociales->date_ech=$dateech;
$chargesociales->periode=$dateperiod; $chargesociales->periode=$dateperiod;
$chargesociales->amount=price2num($amount);
$result=$chargesociales->update($user); $result=$chargesociales->update($user);
if ($result <= 0) if ($result <= 0)
{ {
setEventMessage($chargesociales->error, 'errors'); setEventMessage($chargesociales->error, 'errors');
} }
} }
} }
@ -437,7 +446,15 @@ if ($id > 0)
} }
// Amount // Amount
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>'; if ($action == 'edit')
{
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td>";
print '<input type="text" name="amount" size="12" class="flat" value="'.$object->amount.'">';
print "</td></tr>";
}
else {
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
}
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
@ -466,7 +483,7 @@ if ($id > 0)
print "<div class=\"tabsAction\">\n"; print "<div class=\"tabsAction\">\n";
// Edit // Edit
if ($user->rights->tax->charges->creer) if ($object->paye == 0 && $user->rights->tax->charges->creer)
{ {
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>";
} }
@ -500,7 +517,7 @@ if ($id > 0)
} }
else else
{ {
/* Charge non trouv<75> */ /* Social contribution not found */
dol_print_error('',$object->error); dol_print_error('',$object->error);
} }
} }

View File

@ -266,7 +266,8 @@ class ChargeSociales extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
$sql.= " SET libelle='".$this->db->escape($this->lib)."',"; $sql.= " SET libelle='".$this->db->escape($this->lib)."',";
$sql.= " date_ech='".$this->db->idate($this->date_ech)."',"; $sql.= " date_ech='".$this->db->idate($this->date_ech)."',";
$sql.= " periode='".$this->db->idate($this->periode)."'"; $sql.= " periode='".$this->db->idate($this->periode)."',";
$sql.= " amount='".price2num($this->amount,'MT')."'";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);

5
htdocs/conf/phpinfo.php Normal file
View File

@ -0,0 +1,5 @@
<a href="index.php">Go back to index</a>
| <a href="<?php echo $_SERVER["REQUEST_URI"];?>">Refresh</a>
<br><br>
<?php phpinfo(); ?>

View File

@ -73,7 +73,7 @@ $object = new Contrat($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// Load object // Load object
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref) && $action!='add') {
$ret = $object->fetch($id, $ref); $ret = $object->fetch($id, $ref);
if ($ret > 0) if ($ret > 0)
$ret = $object->fetch_thirdparty(); $ret = $object->fetch_thirdparty();
@ -207,6 +207,13 @@ if ($action == 'add' && $user->rights->contrat->creer)
$error++; $error++;
} }
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
$action = 'create';
}
if (! $error) if (! $error)
{ {
$object->socid = $socid; $object->socid = $socid;
@ -356,11 +363,6 @@ if ($action == 'add' && $user->rights->contrat->creer)
} }
else else
{ {
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++;
$result = $object->create($user); $result = $object->create($user);
if ($result > 0) if ($result > 0)
{ {
@ -726,20 +728,19 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
// Fill array 'array_options' with data from update form // Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0) $error++; if ($ret < 0)
$error ++;
if (! $error) if (! $error) {
{
$result = $object->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
else if ($reshook < 0) $error++;
if ($error) $result = $object->insertExtraFields();
{ if ($result < 0) {
$error ++;
}
} else if ($reshook < 0)
$error ++;
if ($error) {
$action = 'edit_extras'; $action = 'edit_extras';
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }

View File

View File

@ -80,6 +80,13 @@ if ($action == 'add')
$mesg[]=$langs->trans("ErrorNoValueForCheckBoxType"); $mesg[]=$langs->trans("ErrorNoValueForCheckBoxType");
$action = 'create'; $action = 'create';
} }
if (GETPOST('type')=='link' && !GETPOST('param'))
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorNoValueForLinkType");
$action = 'create';
}
if (GETPOST('type')=='radio' && !GETPOST('param')) if (GETPOST('type')=='radio' && !GETPOST('param'))
{ {
$error++; $error++;

View File

@ -2140,7 +2140,7 @@ abstract class CommonObject
$fieldstatus="fk_statut"; $fieldstatus="fk_statut";
if ($elementTable == 'user') $fieldstatus="statut"; if ($elementTable == 'user') $fieldstatus="statut";
if ($elementTable == 'expensereport') $fieldstatus="fk_c_expensereport_statuts"; if ($elementTable == 'expensereport') $fieldstatus="fk_statut";
if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus="status"; if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus="status";
$sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable; $sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable;
@ -2804,12 +2804,7 @@ abstract class CommonObject
if ($line->fk_product > 0) if ($line->fk_product > 0)
{ {
$product_static = new Product($this->db); $product_static = new Product($this->db);
$product_static->fetch($line->fk_product);
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
if (! empty($line->entity))
$product_static->entity=$line->entity;
$text=$product_static->getNomUrl(1); $text=$product_static->getNomUrl(1);
// Define output language and label // Define output language and label
@ -2842,7 +2837,7 @@ abstract class CommonObject
} }
$text.= ' - '.(! empty($line->label)?$line->label:$label); $text.= ' - '.(! empty($line->label)?$line->label:$label);
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($line->description)); $description.=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($line->description)); // Description is what to show on popup. We shown nothing if already into desc.
} }
// Output template part (modules that overwrite templates must declare this into descriptor) // Output template part (modules that overwrite templates must declare this into descriptor)
@ -3463,6 +3458,31 @@ abstract class CommonObject
} }
} }
/**
* Build thumb
*
* @param string $file Path file in UTF8 to original file to create thumbs from.
* @return void
*/
function add_thumb($file)
{
global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
$file_osencoded=dol_osencode($file);
if (file_exists($file_osencoded))
{
// Create small thumbs for company (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($file_osencoded, $maxwidthsmall, $maxheightsmall, '_small', $quality);
// Create mini thumbs for company (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($file_osencoded, $maxwidthmini, $maxheightmini, '_mini', $quality);
}
}
/* Functions common to commonobject and commonobjectline */ /* Functions common to commonobject and commonobjectline */
@ -3629,6 +3649,7 @@ abstract class CommonObject
$attributeType = $extrafields->attribute_type[$attributeKey]; $attributeType = $extrafields->attribute_type[$attributeKey];
$attributeSize = $extrafields->attribute_size[$attributeKey]; $attributeSize = $extrafields->attribute_size[$attributeKey];
$attributeLabel = $extrafields->attribute_label[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey];
$attributeParam = $extrafields->attribute_param[$attributeKey];
switch ($attributeType) switch ($attributeType)
{ {
case 'int': case 'int':
@ -3651,6 +3672,19 @@ abstract class CommonObject
case 'datetime': case 'datetime':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]); $this->array_options[$key]=$this->db->idate($this->array_options[$key]);
break; break;
case 'link':
$param_list=array_keys($attributeParam ['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
if ($value)
{
$object->fetch(0,$value);
$this->array_options[$key]=$object->id;
}
break;
} }
} }
$this->db->begin(); $this->db->begin();

View File

@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B) var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...) var $datacolor; // array(array(R,G,B),...)
private $_stringtoshow; // To store string to output graph into HTML page protected $stringtoshow; // To store string to output graph into HTML page
/** /**
@ -774,7 +774,7 @@ class DolGraph
// Generate file // Generate file
$graph->draw($file); $graph->draw($file);
$this->_stringtoshow='<!-- Build using '.$this->_library.' --><img src="'.$fileurl.'" title="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'" alt="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'">'; $this->stringtoshow='<!-- Build using '.$this->_library.' --><img src="'.$fileurl.'" title="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'" alt="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'">';
} }
@ -847,18 +847,18 @@ class DolGraph
} }
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file),'_',array('-','.')))); $tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file),'_',array('-','.'))));
$this->_stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n"; $this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n";
if (! empty($this->title)) $this->_stringtoshow.='<div align="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>'; if (! empty($this->title)) $this->stringtoshow.='<div align="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
$this->_stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).'"></div>'."\n"; $this->stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).'"></div>'."\n";
$this->_stringtoshow.='<script id="'.$tag.'">'."\n"; $this->stringtoshow.='<script id="'.$tag.'">'."\n";
$this->_stringtoshow.='$(function () {'."\n"; $this->stringtoshow.='$(function () {'."\n";
$i=$firstlot; $i=$firstlot;
while ($i < $nblot) while ($i < $nblot)
{ {
$this->_stringtoshow.=$serie[$i]; $this->stringtoshow.=$serie[$i];
$i++; $i++;
} }
$this->_stringtoshow.="\n"; $this->stringtoshow.="\n";
// Special case for Graph of type 'pie' // Special case for Graph of type 'pie'
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie') if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie')
@ -871,7 +871,7 @@ class DolGraph
$showpointvalue=$this->showpointvalue; $showpointvalue=$this->showpointvalue;
$showpercent=$this->showpercent; $showpercent=$this->showpercent;
$this->_stringtoshow.= ' $this->stringtoshow.= '
function plotWithOptions_'.$tag.'() { function plotWithOptions_'.$tag.'() {
$.plot($("#placeholder_'.$tag.'"), d0, $.plot($("#placeholder_'.$tag.'"), d0,
{ {
@ -886,15 +886,15 @@ class DolGraph
var percent=Math.round(series.percent); var percent=Math.round(series.percent);
var number=series.data[0][1]; var number=series.data[0][1];
return \''; return \'';
$this->_stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'; $this->stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:white;">';
if ($urltemp) $this->_stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">'; if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
$this->_stringtoshow.='\'+'; $this->stringtoshow.='\'+';
$this->_stringtoshow.=($showlegend?'':'label+\'<br/>\'+'); // Hide label if already shown in legend $this->stringtoshow.=($showlegend?'':'label+\'<br/>\'+'); // Hide label if already shown in legend
$this->_stringtoshow.=($showpointvalue?'number+':''); $this->stringtoshow.=($showpointvalue?'number+':'');
$this->_stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':''); $this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':'');
$this->_stringtoshow.='\''; $this->stringtoshow.='\'';
if ($urltemp) $this->_stringtoshow.='</a>'; if ($urltemp) $this->stringtoshow.='</a>';
$this->_stringtoshow.='</div>\'; $this->stringtoshow.='</div>\';
}, },
background: { background: {
opacity: 0.5, opacity: 0.5,
@ -911,9 +911,9 @@ class DolGraph
},'; },';
if (count($datacolor)) if (count($datacolor))
{ {
$this->_stringtoshow.='colors: '.(! empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)).','; $this->stringtoshow.='colors: '.(! empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)).',';
} }
$this->_stringtoshow.='legend: {show: '.($showlegend?'true':'false').', position: \'ne\' } $this->stringtoshow.='legend: {show: '.($showlegend?'true':'false').', position: \'ne\' }
}); });
}'."\n"; }'."\n";
} }
@ -921,7 +921,7 @@ class DolGraph
else else
{ {
// Add code to support tooltips // Add code to support tooltips
$this->_stringtoshow.=' $this->stringtoshow.='
function showTooltip_'.$tag.'(x, y, contents) { function showTooltip_'.$tag.'(x, y, contents) {
$(\'<div id="tooltip_'.$tag.'">\' + contents + \'</div>\').css({ $(\'<div id="tooltip_'.$tag.'">\' + contents + \'</div>\').css({
position: \'absolute\', position: \'absolute\',
@ -951,10 +951,10 @@ class DolGraph
var y = item.datapoint[1].toFixed(2); var y = item.datapoint[1].toFixed(2);
var z = item.series.xaxis.ticks[item.dataIndex].label; var z = item.series.xaxis.ticks[item.dataIndex].label;
'; ';
if ($this->showpointvalue > 0) $this->_stringtoshow.=' if ($this->showpointvalue > 0) $this->stringtoshow.='
showTooltip_'.$tag.'(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y); showTooltip_'.$tag.'(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
'; ';
$this->_stringtoshow.=' $this->stringtoshow.='
} }
} }
else { else {
@ -964,50 +964,50 @@ class DolGraph
}); });
'; ';
$this->_stringtoshow.='var stack = null, steps = false;'."\n"; $this->stringtoshow.='var stack = null, steps = false;'."\n";
$this->_stringtoshow.='function plotWithOptions_'.$tag.'() {'."\n"; $this->stringtoshow.='function plotWithOptions_'.$tag.'() {'."\n";
$this->_stringtoshow.='$.plot($("#placeholder_'.$tag.'"), [ '."\n"; $this->stringtoshow.='$.plot($("#placeholder_'.$tag.'"), [ '."\n";
$i=$firstlot; $i=$firstlot;
while ($i < $nblot) while ($i < $nblot)
{ {
if ($i > $firstlot) $this->_stringtoshow.=', '."\n"; if ($i > $firstlot) $this->stringtoshow.=', '."\n";
$color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); $color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]);
$this->_stringtoshow.='{ '; $this->stringtoshow.='{ ';
if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->_stringtoshow.='bars: { show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, ';
if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->_stringtoshow.='lines: { show: true, fill: false }, '; if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, ';
$this->_stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; $this->stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }';
$i++; $i++;
} }
$this->_stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n"; $this->stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
// Xaxis // Xaxis
$this->_stringtoshow.=', xaxis: { ticks: ['."\n"; $this->stringtoshow.=', xaxis: { ticks: ['."\n";
$x=0; $x=0;
foreach($this->data as $key => $valarray) foreach($this->data as $key => $valarray)
{ {
if ($x > 0) $this->_stringtoshow.=', '."\n"; if ($x > 0) $this->stringtoshow.=', '."\n";
$this->_stringtoshow.= ' ['.$x.', "'.$valarray[0].'"]'; $this->stringtoshow.= ' ['.$x.', "'.$valarray[0].'"]';
$x++; $x++;
} }
$this->_stringtoshow.='] }'."\n"; $this->stringtoshow.='] }'."\n";
// Yaxis // Yaxis
$this->_stringtoshow.=', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n"; $this->stringtoshow.=', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n";
// Background color // Background color
$color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]); $color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]);
$color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); $color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]);
$this->_stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] } }'."\n"; $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] } }'."\n";
//$this->_stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this //$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this
$this->_stringtoshow.='});'."\n"; $this->stringtoshow.='});'."\n";
$this->_stringtoshow.='}'."\n"; $this->stringtoshow.='}'."\n";
} }
$this->_stringtoshow.='plotWithOptions_'.$tag.'();'."\n"; $this->stringtoshow.='plotWithOptions_'.$tag.'();'."\n";
$this->_stringtoshow.='});'."\n"; $this->stringtoshow.='});'."\n";
$this->_stringtoshow.='</script>'."\n"; $this->stringtoshow.='</script>'."\n";
} }
@ -1019,7 +1019,7 @@ class DolGraph
*/ */
function show() function show()
{ {
return $this->_stringtoshow; return $this->stringtoshow;
} }

View File

@ -6,6 +6,7 @@
* Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <forian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <forian.henry@open-concept.pro>
* Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr>
* *
* 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
@ -54,6 +55,8 @@ class ExtraFields
var $attribute_alwayseditable; var $attribute_alwayseditable;
// Array to store permission to check // Array to store permission to check
var $attribute_perms; var $attribute_perms;
// Array to store permission to check
var $attribute_list;
var $error; var $error;
var $errno; var $errno;
@ -75,6 +78,7 @@ class ExtraFields
'checkbox' => 'ExtrafieldCheckBox', 'checkbox' => 'ExtrafieldCheckBox',
'radio' => 'ExtrafieldRadio', 'radio' => 'ExtrafieldRadio',
'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink',
); );
/** /**
@ -93,6 +97,7 @@ class ExtraFields
$this->attribute_unique = array(); $this->attribute_unique = array();
$this->attribute_required = array(); $this->attribute_required = array();
$this->attribute_perms = array(); $this->attribute_perms = array();
$this->attribute_list = array();
} }
/** /**
@ -110,9 +115,10 @@ class ExtraFields
* @param array $param Params for field * @param array $param Params for field
* @param int $alwayseditable Is attribute always editable regardless of the document status * @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check * @param string $perms Permission to check
* @param int $list Into list view by default
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='') function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0)
{ {
if (empty($attrname)) return -1; if (empty($attrname)) return -1;
if (empty($label)) return -1; if (empty($label)) return -1;
@ -122,13 +128,13 @@ class ExtraFields
// Create field into database except for separator type which is not stored in database // Create field into database except for separator type which is not stored in database
if ($type != 'separate') if ($type != 'separate')
{ {
$result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value,$param); $result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value, $param, $perms, $list);
} }
$err1=$this->errno; $err1=$this->errno;
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
{ {
// Add declaration of field into table // Add declaration of field into table
$result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param, $alwayseditable, $perms); $result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param, $alwayseditable, $perms, $list);
$err2=$this->errno; $err2=$this->errno;
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
{ {
@ -156,10 +162,11 @@ class ExtraFields
* @param int $required Is field required or not * @param int $required Is field required or not
* @param string $default_value Default value for field * @param string $default_value Default value for field
* @param array $param Params for field (ex for select list : array('options'=>array('value'=>'label of option')) * @param array $param Params for field (ex for select list : array('options'=>array('value'=>'label of option'))
* * @param string $perms Permission
* @param int $list Into list view by default
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
private function create($attrname, $type='varchar', $length=255, $elementtype='member', $unique=0, $required=0, $default_value='',$param='') private function create($attrname, $type='varchar', $length=255, $elementtype='member', $unique=0, $required=0, $default_value='',$param='', $perms='', $list=0)
{ {
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
@ -182,6 +189,9 @@ class ExtraFields
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){ } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){
$typedb='text'; $typedb='text';
$lengthdb=''; $lengthdb='';
} elseif ($type=='link') {
$typedb='int';
$lengthdb='11';
} else { } else {
$typedb=$type; $typedb=$type;
$lengthdb=$length; $lengthdb=$length;
@ -230,9 +240,10 @@ class ExtraFields
* @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
* @param int $alwayseditable Is attribute always editable regardless of the document status * @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check * @param string $perms Permission to check
* @param int $list Into list view by default
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='') private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0)
{ {
global $conf; global $conf;
@ -240,6 +251,7 @@ class ExtraFields
// Clean parameters // Clean parameters
if (empty($pos)) $pos=0; if (empty($pos)) $pos=0;
if (empty($list)) $list=0;
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname)) if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
{ {
@ -256,7 +268,7 @@ class ExtraFields
$params=''; $params='';
} }
$sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list)";
$sql.= " VALUES('".$attrname."',"; $sql.= " VALUES('".$attrname."',";
$sql.= " '".$this->db->escape($label)."',"; $sql.= " '".$this->db->escape($label)."',";
$sql.= " '".$type."',"; $sql.= " '".$type."',";
@ -267,8 +279,9 @@ class ExtraFields
$sql.= " '".$unique."',"; $sql.= " '".$unique."',";
$sql.= " '".$required."',"; $sql.= " '".$required."',";
$sql.= " '".$params."',"; $sql.= " '".$params."',";
$sql.= " '".$alwayseditable."'"; $sql.= " '".$alwayseditable."',";
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null"); $sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
$sql.= " ".$list;
$sql.=')'; $sql.=')';
dol_syslog(get_class($this)."::create_label", LOG_DEBUG); dol_syslog(get_class($this)."::create_label", LOG_DEBUG);
@ -370,9 +383,10 @@ class ExtraFields
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
* @param int $alwayseditable Is attribute always editable regardless of the document status * @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check * @param string $perms Permission to check
* @param int $list Into list view by default
* @return int >0 if OK, <=0 if KO * @return int >0 if OK, <=0 if KO
*/ */
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='') function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='')
{ {
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
@ -395,6 +409,9 @@ class ExtraFields
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) { } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) {
$typedb='text'; $typedb='text';
$lengthdb=''; $lengthdb='';
} elseif ($type=='link') {
$typedb='int';
$lengthdb='11';
} else { } else {
$typedb=$type; $typedb=$type;
$lengthdb=$length; $lengthdb=$length;
@ -409,7 +426,7 @@ class ExtraFields
{ {
if ($label) if ($label)
{ {
$result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms); $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list);
} }
if ($result > 0) if ($result > 0)
{ {
@ -459,14 +476,17 @@ class ExtraFields
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
* @param int $alwayseditable Is attribute always editable regardless of the document status * @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check * @param string $perms Permission to check
* @param int $list Into list view by default
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='') private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0)
{ {
global $conf; global $conf;
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms); dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list);
// Clean parameters
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
if (empty($list)) $list=0;
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
{ {
@ -496,7 +516,8 @@ class ExtraFields
$sql.= " perms,"; $sql.= " perms,";
$sql.= " pos,"; $sql.= " pos,";
$sql.= " alwayseditable,"; $sql.= " alwayseditable,";
$sql.= " param"; $sql.= " param,";
$sql.= " list";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= "'".$attrname."',"; $sql.= "'".$attrname."',";
$sql.= " ".$conf->entity.","; $sql.= " ".$conf->entity.",";
@ -506,10 +527,11 @@ class ExtraFields
$sql.= " '".$elementtype."',"; $sql.= " '".$elementtype."',";
$sql.= " '".$unique."',"; $sql.= " '".$unique."',";
$sql.= " '".$required."',"; $sql.= " '".$required."',";
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null"); $sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
$sql.= " '".$pos."',"; $sql.= " '".$pos."',";
$sql.= " '".$alwayseditable."',"; $sql.= " '".$alwayseditable."',";
$sql.= " '".$param."'"; $sql.= " '".$param."'";
$sql.= " ".$list;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::update_label", LOG_DEBUG); dol_syslog(get_class($this)."::update_label", LOG_DEBUG);
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
@ -552,7 +574,7 @@ class ExtraFields
// For avoid conflicts with external modules // For avoid conflicts with external modules
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label; if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms"; $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,list";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
$sql.= " WHERE entity IN (0,".$conf->entity.")"; $sql.= " WHERE entity IN (0,".$conf->entity.")";
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'";
@ -582,6 +604,7 @@ class ExtraFields
$this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_pos[$tab->name]=$tab->pos;
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
$this->attribute_perms[$tab->name]=$tab->perms; $this->attribute_perms[$tab->name]=$tab->perms;
$this->attribute_list[$tab->name]=$tab->list;
} }
} }
} }
@ -615,6 +638,8 @@ class ExtraFields
$required=$this->attribute_required[$key]; $required=$this->attribute_required[$key];
$param=$this->attribute_param[$key]; $param=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key]; $perms=$this->attribute_perms[$key];
$list=$this->attribute_list[$key];
if ($type == 'date') if ($type == 'date')
{ {
$showsize=10; $showsize=10;
@ -1026,6 +1051,19 @@ class ExtraFields
} }
$out .= '</select>'; $out .= '</select>';
} }
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($param['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
}
/* Add comments /* Add comments
if ($type == 'date') $out.=' (YYYY-MM-DD)'; if ($type == 'date') $out.=' (YYYY-MM-DD)';
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
@ -1053,6 +1091,8 @@ class ExtraFields
$required=$this->attribute_required[$key]; $required=$this->attribute_required[$key];
$params=$this->attribute_param[$key]; $params=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key]; $perms=$this->attribute_perms[$key];
$list=$this->attribute_list[$key];
if ($type == 'date') if ($type == 'date')
{ {
$showsize=10; $showsize=10;
@ -1249,6 +1289,21 @@ class ExtraFields
} else } else
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING); dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
} }
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($params['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
if ($value)
{
$object->fetch($value);
$value=$object->getNomUrl(3);
}
}
else else
{ {
$showsize=round($size); $showsize=round($size);

View File

@ -128,10 +128,8 @@ class HookManager
$parameters['context']=join(':',$this->contextarray); $parameters['context']=join(':',$this->contextarray);
dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated).
$hooktype='output'; $hooktype='output';
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
if ($method =='insertExtraFields') $hooktype='returnvalue';
if (in_array( if (in_array(
$method, $method,
array( array(
@ -149,6 +147,13 @@ class HookManager
'formatEvent' 'formatEvent'
) )
)) $hooktype='addreplace'; )) $hooktype='addreplace';
// Deprecated hook types
if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
if ($method == 'insertExtraFields')
{
$hooktype='returnvalue'; // deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
}
// Loop on each hook to qualify modules that have declared context // Loop on each hook to qualify modules that have declared context
$modulealreadyexecuted=array(); $modulealreadyexecuted=array();
@ -201,8 +206,6 @@ class HookManager
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
// TODO dead code to remove (do not enable this, but fix hook instead)
//if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
// TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string. we must use $actionclassinstance->resprints to return a string // TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string. we must use $actionclassinstance->resprints to return a string
if (! is_array($result) && ! is_numeric($result)) if (! is_array($result) && ! is_numeric($result))
{ {
@ -221,8 +224,8 @@ class HookManager
} }
// TODO remove this. When there is something to print for an output hook, ->resPrint is filled. // TODO remove this. When there is something to print for an output hook, ->resPrint is filled.
if ($hooktype == 'output') return $this->resPrint; //if ($hooktype == 'output') return $this->resPrint;
if ($hooktype == 'returnvalue') return $result; //if ($hooktype == 'returnvalue') return $result;
return ($error?-1:$resaction); return ($error?-1:$resaction);
} }

View File

@ -275,6 +275,7 @@ abstract class DoliDB implements Database
*/ */
function jdate($string, $gm=false) function jdate($string, $gm=false)
{ {
if ($string==0 || $string=="0000-00-00 00:00:00") return '';
$string=preg_replace('/([^0-9])/i','',$string); $string=preg_replace('/([^0-9])/i','',$string);
$tmp=$string.'000000'; $tmp=$string.'000000';
$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm);

View File

@ -50,6 +50,7 @@ class DoliDBSqlite extends DoliDB
* @param string $pass Mot de passe * @param string $pass Mot de passe
* @param string $name Nom de la database * @param string $name Nom de la database
* @param int $port Port of database server * @param int $port Port of database server
* @return int 1 if OK, 0 if not
*/ */
function __construct($type, $host, $user, $pass, $name='', $port=0) function __construct($type, $host, $user, $pass, $name='', $port=0)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -95,6 +95,7 @@ function getServerTimeZoneInt($refgmtdate='now')
} }
else else
{ {
$tmp=0;
dol_print_error('','PHP version must be 5.3+'); dol_print_error('','PHP version must be 5.3+');
/* /*
// Method 2 (does not include daylight, not supported by adodb) // Method 2 (does not include daylight, not supported by adodb)

View File

@ -4542,7 +4542,7 @@ function utf8_check($str)
/** /**
* Return an UTF-8 string encoded into OS filesystem encoding. This function is used to define * Return a string encoded into OS filesystem encoding. This function is used to define
* value to pass to filesystem PHP functions. * value to pass to filesystem PHP functions.
* *
* @param string $str String to encode (UTF-8) * @param string $str String to encode (UTF-8)

View File

@ -39,166 +39,166 @@ abstract class DolibarrModules
*/ */
public $db; public $db;
/** /**
* @var string Relative path to module style sheet * @var string Relative path to module style sheet
* @deprecated * @deprecated
*/ */
public $style_sheet = ''; public $style_sheet = '';
/** /**
* @var array Paths to create when module is activated * @var array Paths to create when module is activated
*/ */
public $dirs = array(); public $dirs = array();
/** /**
* @var array Module boxes * @var array Module boxes
*/ */
public $boxes = array(); public $boxes = array();
/** /**
* @var array Module constants * @var array Module constants
*/ */
public $const = array(); public $const = array();
/** /**
* @var array Module access rights * @var array Module access rights
*/ */
public $rights; public $rights;
/** /**
* @var string Module access rights family * @var string Module access rights family
*/ */
public $rights_class; public $rights_class;
/** /**
* @var array Module menu entries * @var array Module menu entries
*/ */
public $menu = array(); public $menu = array();
/** /**
* @var array Module parts * @var array Module parts
* array( * array(
* // Set this to 1 if module has its own trigger directory (/mymodule/core/triggers) * // Set this to 1 if module has its own trigger directory (/mymodule/core/triggers)
* 'triggers' => 0, * 'triggers' => 0,
* // Set this to 1 if module has its own login method directory (/mymodule/core/login) * // Set this to 1 if module has its own login method directory (/mymodule/core/login)
* 'login' => 0, * 'login' => 0,
* // Set this to 1 if module has its own substitution function file (/mymodule/core/substitutions) * // Set this to 1 if module has its own substitution function file (/mymodule/core/substitutions)
* 'substitutions' => 0, * 'substitutions' => 0,
* // Set this to 1 if module has its own menus handler directory (/mymodule/core/menus) * // Set this to 1 if module has its own menus handler directory (/mymodule/core/menus)
* 'menus' => 0, * 'menus' => 0,
* // Set this to 1 if module has its own theme directory (/mymodule/theme) * // Set this to 1 if module has its own theme directory (/mymodule/theme)
* 'theme' => 0, * 'theme' => 0,
* // Set this to 1 if module overwrite template dir (/mymodule/core/tpl) * // Set this to 1 if module overwrite template dir (/mymodule/core/tpl)
* 'tpl' => 0, * 'tpl' => 0,
* // Set this to 1 if module has its own barcode directory (/mymodule/core/modules/barcode) * // Set this to 1 if module has its own barcode directory (/mymodule/core/modules/barcode)
* 'barcode' => 0, * 'barcode' => 0,
* // Set this to 1 if module has its own models directory (/mymodule/core/modules/xxx) * // Set this to 1 if module has its own models directory (/mymodule/core/modules/xxx)
* 'models' => 0, * 'models' => 0,
* // Set this to relative path of css file if module has its own css file * // Set this to relative path of css file if module has its own css file
* 'css' => '/mymodule/css/mymodule.css.php', * 'css' => '/mymodule/css/mymodule.css.php',
* // Set this to relative path of js file if module must load a js on all pages * // Set this to relative path of js file if module must load a js on all pages
* 'js' => '/mymodule/js/mymodule.js', * 'js' => '/mymodule/js/mymodule.js',
* // Set here all hooks context managed by module * // Set here all hooks context managed by module
* 'hooks' => array('hookcontext1','hookcontext2'), * 'hooks' => array('hookcontext1','hookcontext2'),
* // Set here all workflow context managed by module * // Set here all workflow context managed by module
* 'workflow' => array( * 'workflow' => array(
* 'WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2' = >array( * 'WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2' = >array(
* 'enabled' => '! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', * 'enabled' => '! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)',
* 'picto'=>'yourpicto@mymodule' * 'picto'=>'yourpicto@mymodule'
* ) * )
* ) * )
* ) * )
*/ */
public $module_parts = array(); public $module_parts = array();
/** /**
* @var string Module documents ? * @var string Module documents ?
* @deprecated Seems unused anywhere * @deprecated Seems unused anywhere
*/ */
public $docs; public $docs;
/** /**
* @var string ? * @var string ?
* @deprecated Seems unused anywhere * @deprecated Seems unused anywhere
*/ */
public $dbversion = "-"; public $dbversion = "-";
/** /**
* @var string Error message * @var string Error message
*/ */
public $error; public $error;
/** /**
* @var int Module unique ID * @var int Module unique ID
*/ */
public $numero; public $numero;
/** /**
* @var string Module name * @var string Module name
*/ */
public $name; public $name;
/** /**
* @var string Module version * @var string Module version
*/ */
public $version; public $version;
/** /**
* @var string Module description * @var string Module description
*/ */
public $description; public $description;
/** /**
* @var string[] Module language files * @var string[] Module language files
*/ */
public $langfiles; public $langfiles;
/** /**
* @var string Module export code * @var string Module export code
*/ */
public $export_code; public $export_code;
/** /**
* @var string Module export label * @var string Module export label
*/ */
public $export_label; public $export_label;
/** /**
* @var string Module import code * @var string Module import code
*/ */
public $import_code; public $import_code;
/** /**
* @var string Module import label * @var string Module import label
*/ */
public $import_label; public $import_label;
/** /**
* @var string Module constant name * @var string Module constant name
*/ */
public $const_name; public $const_name;
/** /**
* @var bool Module can't be disabled * @var bool Module can't be disabled
*/ */
public $always_enabled; public $always_enabled;
/** /**
* @var bool Module is enabled globally (Multicompany support) * @var bool Module is enabled globally (Multicompany support)
*/ */
public $core_enabled; public $core_enabled;
/** /**
* Enables a module. * Enables a module.
* Inserts all informations into database * Inserts all informations into database
* *
* @param array $array_sql SQL requests to be executed when enabling module * @param array $array_sql SQL requests to be executed when enabling module
* @param string $options String with options when disabling module: * @param string $options String with options when disabling module:
* 'noboxes' = Do not insert boxes * 'noboxes' = Do not insert boxes
* 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation * 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation
* *
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */
function _init($array_sql, $options='') function _init($array_sql, $options='')
{ {
global $conf; global $conf;
@ -232,12 +232,12 @@ abstract class DolibarrModules
// Execute addons requests // Execute addons requests
$num=count($array_sql); $num=count($array_sql);
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
if (! $err) if (! $err)
{ {
$val=$array_sql[$i]; $val=$array_sql[$i];
$sql=$val; $sql=$val;
$ignoreerror=0; $ignoreerror=0;
if (is_array($val)) if (is_array($val))
{ {
@ -367,12 +367,12 @@ abstract class DolibarrModules
// If module name translation using it's unique id does not exists, we take use its name to find translation // If module name translation using it's unique id does not exists, we take use its name to find translation
if (is_array($this->langfiles)) if (is_array($this->langfiles))
{ {
foreach($this->langfiles as $val) foreach($this->langfiles as $val)
{ {
if ($val) $langs->load($val); if ($val) $langs->load($val);
} }
} }
return $langs->trans($this->name); return $langs->trans($this->name);
} }
} }
@ -389,20 +389,20 @@ abstract class DolibarrModules
if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc")) if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc"))
{ {
// If module description translation exists // If module description translation exists
return $langs->trans("Module".$this->numero."Desc"); return $langs->trans("Module".$this->numero."Desc");
} }
else else
{ {
// If module description translation using it's unique id does not exists, we take use its name to find translation // If module description translation using it's unique id does not exists, we take use its name to find translation
if (is_array($this->langfiles)) if (is_array($this->langfiles))
{ {
foreach($this->langfiles as $val) foreach($this->langfiles as $val)
{ {
if ($val) $langs->load($val); if ($val) $langs->load($val);
} }
} }
return $langs->trans($this->description); return $langs->trans($this->description);
} }
} }
@ -429,7 +429,7 @@ abstract class DolibarrModules
else $ret=$langs->trans("VersionUnknown"); else $ret=$langs->trans("VersionUnknown");
if (preg_match('/_deprecated/',$this->version)) $ret.=' ('.$langs->trans("Deprecated").')'; if (preg_match('/_deprecated/',$this->version)) $ret.=' ('.$langs->trans("Deprecated").')';
return $ret; return $ret;
} }
@ -582,9 +582,9 @@ abstract class DolibarrModules
global $conf; global $conf;
$error=0; $error=0;
$dirfound=0; $dirfound=0;
if (empty($reldir)) return 1; if (empty($reldir)) return 1;
include_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
@ -599,10 +599,10 @@ abstract class DolibarrModules
$handle=@opendir($dir); // Dir may not exists $handle=@opendir($dir); // Dir may not exists
if (is_resource($handle)) if (is_resource($handle))
{ {
$dirfound++; $dirfound++;
// Run llx_mytable.sql files // Run llx_mytable.sql files
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
@ -613,8 +613,8 @@ abstract class DolibarrModules
rewinddir($handle); rewinddir($handle);
// Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql)
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
@ -626,7 +626,7 @@ abstract class DolibarrModules
rewinddir($handle); rewinddir($handle);
// Run data_xxx.sql files (Must be done after llx_mytable.key.sql) // Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{ {
@ -638,7 +638,7 @@ abstract class DolibarrModules
rewinddir($handle); rewinddir($handle);
// Run update_xxx.sql files // Run update_xxx.sql files
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
{ {
@ -671,9 +671,9 @@ abstract class DolibarrModules
*/ */
function insert_boxes($option='') function insert_boxes($option='')
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
global $conf; global $conf;
$err=0; $err=0;
@ -681,8 +681,8 @@ abstract class DolibarrModules
{ {
$pos_name = InfoBox::getListOfPagesForBoxes(); $pos_name = InfoBox::getListOfPagesForBoxes();
foreach ($this->boxes as $key => $value) foreach ($this->boxes as $key => $value)
{ {
$file = isset($this->boxes[$key]['file'])?$this->boxes[$key]['file']:''; $file = isset($this->boxes[$key]['file'])?$this->boxes[$key]['file']:'';
$note = isset($this->boxes[$key]['note'])?$this->boxes[$key]['note']:''; $note = isset($this->boxes[$key]['note'])?$this->boxes[$key]['note']:'';
$enabledbydefaulton = isset($this->boxes[$key]['enabledbydefaulton'])?$this->boxes[$key]['enabledbydefaulton']:'Home'; $enabledbydefaulton = isset($this->boxes[$key]['enabledbydefaulton'])?$this->boxes[$key]['enabledbydefaulton']:'Home';
@ -724,15 +724,15 @@ abstract class DolibarrModules
foreach ($pos_name as $key2 => $val2) foreach ($pos_name as $key2 => $val2)
{ {
//print 'key2='.$key2.'-val2='.$val2."<br>\n"; //print 'key2='.$key2.'-val2='.$val2."<br>\n";
if ($enabledbydefaulton && $val2 != $enabledbydefaulton) continue; // Not enabled by default onto this page. if ($enabledbydefaulton && $val2 != $enabledbydefaulton) continue; // Not enabled by default onto this page.
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)";
$sql.= " VALUES (".$lastid.", ".$key2.", '0', 0, ".$conf->entity.")"; $sql.= " VALUES (".$lastid.", ".$key2.", '0', 0, ".$conf->entity.")";
dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2."", LOG_DEBUG); dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2."", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) $err++; if (! $resql) $err++;
} }
} }
@ -741,7 +741,7 @@ abstract class DolibarrModules
$this->db->commit(); $this->db->commit();
} }
else else
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
} }
@ -781,11 +781,22 @@ abstract class DolibarrModules
if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; if ($this->db->type == 'sqlite3') {
$sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def"; // sqlite doesn't support "USING" syntax.
$sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid"; // TODO: remove this dependency.
$sql.= " AND ".MAIN_DB_PREFIX."boxes_def.file = '".$this->db->escape($file)."'"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes ";
$sql.= " AND ".MAIN_DB_PREFIX."boxes.entity = ".$conf->entity; $sql .= "WHERE ".MAIN_DB_PREFIX."boxes.box_id IN (";
$sql .= "SELECT ".MAIN_DB_PREFIX."boxes_def.rowid ";
$sql .= "FROM ".MAIN_DB_PREFIX."boxes_def ";
$sql .= "WHERE ".MAIN_DB_PREFIX."boxes_def.file = '".$this->db->escape($file)."') ";
$sql .= "AND ".MAIN_DB_PREFIX."boxes.entity = ".$conf->entity;
} else {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes";
$sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def";
$sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid";
$sql.= " AND ".MAIN_DB_PREFIX."boxes_def.file = '".$this->db->escape($file)."'";
$sql.= " AND ".MAIN_DB_PREFIX."boxes.entity = ".$conf->entity;
}
dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -1012,7 +1023,7 @@ abstract class DolibarrModules
if ($resql) if ($resql)
{ {
$obj=$this->db->fetch_object($resql); $obj=$this->db->fetch_object($resql);
if (! empty($obj->value) && ! empty($this->rights)) if ($obj !== null && ! empty($obj->value) && ! empty($this->rights))
{ {
// Si module actif // Si module actif
foreach ($this->rights as $key => $value) foreach ($this->rights as $key => $value)
@ -1027,54 +1038,54 @@ abstract class DolibarrModules
if (empty($r_type)) $r_type='w'; if (empty($r_type)) $r_type='w';
// Search if perm already present // Search if perm already present
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def"; $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def";
$sql.= " WHERE id = ".$r_id." AND entity = ".$entity; $sql.= " WHERE id = ".$r_id." AND entity = ".$entity;
$resqlselect=$this->db->query($sql); $resqlselect=$this->db->query($sql);
$obj = $this->db->fetch_object($resqlselect); $obj = $this->db->fetch_object($resqlselect);
if ($obj->nb == 0) if ($obj->nb == 0)
{ {
if (dol_strlen($r_perms) ) if (dol_strlen($r_perms) )
{ {
if (dol_strlen($r_subperms) ) if (dol_strlen($r_subperms) )
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def";
$sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)"; $sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)";
$sql.= " VALUES "; $sql.= " VALUES ";
$sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')"; $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')";
} }
else else
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def";
$sql.= " (id, entity, libelle, module, type, bydefault, perms)"; $sql.= " (id, entity, libelle, module, type, bydefault, perms)";
$sql.= " VALUES "; $sql.= " VALUES ";
$sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')"; $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')";
} }
} }
else else
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def ";
$sql .= " (id, entity, libelle, module, type, bydefault)"; $sql .= " (id, entity, libelle, module, type, bydefault)";
$sql .= " VALUES "; $sql .= " VALUES ";
$sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")"; $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")";
} }
$resqlinsert=$this->db->query($sql,1); $resqlinsert=$this->db->query($sql,1);
if (! $resqlinsert) if (! $resqlinsert)
{ {
if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS") if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS")
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$err++; $err++;
break; break;
} }
else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO);
} }
$this->db->free($resqlinsert); $this->db->free($resqlinsert);
} }
$this->db->free($resqlselect); $this->db->free($resqlselect);
@ -1082,9 +1093,9 @@ abstract class DolibarrModules
// If we want to init permissions on admin users // If we want to init permissions on admin users
if ($reinitadminperms) if ($reinitadminperms)
{ {
if (! class_exists('User')) { if (! class_exists('User')) {
require DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; require DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
} }
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 1"; $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 1";
dol_syslog(get_class($this)."::insert_permissions Search all admin users", LOG_DEBUG); dol_syslog(get_class($this)."::insert_permissions Search all admin users", LOG_DEBUG);
$resqlseladmin=$this->db->query($sql,1); $resqlseladmin=$this->db->query($sql,1);
@ -1099,7 +1110,7 @@ abstract class DolibarrModules
$tmpuser=new User($this->db); $tmpuser=new User($this->db);
$tmpuser->fetch($obj2->rowid); $tmpuser->fetch($obj2->rowid);
if (!empty($tmpuser->id)) { if (!empty($tmpuser->id)) {
$tmpuser->addrights($r_id); $tmpuser->addrights($r_id);
} }
$i++; $i++;
} }
@ -1158,7 +1169,7 @@ abstract class DolibarrModules
*/ */
function insert_menus() function insert_menus()
{ {
global $user; global $user;
require_once DOL_DOCUMENT_ROOT . '/core/class/menubase.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/menubase.class.php';
@ -1415,68 +1426,68 @@ abstract class DolibarrModules
*/ */
function insert_module_parts() function insert_module_parts()
{ {
global $conf; global $conf;
$error=0; $error=0;
$entity=$conf->entity; $entity=$conf->entity;
if (is_array($this->module_parts) && ! empty($this->module_parts)) if (is_array($this->module_parts) && ! empty($this->module_parts))
{ {
foreach($this->module_parts as $key => $value) foreach($this->module_parts as $key => $value)
{ {
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
$newvalue = $value; $newvalue = $value;
// Serialize array parameters // Serialize array parameters
if (is_array($value)) if (is_array($value))
{ {
// Can defined other parameters // Can defined other parameters
if (is_array($value['data']) && ! empty($value['data'])) if (is_array($value['data']) && ! empty($value['data']))
{ {
$newvalue = json_encode($value['data']); $newvalue = json_encode($value['data']);
if (isset($value['entity'])) $entity = $value['entity']; if (isset($value['entity'])) $entity = $value['entity'];
} }
else else
{ {
$newvalue = json_encode($value); $newvalue = json_encode($value);
} }
} }
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
$sql.= "name"; $sql.= "name";
$sql.= ", type"; $sql.= ", type";
$sql.= ", value"; $sql.= ", value";
$sql.= ", note"; $sql.= ", note";
$sql.= ", visible"; $sql.= ", visible";
$sql.= ", entity"; $sql.= ", entity";
$sql.= ")"; $sql.= ")";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= $this->db->encrypt($this->const_name."_".strtoupper($key), 1); $sql.= $this->db->encrypt($this->const_name."_".strtoupper($key), 1);
$sql.= ", 'chaine'"; $sql.= ", 'chaine'";
$sql.= ", ".$this->db->encrypt($newvalue, 1); $sql.= ", ".$this->db->encrypt($newvalue, 1);
$sql.= ", null"; $sql.= ", null";
$sql.= ", '0'"; $sql.= ", '0'";
$sql.= ", ".$entity; $sql.= ", ".$entity;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::insert_const_".$key."", LOG_DEBUG); dol_syslog(get_class($this)."::insert_const_".$key."", LOG_DEBUG);
$resql=$this->db->query($sql,1); $resql=$this->db->query($sql,1);
if (! $resql) if (! $resql)
{ {
if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$error++; $error++;
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
} }
else else
{ {
dol_syslog(get_class($this)."::insert_const_".$key." Record already exists.", LOG_WARNING); dol_syslog(get_class($this)."::insert_const_".$key." Record already exists.", LOG_WARNING);
} }
} }
} }
} }
return $error; return $error;
} }
/** /**
@ -1486,31 +1497,31 @@ abstract class DolibarrModules
*/ */
function delete_module_parts() function delete_module_parts()
{ {
global $conf; global $conf;
$err=0; $err=0;
$entity=$conf->entity; $entity=$conf->entity;
if (is_array($this->module_parts) && ! empty($this->module_parts)) if (is_array($this->module_parts) && ! empty($this->module_parts))
{ {
foreach($this->module_parts as $key => $value) foreach($this->module_parts as $key => $value)
{ {
// If entity is defined // If entity is defined
if (is_array($value) && isset($value['entity'])) $entity = $value['entity']; if (is_array($value) && isset($value['entity'])) $entity = $value['entity'];
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'"; $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'";
$sql.= " AND entity = ".$entity; $sql.= " AND entity = ".$entity;
dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG); dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG);
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$err++; $err++;
} }
} }
} }
return $err; return $err;
} }
} }

View File

@ -508,7 +508,7 @@ class pdf_standard extends ModeleExpenseReport
*/ */
// Filligrane brouillon // Filligrane brouillon
if ($object->fk_c_expensereport_statuts==1 && ! empty($conf->global->EXPENSEREPORT_FREE_TEXT)) if ($object->fk_statut==1 && ! empty($conf->global->EXPENSEREPORT_FREE_TEXT))
{ {
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->EXPENSEREPORT_FREE_TEXT); pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->EXPENSEREPORT_FREE_TEXT);
} }
@ -640,7 +640,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DateCreation")." : ".dol_print_date($object->date_create,"day",false,$outpulangs),0,'L'); $pdf->MultiCell(96,4,$outputlangs->transnoentities("DateCreation")." : ".dol_print_date($object->date_create,"day",false,$outpulangs),0,'L');
} }
if ($object->fk_c_expensereport_statuts==99) if ($object->fk_statut==99)
{ {
if ($object->fk_user_refuse > 0) if ($object->fk_user_refuse > 0)
{ {
@ -656,7 +656,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_REFUS")." : ".dol_print_date($object->date_refuse,"day",false,$outpulangs),0,'L'); $pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_REFUS")." : ".dol_print_date($object->date_refuse,"day",false,$outpulangs),0,'L');
} }
} }
else if($object->fk_c_expensereport_statuts==4) else if($object->fk_statut==4)
{ {
if ($object->fk_user_cancel > 0) if ($object->fk_user_cancel > 0)
{ {
@ -686,7 +686,7 @@ class pdf_standard extends ModeleExpenseReport
} }
} }
if($object->fk_c_expensereport_statuts==6) if($object->fk_statut==6)
{ {
if ($object->fk_user_paid > 0) if ($object->fk_user_paid > 0)
{ {

View File

@ -84,7 +84,7 @@ class modExpenseReport extends DolibarrModules
// Dependencies // Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->depends = array(); // List of modules id that must be enabled if this module is enabled
$this->conflictwith = array("modDeplacement"); // $this->conflictwith = array("modDeplacement"); // Deactivate for access on old information
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(4,3); // Minimum version of PHP required by module $this->phpmin = array(4,3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,7); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3,7); // Minimum version of Dolibarr required by module
@ -270,7 +270,7 @@ class modExpenseReport extends DolibarrModules
'titre'=>'ListToApprove', 'titre'=>'ListToApprove',
'mainmenu'=>'hrm', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detaillist_approve', 'leftmenu'=>'expensereport_detaillist_approve',
'url'=>'/expensereport/list.php?search_state=2', 'url'=>'/expensereport/list.php?search_status=2',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.

View File

@ -48,6 +48,7 @@
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'link') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();} else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();}
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}

View File

@ -68,7 +68,7 @@ if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_ar
} }
} }
} }
elseif (($type== 'sellist') || ($type == 'chkbxlst')) elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') )
{ {
$paramlist=array_keys($param['options']); $paramlist=array_keys($param['options']);
$param_chain = $paramlist[0]; $param_chain = $paramlist[0];

View File

@ -65,7 +65,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>'; print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '<td colspan="5">'; print '<td colspan="'.$cols.'">';
// Convert date into timestamp format // Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) { if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) {

View File

@ -194,7 +194,9 @@ else {
$nbrows=ROWS_2; $nbrows=ROWS_2;
$enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,'98%'); $toolbarname='dolibarr_details';
if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes';
$doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%');
$doleditor->Create(); $doleditor->Create();
?> ?>
</td> </td>

View File

@ -86,13 +86,16 @@ $coldisplay=-1; // We remove first td
} }
// Do not allow editing during a situation cycle // Do not allow editing during a situation cycle
if ($this->situation_counter == 1 || !$this->situation_cycle_ref) { if (empty($this->situation_cycle_ref) || $this->situation_counter == 1)
{
// editeur wysiwyg // editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$nbrows=ROWS_2; $nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
$doleditor=new DolEditor('product_desc',$line->description,'',164,'dolibarr_details','',false,true,$enable,$nbrows,'98%'); $toolbarname='dolibarr_details';
if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes';
$doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%');
$doleditor->Create(); $doleditor->Create();
} else { } else {
print '<textarea id="desc" class="flat" name="desc" readonly="readonly" style="width: 200px; height:80px;">' . $line->description . '</textarea>'; print '<textarea id="desc" class="flat" name="desc" readonly="readonly" style="width: 200px; height:80px;">' . $line->description . '</textarea>';

View File

@ -52,7 +52,7 @@ if (empty($usemargins)) $usemargins=0;
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> <td align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php } ?> <?php } ?>
<td><?php $coldisplay++; ?><div id="row-<?php echo $line->id; ?>"></div> <td><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
<?php if (($line->info_bits & 2) == 2) { ?> <?php if (($line->info_bits & 2) == 2) { ?>
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
<?php <?php
@ -183,7 +183,7 @@ if (empty($usemargins)) $usemargins=0;
<td align="center"><?php $coldisplay++; ?> <td align="center"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) == 2) { ?> <?php if (($line->info_bits & 2) == 2) { ?>
<?php } else { ?> <?php } else { ?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>"> <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
<?php echo img_edit(); ?> <?php echo img_edit(); ?>
</a> </a>
<?php } ?> <?php } ?>

View File

View File

@ -109,7 +109,7 @@ if ($action == 'add' && $user->rights->expensereport->creer)
$object->date_debut = $date_start; $object->date_debut = $date_start;
$object->date_fin = $date_end; $object->date_fin = $date_end;
$object->fk_c_expensereport_statuts = 1; $object->fk_statut = 1;
$object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_c_paiement = GETPOST('fk_c_paiement','int');
$object->fk_user_validator = GETPOST('fk_user_validator','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int');
$object->note_public = GETPOST('note_public'); $object->note_public = GETPOST('note_public');
@ -151,7 +151,7 @@ if ($action == 'update' && $user->rights->expensereport->creer)
$object->date_debut = $date_start; $object->date_debut = $date_start;
$object->date_fin = $date_end; $object->date_fin = $date_end;
if($object->fk_c_expensereport_statuts < 3) if($object->fk_statut < 3)
{ {
$object->fk_user_validator = GETPOST('fk_user_validator','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int');
} }
@ -733,12 +733,12 @@ if ($action == "confirm_paid" && GETPOST('confirm')=="yes" && $id > 0 && $user->
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); $insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
if ($insertid > 0): if ($insertid > 0):
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport d"; $sql = " UPDATE ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " SET integration_compta = 1, fk_bank_account = $idAccount"; $sql.= " SET integration_compta = 1, fk_bank_account = $idAccount";
$sql.= " WHERE rowid = $idTrip"; $sql.= " WHERE rowid = $idTrip";
$resql=$db->query($sql); $resql=$db->query($sql);
if($result): if($result):
Header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit; exit;
else: else:
dol_print_error($db); dol_print_error($db);
@ -1197,7 +1197,7 @@ else
$head = expensereport_prepare_head($object); $head = expensereport_prepare_head($object);
if ($action == 'edit' && ($object->fk_c_expensereport_statuts < 3 || $object->fk_c_expensereport_statuts==99)) if ($action == 'edit' && ($object->fk_statut < 3 || $object->fk_statut==99))
{ {
print "<form name='update' action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n"; print "<form name='update' action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -1205,7 +1205,7 @@ else
dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
if($object->fk_c_expensereport_statuts==99) if($object->fk_statut==99)
{ {
print '<input type="hidden" name="action" value="updateFromRefuse">'; print '<input type="hidden" name="action" value="updateFromRefuse">';
} }
@ -1246,7 +1246,7 @@ else
print '</tr>'; print '</tr>';
} }
if($object->fk_c_expensereport_statuts<3) if($object->fk_statut<3)
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("VALIDATOR").'</td>'; // Approbator print '<td>'.$langs->trans("VALIDATOR").'</td>'; // Approbator
@ -1275,7 +1275,7 @@ else
$userfee->fetch($object->fk_user_author); $userfee->fetch($object->fk_user_author);
print $userfee->getNomUrl(1); print $userfee->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
if ($object->fk_c_expensereport_statuts==6) if ($object->fk_statut==6)
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>'; print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
@ -1437,7 +1437,7 @@ else
print '<td>'.$langs->trans("DATE_SAVE").'</td>'; print '<td>'.$langs->trans("DATE_SAVE").'</td>';
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td></tr>'; print '<td>'.dol_print_date($object->date_create,'dayhour').'</td></tr>';
print '</tr>'; print '</tr>';
if($object->fk_c_expensereport_statuts==6) if($object->fk_statut==6)
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>'; print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
@ -1452,7 +1452,7 @@ else
print '</tr>'; print '</tr>';
} }
if($object->fk_c_expensereport_statuts<3) // informed if($object->fk_statut<3) // informed
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("VALIDATOR").'</td>'; print '<td>'.$langs->trans("VALIDATOR").'</td>';
@ -1465,7 +1465,7 @@ else
} }
print '</td></tr>'; print '</td></tr>';
} }
elseif($object->fk_c_expensereport_statuts==4) elseif($object->fk_statut==4)
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("CANCEL_USER").'</span></td>'; print '<td>'.$langs->trans("CANCEL_USER").'</span></td>';
@ -1504,7 +1504,7 @@ else
print '</tr>'; print '</tr>';
} }
if($object->fk_c_expensereport_statuts==99 || !empty($object->detail_refuse)) if($object->fk_statut==99 || !empty($object->detail_refuse))
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("REFUSEUR").'</td>'; print '<td>'.$langs->trans("REFUSEUR").'</td>';
@ -1529,9 +1529,9 @@ else
$sql.= ' fde.fk_c_tva as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.fk_c_tva as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' WHERE fde.fk_expensereport = '.$id; $sql.= ' WHERE fde.fk_expensereport = '.$id;
$resql = $db->query($sql); $resql = $db->query($sql);
@ -1566,7 +1566,7 @@ else
print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>'; print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>';
} }
// Ajout des boutons de modification/suppression // Ajout des boutons de modification/suppression
if ($object->fk_c_expensereport_statuts < 2 || $object->fk_c_expensereport_statuts==99) if ($object->fk_statut < 2 || $object->fk_statut==99)
{ {
print '<td style="text-align:right;"></td>'; print '<td style="text-align:right;"></td>';
} }
@ -1609,7 +1609,7 @@ else
} }
// Ajout des boutons de modification/suppression // Ajout des boutons de modification/suppression
if($object->fk_c_expensereport_statuts<2 OR $object->fk_c_expensereport_statuts==99) if($object->fk_statut<2 OR $object->fk_statut==99)
{ {
print '<td style="text-align:right;" class="nowrap">'; print '<td style="text-align:right;" class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;rowid='.$objp->rowid.'#'.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;rowid='.$objp->rowid.'#'.$objp->rowid.'">';
@ -1689,7 +1689,7 @@ else
//print '</div>'; //print '</div>';
// Add a line // Add a line
if (($object->fk_c_expensereport_statuts==0 || $object->fk_c_expensereport_statuts==99) && $action != 'editline') if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline')
{ {
print_fiche_titre($langs->trans("AddLine"),'',''); print_fiche_titre($langs->trans("AddLine"),'','');
@ -1712,17 +1712,17 @@ else
print '<tr>'; print '<tr>';
// Sélection date // Select date
print '<td style="text-align:center;">'; print '<td style="text-align:center;">';
$form->select_date($date?$date:-1,'date'); $form->select_date($date?$date:-1,'date');
print '</td>'; print '</td>';
// Sélection projet // Select project
print '<td>'; print '<td>';
$formproject->select_projects(-1, GETPOST('fk_projet'), 'fk_projet', 0, 0, 1, 1); $formproject->select_projects(-1, GETPOST('fk_projet'), 'fk_projet', 0, 0, 1, 1);
print '</td>'; print '</td>';
// Sélection type // Select type
print '<td>'; print '<td>';
select_type_fees_id(GETPOST('fk_c_type_fees'),'fk_c_type_fees',1); select_type_fees_id(GETPOST('fk_c_type_fees'),'fk_c_type_fees',1);
print '</td>'; print '</td>';
@ -1732,7 +1732,7 @@ else
print '<textarea class="flat_ndf centpercent" name="comments">'.GETPOST('comments').'</textarea>'; print '<textarea class="flat_ndf centpercent" name="comments">'.GETPOST('comments').'</textarea>';
print '</td>'; print '</td>';
// Sélection TVA // Select VAT
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
$defaultvat=-1; $defaultvat=-1;
if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
@ -1747,7 +1747,7 @@ else
print '<input type="text" size="6" name="value_unit" value="'.GETPOST('value_unit').'">'; print '<input type="text" size="6" name="value_unit" value="'.GETPOST('value_unit').'">';
print '</td>'; print '</td>';
// Quantité // Quantity
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print '<input type="text" size="4" name="qty" value="'.GETPOST('qty').'">'; print '<input type="text" size="4" name="qty" value="'.GETPOST('qty').'">';
print '</td>'; print '</td>';
@ -1799,7 +1799,7 @@ if ($action != 'create' && $action != 'edit')
* ET fk_user_author == user courant * ET fk_user_author == user courant
* Afficher : "Enregistrer" / "Modifier" / "Supprimer" * Afficher : "Enregistrer" / "Modifier" / "Supprimer"
*/ */
if ($user->rights->expensereport->creer && $object->fk_c_expensereport_statuts==0) if ($user->rights->expensereport->creer && $object->fk_statut==0)
{ {
if ($object->fk_user_author == $user->id) if ($object->fk_user_author == $user->id)
{ {
@ -1825,7 +1825,7 @@ if ($action != 'create' && $action != 'edit')
* ET fk_user_author == user courant * ET fk_user_author == user courant
* Afficher : "Enregistrer" / "Modifier" / "Supprimer" * Afficher : "Enregistrer" / "Modifier" / "Supprimer"
*/ */
if($user->rights->expensereport->creer && $object->fk_c_expensereport_statuts==99) if($user->rights->expensereport->creer && $object->fk_statut==99)
{ {
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
{ {
@ -1845,7 +1845,7 @@ if ($action != 'create' && $action != 'edit')
} }
} }
if ($user->rights->expensereport->to_paid && $object->fk_c_expensereport_statuts==5) if ($user->rights->expensereport->to_paid && $object->fk_statut==5)
{ {
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
{ {
@ -1859,7 +1859,7 @@ if ($action != 'create' && $action != 'edit')
* ET fk_user_validator == user courant * ET fk_user_validator == user courant
* Afficher : "Valider" / "Refuser" / "Supprimer" * Afficher : "Valider" / "Refuser" / "Supprimer"
*/ */
if ($object->fk_c_expensereport_statuts == 2) if ($object->fk_statut == 2)
{ {
if ($object->fk_user_author == $user->id) if ($object->fk_user_author == $user->id)
{ {
@ -1868,7 +1868,7 @@ if ($action != 'create' && $action != 'edit')
} }
} }
if ($user->rights->expensereport->approve && $object->fk_c_expensereport_statuts == 2) if ($user->rights->expensereport->approve && $object->fk_statut == 2)
{ {
//if($object->fk_user_validator==$user->id) //if($object->fk_user_validator==$user->id)
//{ //{
@ -1895,7 +1895,7 @@ if ($action != 'create' && $action != 'edit')
* ET user à droit de "to_paid" * ET user à droit de "to_paid"
* Afficher : "Annuler" / "Payer" / "Supprimer" * Afficher : "Annuler" / "Payer" / "Supprimer"
*/ */
if ($user->rights->expensereport->to_paid && $object->fk_c_expensereport_statuts == 5) if ($user->rights->expensereport->to_paid && $object->fk_statut == 5)
{ {
// Payer // Payer
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=paid&id='.$id.'">'.$langs->trans('TO_PAID').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=paid&id='.$id.'">'.$langs->trans('TO_PAID').'</a>';
@ -1918,7 +1918,7 @@ if ($action != 'create' && $action != 'edit')
* ET user à droit "to_paid" * ET user à droit "to_paid"
* Afficher : "Annuler" * Afficher : "Annuler"
*/ */
if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_c_expensereport_statuts==6) if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_statut==6)
{ {
// Annuler // Annuler
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>';
@ -1933,7 +1933,7 @@ if ($action != 'create' && $action != 'edit')
* ET user à droit "supprimer" * ET user à droit "supprimer"
* Afficher : "Supprimer" * Afficher : "Supprimer"
*/ */
if ($user->rights->expensereport->supprimer && $object->fk_c_expensereport_statuts==4) if ($user->rights->expensereport->supprimer && $object->fk_statut==4)
{ {
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
@ -1959,7 +1959,7 @@ print '<div style="width:50%">';
/* /*
* Documents generes * Documents generes
*/ */
if($user->rights->expensereport->export && $object->fk_c_expensereport_statuts>0 && $action != 'edit') if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'edit')
{ {
$filename = dol_sanitizeFileName($object->ref); $filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref); $filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);

View File

@ -1,5 +1,22 @@
<?php <?php
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); /* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2015 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 3 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/>.
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/** /**
* Class to manage Trips and Expenses * Class to manage Trips and Expenses
@ -26,7 +43,7 @@ class ExpenseReport extends CommonObject
var $fk_user_validator; var $fk_user_validator;
var $status; var $status;
var $fk_c_expensereport_statuts; // -- 1=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied var $fk_statut; // -- 1=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
var $fk_c_paiement; var $fk_c_paiement;
var $user_author_infos; var $user_author_infos;
@ -133,7 +150,7 @@ class ExpenseReport extends CommonObject
$sql.= ",date_create"; $sql.= ",date_create";
$sql.= ",fk_user_author"; $sql.= ",fk_user_author";
$sql.= ",fk_user_validator"; $sql.= ",fk_user_validator";
$sql.= ",fk_c_expensereport_statuts"; $sql.= ",fk_statut";
$sql.= ",fk_c_paiement"; $sql.= ",fk_c_paiement";
$sql.= ",note_public"; $sql.= ",note_public";
$sql.= ",note_private"; $sql.= ",note_private";
@ -147,7 +164,7 @@ class ExpenseReport extends CommonObject
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
$sql.= ", ".($user->id > 0 ? $user->id:"null"); $sql.= ", ".($user->id > 0 ? $user->id:"null");
$sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); $sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
$sql.= ", ".($this->fk_c_expensereport_statuts > 1 ? $this->fk_c_expensereport_statuts:0); $sql.= ", ".($this->fk_statut > 1 ? $this->fk_statut:0);
$sql.= ", ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null"); $sql.= ", ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); $sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
@ -231,7 +248,7 @@ class ExpenseReport extends CommonObject
$sql.= " , fk_user_validator = ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); $sql.= " , fk_user_validator = ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
$sql.= " , fk_user_valid = ".($this->fk_user_valid > 0 ? $this->fk_user_valid:"null"); $sql.= " , fk_user_valid = ".($this->fk_user_valid > 0 ? $this->fk_user_valid:"null");
$sql.= " , fk_user_paid = ".($this->fk_user_paid > 0 ? $this->fk_user_paid:"null"); $sql.= " , fk_user_paid = ".($this->fk_user_paid > 0 ? $this->fk_user_paid:"null");
$sql.= " , fk_c_expensereport_statuts = ".($this->fk_c_expensereport_statuts >= 0 ? $this->fk_c_expensereport_statuts:'0'); $sql.= " , fk_statut = ".($this->fk_statut >= 0 ? $this->fk_statut:'0');
$sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null"); $sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
$sql.= " , note_public = ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"''"); $sql.= " , note_public = ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"''");
$sql.= " , note_private = ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"''"); $sql.= " , note_private = ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"''");
@ -267,10 +284,10 @@ class ExpenseReport extends CommonObject
$sql.= " d.date_refuse, d.date_cancel,"; // ACTIONS $sql.= " d.date_refuse, d.date_cancel,"; // ACTIONS
$sql.= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int) $sql.= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
$sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valid, d.date_approve, d.date_paiement,"; // DATES (datetime) $sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valid, d.date_approve, d.date_paiement,"; // DATES (datetime)
$sql.= " d.fk_user_author, d.fk_user_validator, d.fk_c_expensereport_statuts as status, d.fk_c_paiement,"; $sql.= " d.fk_user_author, d.fk_user_validator, d.fk_statut as status, d.fk_c_paiement,";
$sql.= " d.fk_user_valid, d.fk_user_approve, d.fk_user_paid,"; $sql.= " d.fk_user_valid, d.fk_user_approve, d.fk_user_paid,";
$sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement $sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement dp ON d.fk_c_paiement = dp.id"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id";
if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'"; if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'";
else $sql.= " WHERE d.rowid = ".$id; else $sql.= " WHERE d.rowid = ".$id;
$sql.= $restrict; $sql.= $restrict;
@ -318,18 +335,18 @@ class ExpenseReport extends CommonObject
if ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator); if ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator);
$this->user_validator_infos = dolGetFirstLastname($user_approver->firstname, $user_approver->lastname); $this->user_validator_infos = dolGetFirstLastname($user_approver->firstname, $user_approver->lastname);
$this->fk_c_expensereport_statuts = $obj->status; $this->fk_statut = $obj->status;
$this->status = $obj->status; $this->status = $obj->status;
$this->fk_c_paiement = $obj->fk_c_paiement; $this->fk_c_paiement = $obj->fk_c_paiement;
if ($this->fk_c_expensereport_statuts==5 || $this->fk_c_expensereport_statuts==6) if ($this->fk_statut==5 || $this->fk_statut==6)
{ {
$user_valid = new User($this->db); $user_valid = new User($this->db);
if ($this->fk_user_valid > 0) $user_valid->fetch($this->fk_user_valid); if ($this->fk_user_valid > 0) $user_valid->fetch($this->fk_user_valid);
$this->user_valid_infos = dolGetFirstLastname($user_valid->firstname, $user_valid->lastname); $this->user_valid_infos = dolGetFirstLastname($user_valid->firstname, $user_valid->lastname);
} }
if ($this->fk_c_expensereport_statuts==6) if ($this->fk_statut==6)
{ {
$user_paid = new User($this->db); $user_paid = new User($this->db);
if ($this->fk_user_paid > 0) $user_paid->fetch($this->fk_user_paid); if ($this->fk_user_paid > 0) $user_paid->fetch($this->fk_user_paid);
@ -497,7 +514,7 @@ class ExpenseReport extends CommonObject
$this->date_approve = $now; $this->date_approve = $now;
$this->status = 5; $this->status = 5;
$this->fk_c_expensereport_statuts = 5; $this->fk_statut = 5;
$this->fk_user_author = $user->id; $this->fk_user_author = $user->id;
$this->fk_user_valid = $user->id; $this->fk_user_valid = $user->id;
@ -567,7 +584,7 @@ class ExpenseReport extends CommonObject
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$sql2 = "SELECT d.rowid, d.fk_user_author, d.ref, d.fk_c_expensereport_statuts"; $sql2 = "SELECT d.rowid, d.fk_user_author, d.ref, d.fk_statut";
$sql2.= " FROM ".MAIN_DB_PREFIX."expensereport as d"; $sql2.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
$sql2.= " WHERE d.rowid = '".$objp->fk_expensereport."'"; $sql2.= " WHERE d.rowid = '".$objp->fk_expensereport."'";
@ -576,7 +593,7 @@ class ExpenseReport extends CommonObject
$objp->fk_user_author = $obj->fk_user_author; $objp->fk_user_author = $obj->fk_user_author;
$objp->ref = $obj->ref; $objp->ref = $obj->ref;
$objp->fk_c_expensereport_status = $obj->fk_c_expensereport_statuts; $objp->fk_c_expensereport_status = $obj->fk_statut;
$objp->rowid = $obj->rowid; $objp->rowid = $obj->rowid;
$total_HT = $total_HT + $objp->total_ht; $total_HT = $total_HT + $objp->total_ht;
@ -707,8 +724,8 @@ class ExpenseReport extends CommonObject
$sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,';
$sql.= ' p.ref as ref_projet, p.title as title_projet'; $sql.= ' p.ref as ref_projet, p.title as title_projet';
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees ctf ON de.fk_c_type_fees = ctf.id'; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet p ON de.fk_projet = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid';
$sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id; $sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id;
dol_syslog('ExpenseReport::fetch_lines sql='.$sql, LOG_DEBUG); dol_syslog('ExpenseReport::fetch_lines sql='.$sql, LOG_DEBUG);
@ -831,10 +848,10 @@ class ExpenseReport extends CommonObject
$this->ref = strtoupper($user->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); $this->ref = strtoupper($user->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d');
} }
if ($this->fk_c_expensereport_statuts != 2) if ($this->fk_statut != 2)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 2, fk_user_valid = ".$user->id.","; $sql.= " SET ref = '".$this->ref."', fk_statut = 2, fk_user_valid = ".$user->id.",";
$sql.= " ref_number_int = ".$ref_number_int; $sql.= " ref_number_int = ".$ref_number_int;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
@ -877,10 +894,10 @@ class ExpenseReport extends CommonObject
$this->date_debut = $this->db->jdate($objp->date_debut); $this->date_debut = $this->db->jdate($objp->date_debut);
if ($this->fk_c_expensereport_statuts != 2) if ($this->fk_statut != 2)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 2"; $sql.= " SET fk_statut = 2";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
dol_syslog(get_class($this)."::set_save_from_refuse sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::set_save_from_refuse sql=".$sql, LOG_DEBUG);
@ -913,10 +930,10 @@ class ExpenseReport extends CommonObject
// date approval // date approval
$this->date_approve = $this->db->idate($now); $this->date_approve = $this->db->idate($now);
if ($this->fk_c_expensereport_statuts != 5) if ($this->fk_statut != 5)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 5, fk_user_approve = ".$user->id.","; $sql.= " SET ref = '".$this->ref."', fk_statut = 5, fk_user_approve = ".$user->id.",";
$sql.= " date_approve='".$this->date_approve."'"; $sql.= " date_approve='".$this->date_approve."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
@ -946,17 +963,17 @@ class ExpenseReport extends CommonObject
$now = dol_now(); $now = dol_now();
// date de refus // date de refus
if ($this->fk_c_expensereport_statuts != 99) if ($this->fk_statut != 99)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 99, fk_user_refuse = ".$user->id.","; $sql.= " SET ref = '".$this->ref."', fk_statut = 99, fk_user_refuse = ".$user->id.",";
$sql.= " date_refuse='".$this->db->idate($now)."',"; $sql.= " date_refuse='".$this->db->idate($now)."',";
$sql.= " detail_refuse='".$this->db->escape($details)."'"; $sql.= " detail_refuse='".$this->db->escape($details)."'";
$sql.= " fk_user_approve=NULL,"; $sql.= " fk_user_approve=NULL,";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->fk_c_expensereport_statuts = 99; $this->fk_statut = 99;
$this->fk_user_refuse = $user->id; $this->fk_user_refuse = $user->id;
$this->detail_refuse = $details; $this->detail_refuse = $details;
$this->date_refuse = $now; $this->date_refuse = $now;
@ -985,10 +1002,10 @@ class ExpenseReport extends CommonObject
$now= dol_now(); $now= dol_now();
$this->date_paiement = $this->db->idate($now); $this->date_paiement = $this->db->idate($now);
if ($this->fk_c_expensereport_statuts != 6) if ($this->fk_statut != 6)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 6, fk_user_paid = ".$user->id.","; $sql.= " SET fk_statut = 6, fk_user_paid = ".$user->id.",";
$sql.= " date_paiement='".$this->db->idate($this->date_paiement)."'"; $sql.= " date_paiement='".$this->db->idate($this->date_paiement)."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
@ -1020,7 +1037,7 @@ class ExpenseReport extends CommonObject
if ($this->fk_c_deplacement_statuts != 5) if ($this->fk_c_deplacement_statuts != 5)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 5"; $sql.= " SET fk_statut = 5";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
dol_syslog(get_class($this)."::set_unpaid sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::set_unpaid sql=".$sql, LOG_DEBUG);
@ -1048,10 +1065,10 @@ class ExpenseReport extends CommonObject
function set_cancel($user,$detail) function set_cancel($user,$detail)
{ {
$this->date_cancel = $this->db->idate(gmmktime()); $this->date_cancel = $this->db->idate(gmmktime());
if ($this->fk_c_expensereport_statuts != 4) if ($this->fk_statut != 4)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 4, fk_user_cancel = ".$user->id; $sql.= " SET fk_statut = 4, fk_user_cancel = ".$user->id;
$sql.= ", date_cancel='".$this->date_cancel."'"; $sql.= ", date_cancel='".$this->date_cancel."'";
$sql.= " ,detail_cancel='".$this->db->escape($detail)."'"; $sql.= " ,detail_cancel='".$this->db->escape($detail)."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
@ -1180,13 +1197,13 @@ class ExpenseReport extends CommonObject
function updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $expensereport_id) function updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $expensereport_id)
{ {
if ($this->fk_c_expensereport_statuts==0 || $this->fk_c_expensereport_statuts==99) if ($this->fk_statut==0 || $this->fk_statut==99)
{ {
$this->db->begin(); $this->db->begin();
// Select du taux de tva par rapport au code // Select du taux de tva par rapport au code
$sql = "SELECT t.taux as taux_tva"; $sql = "SELECT t.taux as taux_tva";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t";
$sql.= " WHERE t.rowid = ".$c_tva; $sql.= " WHERE t.rowid = ".$c_tva;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$objp_tva = $this->db->fetch_object($result); $objp_tva = $this->db->fetch_object($result);
@ -1222,7 +1239,7 @@ class ExpenseReport extends CommonObject
// Select des infos sur le type fees // Select des infos sur le type fees
$sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees"; $sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees as c";
$sql.= " WHERE c.id = ".$type_fees_id; $sql.= " WHERE c.id = ".$type_fees_id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$objp_fees = $this->db->fetch_object($result); $objp_fees = $this->db->fetch_object($result);
@ -1231,7 +1248,7 @@ class ExpenseReport extends CommonObject
// Select des informations du projet // Select des informations du projet
$sql = "SELECT p.ref as ref_projet, p.title as title_projet"; $sql = "SELECT p.ref as ref_projet, p.title as title_projet";
$sql.= " FROM ".MAIN_DB_PREFIX."projet p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE p.rowid = ".$projet_id; $sql.= " WHERE p.rowid = ".$projet_id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$objp_projet = $this->db->fetch_object($result); $objp_projet = $this->db->fetch_object($result);
@ -1404,6 +1421,39 @@ class ExpenseReport extends CommonObject
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
/**
* List of types
*
* @param int $active Active or not
* @return array
*/
function listOfTypes($active=1)
{
global $langs;
$ret=array();
$sql = "SELECT id, code, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees";
$sql.= " WHERE active = ".$active;
dol_syslog(get_class($this)."::listOfTypes", LOG_DEBUG);
$result = $this->db->query($sql);
if ( $result )
{
$num = $this->db->num_rows($result);
$i=0;
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
$ret[$obj->code]=(($langs->trans($obj->code)!=$obj->code)?$langs->trans($obj->code):$obj->label);
$i++;
}
}
else
{
dol_print_error($this->db);
}
return $ret;
}
} }
@ -1460,9 +1510,9 @@ class ExpenseReportLine
$sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' WHERE fde.rowid = '.$rowid; $sql.= ' WHERE fde.rowid = '.$rowid;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -1643,7 +1693,7 @@ class ExpenseReportLine
* @param int $useempty 1=Add empty line * @param int $useempty 1=Add empty line
* @return string HTML select with sattus * @return string HTML select with sattus
*/ */
function select_expensereport_statut($selected='',$htmlname='fk_c_expensereport_statuts',$useempty=1) function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempty=1)
{ {
global $db; global $db;

View File

@ -19,11 +19,11 @@
/** /**
* \file htdocs/expensereport/class/expensereportstats.class.php * \file htdocs/expensereport/class/expensereportstats.class.php
* \ingroup factures * \ingroup ExpenseReport
* \brief Fichier de la classe de gestion des stats des expensereport et notes de frais * \brief Fichier de la classe de gestion des stats des expensereport et notes de frais
*/ */
include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
dol_include_once('/expensereport/class/expensereport.class.php'); include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
/** /**
* Classe permettant la gestion des stats des expensereports et notes de frais * Classe permettant la gestion des stats des expensereports et notes de frais
@ -59,7 +59,7 @@ class ExpenseReportStats extends Stats
$this->from = MAIN_DB_PREFIX.$object->table_element; $this->from = MAIN_DB_PREFIX.$object->table_element;
$this->field='total_ht'; $this->field='total_ht';
$this->where = " fk_c_expensereport_statuts > 0 and date_valid > '2000-01-01'"; $this->where = " fk_statut > 0 and date_valid > '2000-01-01'";
//$this->where.= " AND entity = ".$conf->entity; //$this->where.= " AND entity = ".$conf->entity;
if ($this->socid) if ($this->socid)
{ {

View File

View File

@ -21,8 +21,8 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
dol_include_once("/expensereport/class/expensereport.class.php"); require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
$langs->load("users"); $langs->load("users");
$langs->load("trips"); $langs->load("trips");

View File

View File

@ -25,8 +25,8 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
dol_include_once("/expensereport/class/expensereport.class.php"); require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("users"); $langs->load("users");
@ -111,8 +111,7 @@ print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("Statistics").'</td>'; print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
print "</tr>\n"; print "</tr>\n";
//$listoftype=$tripandexpense_static->listOfTypes(); $listoftype=$tripandexpense_static->listOfTypes();
$listoftype=$label;
foreach ($listoftype as $code => $label) foreach ($listoftype as $code => $label)
{ {
$dataseries[]=array('label'=>$label,'data'=>(isset($somme[$code])?(int) $somme[$code]:0)); $dataseries[]=array('label'=>$label,'data'=>(isset($somme[$code])?(int) $somme[$code]:0));
@ -143,7 +142,7 @@ $max=10;
$langs->load("boxes"); $langs->load("boxes");
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_c_expensereport_statuts as fk_status"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as fk_status";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE u.rowid = d.fk_user_author"; $sql.= " WHERE u.rowid = d.fk_user_author";
@ -187,8 +186,8 @@ if ($result)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>'; print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(1).'</td>'; print '<td>'.$userstatic->getNomUrl(1).'</td>';
print '<td align="right">'.$obj->total_ht.'</td>'; print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.$obj->total_ttc.'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
print '<td align="right">'; print '<td align="right">';
//print $obj->libelle; //print $obj->libelle;

View File

@ -21,12 +21,13 @@
/** /**
* \file htdocs/expensereport/index.php * \file htdocs/expensereport/index.php
* \brief Page liste des expensereports * \brief list of expense reports
*/ */
require "../main.inc.php"; require "../main.inc.php";
dol_include_once("/expensereport/class/expensereport.class.php"); require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("users"); $langs->load("users");
@ -39,7 +40,7 @@ $result = restrictedArea($user, 'expensereport','','');
$search_ref = GETPOST('search_ref'); $search_ref = GETPOST('search_ref');
$search_user = GETPOST('search_user','int'); $search_user = GETPOST('search_user','int');
$search_state = GETPOST('search_state','int'); $search_status = GETPOST('search_status','int');
$month_start = GETPOST("month_start","int"); $month_start = GETPOST("month_start","int");
$year_start = GETPOST("year_start","int"); $year_start = GETPOST("year_start","int");
$month_end = GETPOST("month_end","int"); $month_end = GETPOST("month_end","int");
@ -49,7 +50,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
{ {
$search_ref=""; $search_ref="";
$search_user=""; $search_user="";
$search_state=""; $search_status="";
$month_start=""; $month_start="";
$year_start=""; $year_start="";
$month_end=""; $month_end="";
@ -69,13 +70,12 @@ llxHeader('', $langs->trans("ListOfTrips"));
$max_year = 5; $max_year = 5;
$min_year = 5; $min_year = 5;
$sortorder = $_GET["sortorder"]; $sortorder = GETPOST("sortorder");
$sortfield = $_GET["sortfield"]; $sortfield = GETPOST("sortfield");
$page = $_GET["page"]; $page = GETPOST("page");
if (!$sortorder) $sortorder="DESC"; if (!$sortorder) $sortorder="DESC";
if (!$sortfield) $sortfield="d.date_debut"; if (!$sortfield) $sortfield="d.date_debut";
if ($page == -1) { if ($page == -1) {
$page = 0 ; $page = 0 ;
} }
@ -85,79 +85,53 @@ $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$sql = "SELECT d.rowid, d.ref, d.total_ht, d.total_tva, d.total_ttc, d.fk_c_expensereport_statuts as status,"; $sql = "SELECT d.rowid, d.ref, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
$sql.= " d.date_debut, d.date_fin,"; $sql.= " d.date_debut, d.date_fin,";
$sql.= " u.rowid as id_user, u.firstname, u.lastname"; $sql.= " u.rowid as id_user, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport d\n"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid\n"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid";
// Where
// WHERE
if(!empty($search_ref)){ if(!empty($search_ref)){
$sql.= " WHERE d.ref LIKE '%".$db->escape($search_ref)."%'\n"; $sql.= " WHERE d.ref LIKE '%".$db->escape($search_ref)."%'";
}else{ }else{
$sql.= " WHERE 1 = 1\n"; $sql.= " WHERE 1 = 1";
} }
// DATE START // Date Start
if ($month_start > 0) { if ($month_start > 0)
if ($year_start > 0) { {
if($month_end > 0) { if ($year_start > 0 && empty($day))
if($year_end > 0) { $sql.= " AND d.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,false))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,false))."'";
$sql.= " AND date_format(d.date_debut, '%Y-%m') >= '$year_start-$month_start'"; else if ($year_start > 0 && ! empty($day))
$sql.= " AND date_format(d.date_fin, '%Y-%m') <= '$year_end-$month_end'"; $sql.= " AND d.date_debut BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_start, $day, $year_start))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_start, $day, $year_start))."'";
} else { else
$sql.= " AND date_format(d.date_debut, '%Y-%m') >= '$year_start-$month_start'"; $sql.= " AND date_format(d.date_debut, '%m') = '".$month_start."'";
$sql.= " AND date_format(d.date_fin, '%m') <= '$month_end'";
}
} else {
if($year_end > 0) {
$sql.= " AND date_format(d.date_debut, '%Y-%m') >= '$year_start-$month_start'";
$sql.= " AND date_format(d.date_fin, '%Y') <= '$year_end'";
} else {
$sql.= " AND date_format(d.date_debut, '%Y-%m') >= '$year_start-$month_start'";
}
}
} else {
$sql.= " AND date_format(d.date_debut, '%m') >= '$month_start'";
}
} else {
if ($year_start > 0) {
if($month_end > 0) {
if($year_end > 0) {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%Y-%m') <= '$year_end-$month_end'";
} else {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%m') <= '$month_end'";
}
} else {
if($year_end > 0) {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%Y') <= '$year_end'";
} else {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
}
}
} else {
if($month_end > 0) {
if($year_end > 0) {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%Y-%m') <= '$year_end-$month_end'";
} else {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%m') <= '$month_end'";
}
} else {
if($year_end > 0) {
$sql.= " AND date_format(d.date_debut, '%Y') >= '$year_start'";
$sql.= " AND date_format(d.date_fin, '%Y') <= '$year_end'";
}
}
}
} }
if (!empty($search_user) && $search_user > 0) $sql.= " AND d.fk_user_author = ".$search_user."\n"; else if ($year_start > 0)
if($search_state != '') $sql.= " AND d.fk_c_expensereport_statuts = '$search_state'\n"; {
$sql.= " AND d.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,1,false))."' AND '".$db->idate(dol_get_last_day($year_start,12,false))."'";
}
// Date Start
if ($month_end > 0)
{
if ($year_end > 0 && empty($day))
$sql.= " AND d.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,false))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,false))."'";
else if ($year_end > 0 && ! empty($day))
$sql.= " AND d.date_fin BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_end, $day, $year_end))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_end, $day, $year_end))."'";
else
$sql.= " AND date_format(d.date_fin, '%m') = '".$month_end."'";
}
else if ($year_end > 0)
{
$sql.= " AND d.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,1,false))."' AND '".$db->idate(dol_get_last_day($year_end,12,false))."'";
}
// User
if ($search_name)
{
$sql .= natural_search('u.lastname', $search_name);
}
// Status
if($search_status != '') $sql.= " AND d.fk_statut = '".$search_status."'";
// RESTRICT RIGHTS // RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
@ -219,17 +193,13 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
} }
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
print "</td>";
// Status // Status
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
select_expensereport_statut($search_state,'search_state'); select_expensereport_statut($search_status,'search_status');
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
@ -257,10 +227,6 @@ if ($resql)
print '<td align="center">'.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').'</td>'; print '<td align="center">'.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').'</td>';
print '<td align="center">'.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').'</td>'; print '<td align="center">'.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').'</td>';
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->id_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>'; print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->id_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>';
/*print '<td align="right">'.price($objp->total_tva, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
print '<td align="right">'.price($objp->total_ht, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
print '<td align="right">'.price($objp->total_ttc, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
*/
print '<td align="right">'.price($objp->total_ht).'</td>'; print '<td align="right">'.price($objp->total_ht).'</td>';
print '<td align="right">'.price($objp->total_tva).'</td>'; print '<td align="right">'.price($objp->total_tva).'</td>';
print '<td align="right">'.price($objp->total_ttc).'</td>'; print '<td align="right">'.price($objp->total_ttc).'</td>';
@ -281,11 +247,7 @@ if ($resql)
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4">'.$langs->trans("Total").'</td>'; print '<td colspan="4">'.$langs->trans("Total").'</td>';
/*
print '<td style="text-align:right;">'.price($total_total_tva, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
print '<td style="text-align:right;">'.price($total_total_ht, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
print '<td style="text-align:right;">'.price($total_total_ttc, '', $langs, 0, 'MT', 0, $conf->currency).'</td>';
*/
print '<td style="text-align:right;">'.$total_total_ht.'</td>'; print '<td style="text-align:right;">'.$total_total_ht.'</td>';
print '<td style="text-align:right;">'.$total_total_tva.'</td>'; print '<td style="text-align:right;">'.$total_total_tva.'</td>';
print '<td style="text-align:right;">'.$total_total_ttc.'</td>'; print '<td style="text-align:right;">'.$total_total_ttc.'</td>';

View File

View File

@ -16,8 +16,8 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
dol_include_once("/expensereport/class/expensereport.class.php"); require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("users"); $langs->load("users");
@ -49,12 +49,12 @@ if ($_GET["action"] == 'confirm_ndf_to_account' && $_GET["confirm"] == "yes"):
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); $insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
if ($insertid > 0): if ($insertid > 0):
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport d"; $sql = " UPDATE ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " SET integration_compta = 1, fk_bank_account = $idAccount"; $sql.= " SET integration_compta = 1, fk_bank_account = $idAccount";
$sql.= " WHERE rowid = $idTrip"; $sql.= " WHERE rowid = $idTrip";
$resql=$db->query($sql); $resql=$db->query($sql);
if($result): if($result):
Header("Location: synchro_compta.php?account=".$idAccount); Header("Location: ".$_SERVER["PHP_SELF"]."?account=".$idAccount);
exit; exit;
else: else:
dol_print_error($db); dol_print_error($db);
@ -75,12 +75,12 @@ if ($_GET["action"] == 'confirm_account_to_ndf' && $_GET["confirm"] == "yes"):
$sql.= " WHERE label LIKE '%".$expensereport->ref."%'"; $sql.= " WHERE label LIKE '%".$expensereport->ref."%'";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql > 0): if ($resql > 0):
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport d"; $sql = " UPDATE ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " SET integration_compta = 0, fk_bank_account = 0"; $sql.= " SET integration_compta = 0, fk_bank_account = 0";
$sql.= " WHERE rowid = $idTrip"; $sql.= " WHERE rowid = $idTrip";
$resql=$db->query($sql); $resql=$db->query($sql);
if($result): if($result):
Header("Location: synchro_compta.php?account=".$idAccount); Header("Location: ".$_SERVER["PHP_SELF"]."?account=".$idAccount);
exit; exit;
else: else:
dol_print_error($db); dol_print_error($db);
@ -110,13 +110,13 @@ dol_fiche_head('');
if ($_GET["action"] == 'ndfTOaccount'): if ($_GET["action"] == 'ndfTOaccount'):
$idTrip = $_GET['idTrip']; $idTrip = $_GET['idTrip'];
$ret=$html->form_confirm("synchro_compta.php?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
endif; endif;
if ($_GET["action"] == 'accountTOndf'): if ($_GET["action"] == 'accountTOndf'):
$idTrip = $_GET['idTrip']; $idTrip = $_GET['idTrip'];
$ret=$html->form_confirm("synchro_compta.php?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
endif; endif;
@ -136,11 +136,11 @@ else:
print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("ViewAccountSynch").'">'; print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("ViewAccountSynch").'">';
print "</form>"; print "</form>";
$sql = "SELECT d.fk_bank_account, d.ref, d.rowid, d.date_valid, d.fk_user_author, d.total_ttc, d.integration_compta, d.fk_c_expensereport_statuts"; $sql = "SELECT d.fk_bank_account, d.ref, d.rowid, d.date_valid, d.fk_user_author, d.total_ttc, d.integration_compta, d.fk_statut";
$sql.= " ,CONCAT(u.firstname,' ',u.lastname) as declarant_NDF"; $sql.= " ,CONCAT(u.firstname,' ',u.lastname) as declarant_NDF";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport d"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid";
$sql.= " WHERE d.fk_c_expensereport_statuts = 6"; $sql.= " WHERE d.fk_statut = 6";
$sql.= " ORDER BY d.date_valid DESC"; $sql.= " ORDER BY d.date_valid DESC";
$resql=$db->query($sql); $resql=$db->query($sql);
@ -200,7 +200,7 @@ else:
print "</table>"; print "</table>";
else: else:
print '<div class="error">'.$langs->trans("AucuneTripToSynch").'</div>'; print '<div class="error">'.$langs->trans("NoTripToSync").'</div>';
endif; endif;
$db->free($resql); $db->free($resql);

View File

@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$langs->load('suppliers'); $langs->load('suppliers');
@ -49,10 +50,15 @@ if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe'); $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
$object = new Fournisseur($db); $object = new Fournisseur($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('suppliercard','globalcard')); $hookmanager->initHooks(array('suppliercard','globalcard'));
/* /*
* Action * Action
*/ */
@ -111,8 +117,8 @@ if ($id > 0 && empty($object->id))
if ($object->id > 0) if ($object->id > 0)
{ {
$title=$langs->trans("SupplierCard"); $title=$langs->trans("ThirdParty")." - ".$langs->trans('SupplierCard');
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name; if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('SupplierCard');
$help_url=''; $help_url='';
llxHeader('',$title, $help_url); llxHeader('',$title, $help_url);
@ -251,7 +257,16 @@ if ($object->id > 0)
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
// Module Adherent // Other attributes
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields);
}
// Module Adherent
if (! empty($conf->adherent->enabled)) if (! empty($conf->adherent->enabled))
{ {
$langs->load("members"); $langs->load("members");

View File

@ -1947,28 +1947,28 @@ elseif (! empty($object->id))
// Ligne de 3 colonnes // Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>'; print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right"><b>'.price($object->total_ht).'</b></td>'; print '<td colspan="2">'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($object->total_tva).'</td>'; print '<tr><td>'.$langs->trans("AmountVAT").'</td><td colspan="2">'.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '</tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{ {
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax1).'</td>'; print '<td colspan="2">'.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '</tr>';
} }
if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2 if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
{ {
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2).'</td>'; print '<td colspan="2">'.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '</tr>';
} }
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($object->total_ttc).'</td>'; print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="2">'.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '</tr>';
print "</table><br>"; print "</table><br>";

View File

@ -27,6 +27,7 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("suppliers"); $langs->load("suppliers");
$langs->load("orders"); $langs->load("orders");
@ -59,6 +60,7 @@ if (! $sortfield) $sortfield="nom";
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('supplierlist')); $hookmanager->initHooks(array('supplierlist'));
$extrafields = new ExtraFields($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{ {
@ -73,6 +75,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$catid=""; $catid="";
} }
$extrafields->fetch_name_optionals_label('thirdparty');
/* /*
* Actions * Actions
*/ */
@ -95,7 +100,14 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url);
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, "; $sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
$sql.= "code_fournisseur, code_compta_fournisseur"; $sql.= "code_fournisseur, code_compta_fournisseur";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key;
// Add fields from hooks
$parameters=array();
$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cf ON s.rowid = cf.fk_societe"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cf ON s.rowid = cf.fk_societe"; // We need this table joined to the select in order to filter by categ
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -122,6 +134,9 @@ if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL"; if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ; if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL"; if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL";
// Add where from hooks
$parameters=array();
$sql.=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
// Count total nb of records // Count total nb of records
$nbtotalofrecords = 0; $nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -131,6 +146,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
} }
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset); $sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
dol_syslog('fourn/list.php:', LOG_DEBUG); dol_syslog('fourn/list.php:', LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -86,12 +86,15 @@ if (! is_writable($conffile))
// Check parameters // Check parameters
$is_sqlite = false;
if (empty($db_type)) if (empty($db_type))
{ {
print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseType")).'</div>'; print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseType")).'</div>';
$error++; $error++;
} else {
$is_sqlite = ($db_type === 'sqlite' || $db_type === 'sqlite3' );
} }
if (empty($db_host)) if (empty($db_host) && ! $is_sqlite)
{ {
print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Server")).'</div>'; print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Server")).'</div>';
$error++; $error++;
@ -101,7 +104,7 @@ if (empty($db_name))
print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseName")).'</div>'; print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseName")).'</div>';
$error++; $error++;
} }
if (empty($db_user)) if (empty($db_user) && ! $is_sqlite)
{ {
print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'</div>'; print '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'</div>';
$error++; $error++;

View File

@ -51,6 +51,9 @@ if ($dolibarr_main_db_type == "mysql") $choix=1;
if ($dolibarr_main_db_type == "mysqli") $choix=1; if ($dolibarr_main_db_type == "mysqli") $choix=1;
if ($dolibarr_main_db_type == "pgsql") $choix=2; if ($dolibarr_main_db_type == "pgsql") $choix=2;
if ($dolibarr_main_db_type == "mssql") $choix=3; if ($dolibarr_main_db_type == "mssql") $choix=3;
if ($dolibarr_main_db_type == "sqlite") $choix=4;
if ($dolibarr_main_db_type == "sqlite3") $choix=5;
//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into etape2.php page'); //if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into etape2.php page');
// Now we load forced value from install.forced.php file. // Now we load forced value from install.forced.php file.
@ -411,6 +414,7 @@ if ($action == "set")
if ($choix==1) $dir = "mysql/functions/"; if ($choix==1) $dir = "mysql/functions/";
elseif ($choix==2) $dir = "pgsql/functions/"; elseif ($choix==2) $dir = "pgsql/functions/";
elseif ($choix==3) $dir = "mssql/functions/"; elseif ($choix==3) $dir = "mssql/functions/";
elseif ($choix==4) { $dir = "sqlite3/functions/"; }
// Creation donnees // Creation donnees
$file = "functions.sql"; $file = "functions.sql";

View File

@ -306,7 +306,7 @@ if (! empty($force_install_message))
$class='DoliDB'.ucfirst($type); $class='DoliDB'.ucfirst($type);
include_once $dir."/".$file; include_once $dir."/".$file;
if ($type == 'sqlite') continue; // We hide sqlite because support can't be complete unti sqlit does not manage foreign key creation after table creation if ($type == 'sqlite') continue; // We hide sqlite because support can't be complete until sqlite does not manage foreign key creation after table creation
// Version min of database // Version min of database
$versionbasemin=explode('.',$class::VERSIONMIN); $versionbasemin=explode('.',$class::VERSIONMIN);
@ -320,7 +320,8 @@ if (! empty($force_install_message))
if ($type=='mysqli') { $testfunction='mysqli_connect'; $testclass=''; } if ($type=='mysqli') { $testfunction='mysqli_connect'; $testclass=''; }
if ($type=='pgsql') { $testfunction='pg_connect'; $testclass=''; } if ($type=='pgsql') { $testfunction='pg_connect'; $testclass=''; }
if ($type=='mssql') { $testfunction='mssql_connect'; $testclass=''; } if ($type=='mssql') { $testfunction='mssql_connect'; $testclass=''; }
if ($type=='sqlite') { $testfunction=''; $testclass='PDO'; } if ($type=='sqlite') { $testfunction=''; $testclass='PDO'; }
if ($type=='sqlite3') { $testfunction=''; $testclass='SQLite3'; }
$option.='<option value="'.$type.'"'.($defaultype == $type?' selected="selected"':''); $option.='<option value="'.$type.'"'.($defaultype == $type?' selected="selected"':'');
if ($testfunction && ! function_exists($testfunction)) $option.=' disabled="disabled"'; if ($testfunction && ! function_exists($testfunction)) $option.=' disabled="disabled"';
if ($testclass && ! class_exists($testclass)) $option.=' disabled="disabled"'; if ($testclass && ! class_exists($testclass)) $option.=' disabled="disabled"';
@ -330,6 +331,7 @@ if (! empty($force_install_message))
// Experimental // Experimental
if ($type=='mssql') $option.=' '.$langs->trans("Experimental"); if ($type=='mssql') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental"); elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite3') $option.=' '.$langs->trans("Experimental");
// No available // No available
elseif (! function_exists($testfunction)) $option.=' - '.$langs->trans("FunctionNotAvailableInThisPHP"); elseif (! function_exists($testfunction)) $option.=' - '.$langs->trans("FunctionNotAvailableInThisPHP");
$option.='</option>'; $option.='</option>';
@ -479,7 +481,7 @@ if (! empty($force_install_message))
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery("#db_type").change(function() { jQuery("#db_type").change(function() {
if (jQuery("#db_type").val()=='sqlite') { jQuery(".hidesqlite").hide(); } if (jQuery("#db_type").val()=='sqlite' || jQuery("#db_type").val()=='sqlite3') { jQuery(".hidesqlite").hide(); }
else { jQuery(".hidesqlite").show(); } else { jQuery(".hidesqlite").show(); }
}); });

View File

@ -20,6 +20,7 @@
ALTER TABLE llx_extrafields ADD COLUMN perms varchar(255) after fieldrequired; ALTER TABLE llx_extrafields ADD COLUMN perms varchar(255) after fieldrequired;
ALTER TABLE llx_extrafields ADD COLUMN list integer DEFAULT 0 after perms;
ALTER TABLE llx_payment_salary ADD COLUMN salary real after datev; ALTER TABLE llx_payment_salary ADD COLUMN salary real after datev;
@ -161,7 +162,7 @@ CREATE TABLE llx_expensereport (
fk_user_refuse integer DEFAULT NULL, fk_user_refuse integer DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL, fk_user_cancel integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL, fk_user_paid integer DEFAULT NULL,
fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé fk_statut integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
fk_c_paiement integer DEFAULT NULL, fk_c_paiement integer DEFAULT NULL,
note_public text, note_public text,
note_private text, note_private text,
@ -365,3 +366,7 @@ INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('CIP', 'Carriage and
INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DAT', 'Delivered At Terminal, marchandises (déchargées) livrées sur quai, dans un terminal maritime, fluvial, aérien, routier ou ferroviaire désigné (dédouanement import, et post-acheminement payés par l''acheteur)', 1); INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DAT', 'Delivered At Terminal, marchandises (déchargées) livrées sur quai, dans un terminal maritime, fluvial, aérien, routier ou ferroviaire désigné (dédouanement import, et post-acheminement payés par l''acheteur)', 1);
INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DAP', 'Delivered At Place, marchandises (non déchargées) mises à disposition de l''acheteur dans le pays d''importation au lieu précisé dans le contrat (déchargement, dédouanement import payé par l''acheteur)', 1); INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DAP', 'Delivered At Place, marchandises (non déchargées) mises à disposition de l''acheteur dans le pays d''importation au lieu précisé dans le contrat (déchargement, dédouanement import payé par l''acheteur)', 1);
INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DDP', 'Delivered Duty Paid, marchandises (non déchargées) livrées à destination finale, dédouanement import et taxes à la charge du vendeur ; l''acheteur prend en charge uniquement le déchargement (si exclusion des taxes type TVA, le préciser clairement)', 1); INSERT INTO llx_c_incoterms (code, libelle, active) VALUES ('DDP', 'Delivered Duty Paid, marchandises (non déchargées) livrées à destination finale, dédouanement import et taxes à la charge du vendeur ; l''acheteur prend en charge uniquement le déchargement (si exclusion des taxes type TVA, le préciser clairement)', 1);
-- Extrafields fk_object must be unique (1-1 relation)
ALTER TABLE llx_societe_extrafields DROP INDEX idx_societe_extrafields;
ALTER TABLE llx_societe_extrafields ADD UNIQUE INDEX uk_societe_extrafields (fk_object);

View File

@ -40,7 +40,7 @@ create table llx_commande
fk_user_modif integer, -- user making last change fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating fk_user_valid integer, -- user validating
fk_user_cloture integer, -- user closing fk_user_cloture integer, -- user closing
source smallint, source smallint, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0, fk_statut smallint default 0,
amount_ht real default 0, amount_ht real default 0,
remise_percent real default 0, remise_percent real default 0,
@ -64,7 +64,7 @@ create table llx_commande
date_livraison date default NULL, date_livraison date default NULL,
fk_shipping_method integer, -- shipping method id fk_shipping_method integer, -- shipping method id
fk_availability integer NULL, fk_availability integer NULL,
fk_input_reason integer, fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined
fk_delivery_address integer, -- delivery address (deprecated) fk_delivery_address integer, -- delivery address (deprecated)
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) -- for stock other parameters with json format extraparams varchar(255) -- for stock other parameters with json format

View File

@ -41,7 +41,7 @@ create table llx_commande_fournisseur
fk_user_modif integer, -- user making last change fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating fk_user_valid integer, -- user validating
fk_user_approve integer, -- user approving fk_user_approve integer, -- user approving
source smallint NOT NULL, source smallint NOT NULL, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0, fk_statut smallint default 0,
amount_ht real default 0, amount_ht real default 0,
remise_percent real default 0, remise_percent real default 0,
@ -59,7 +59,7 @@ create table llx_commande_fournisseur
fk_account integer, -- bank account fk_account integer, -- bank account
fk_cond_reglement integer, -- condition de reglement fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement
fk_input_method integer default 0, fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) -- for stock other parameters with json format extraparams varchar(255) -- for stock other parameters with json format

View File

@ -44,7 +44,7 @@ CREATE TABLE llx_expensereport (
fk_user_refuse integer DEFAULT NULL, fk_user_refuse integer DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL, fk_user_cancel integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL, fk_user_paid integer DEFAULT NULL,
fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé fk_statut integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
fk_c_paiement integer DEFAULT NULL, fk_c_paiement integer DEFAULT NULL,
note_public text, note_public text,
note_private text, note_private text,

View File

@ -32,5 +32,6 @@ create table llx_extrafields
perms varchar(255), perms varchar(255),
pos integer DEFAULT 0, pos integer DEFAULT 0,
alwayseditable integer DEFAULT 0, alwayseditable integer DEFAULT 0,
param text param text,
list integer DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -40,5 +40,6 @@ create table llx_product_fournisseur_price
info_bits integer NOT NULL DEFAULT 0, info_bits integer NOT NULL DEFAULT 0,
fk_user integer, fk_user integer,
fk_supplier_price_expression integer, -- Link to the rule for dynamic price calculation fk_supplier_price_expression integer, -- Link to the rule for dynamic price calculation
import_key varchar(14) -- Import key import_key varchar(14), -- Import key
delivery_time_days integer
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -22,7 +22,7 @@ create table llx_projet_task_time
fk_task integer NOT NULL, fk_task integer NOT NULL,
task_date date, -- only the day task_date date, -- only the day
task_datehour datetime, -- day + hour task_datehour datetime, -- day + hour
task_date_withhour integer DEFAULT 0; -- 0 by default, 1 if date was entered with start hour task_date_withhour integer DEFAULT 0, -- 0 by default, 1 if date was entered with start hour
task_duration double, task_duration double,
fk_user integer, fk_user integer,
thm double(24,8), thm double(24,8),

View File

@ -17,4 +17,4 @@
-- =================================================================== -- ===================================================================
ALTER TABLE llx_societe_extrafields ADD INDEX idx_societe_extrafields (fk_object); ALTER TABLE llx_societe_extrafields ADD UNIQUE INDEX uk_societe_extrafields (fk_object);

View File

View File

@ -70,9 +70,7 @@ Permission2413=Maßnahmen (Termine oder Aufgaben) Anderer löschen
Permission2501=Dokumente hochladen oder löschen Permission2501=Dokumente hochladen oder löschen
DictionaryCompanyType=Art des Unternehmens DictionaryCompanyType=Art des Unternehmens
DictionaryCompanyJuridicalType=Rechtsform DictionaryCompanyJuridicalType=Rechtsform
DictionaryProspectLevel=Geschäftsaussicht
DictionaryCanton=Bundesland DictionaryCanton=Bundesland
DictionaryActions=Maßnahmen
VATReceivedOnly=Nur Mehtwertsteuererhalt VATReceivedOnly=Nur Mehtwertsteuererhalt
VATIsNotUsedDesc=Die vorgeschlagene MwSt. ist standardmäßig 0 für alle Fälle wie Stiftungen, Einzelpersonen oder Kleinunternehmen- VATIsNotUsedDesc=Die vorgeschlagene MwSt. ist standardmäßig 0 für alle Fälle wie Stiftungen, Einzelpersonen oder Kleinunternehmen-
VATIsUsedExampleFR=In France, it means companies or organisations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. VATIsUsedExampleFR=In France, it means companies or organisations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared.

View File

@ -54,7 +54,7 @@ MaxSize=Maximum size
AttachANewFile=Attach a new file/document AttachANewFile=Attach a new file/document
LinkedObject=Linked object LinkedObject=Linked object
Miscellaneous=Miscellaneous Miscellaneous=Miscellaneous
NbOfActiveNotifications=Number of notifications NbOfActiveNotifications=Number of notifications (nb of recipient emails)
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__ PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__ PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__

View File

@ -1,6 +1,5 @@
# Dolibarr language file - Source file is en_US - suppliers # Dolibarr language file - Source file is en_US - suppliers
Suppliers=Suppliers Suppliers=Suppliers
Supplier=Supplier
AddSupplier=Create a supplier AddSupplier=Create a supplier
SupplierRemoved=Supplier removed SupplierRemoved=Supplier removed
SuppliersInvoice=Suppliers invoice SuppliersInvoice=Suppliers invoice

View File

@ -1,4 +1,4 @@
# Dolibarr language file - es_AR - admin # Dolibarr language file - Source file is en_US - admin
Module30Name=Facturas y notas de crédito Module30Name=Facturas y notas de crédito
Module30Desc=Gestión de facturas y notas de crédito a clientes. Gestión facturas de proveedores Module30Desc=Gestión de facturas y notas de crédito a clientes. Gestión facturas de proveedores
BillsNumberingModule=Módulo de numeración de facturas y notas de crédito BillsNumberingModule=Módulo de numeración de facturas y notas de crédito

View File

@ -1,3 +1,4 @@
# Dolibarr language file - Source file is en_US - admin
Module20Name=Cotizaciones Module20Name=Cotizaciones
Module20Desc=Gestión de cotizaciones/propuestas comerciales Module20Desc=Gestión de cotizaciones/propuestas comerciales
Permission21=Consultar cotizaciones Permission21=Consultar cotizaciones
@ -7,10 +8,7 @@ Permission25=Enviar las cotizaciones
Permission26=Cerrar cotizaciones Permission26=Cerrar cotizaciones
Permission27=Eliminar cotizaciones Permission27=Eliminar cotizaciones
Permission28=Exportar las cotizaciones Permission28=Exportar las cotizaciones
DictionnarySource=Orígenes de cotizaciones/pedidos
VATIsUsedDesc=El tipo de IVA propuesto por defecto en las creaciones de cotizaciones, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el vendedor no está sujeto a IVA, IVA por defecto=0. Final de regla.<br>Si el país del vendedor= país del comprador entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVA por defecto=0 (el IVA debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVA por defecto=0. Final de regla.<br>Si no, IVA propuesto por defecto=0. Final de regla.<br> VATIsUsedDesc=El tipo de IVA propuesto por defecto en las creaciones de cotizaciones, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el vendedor no está sujeto a IVA, IVA por defecto=0. Final de regla.<br>Si el país del vendedor= país del comprador entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVA por defecto=0 (el IVA debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVA por defecto=0. Final de regla.<br>Si no, IVA propuesto por defecto=0. Final de regla.<br>
VATIsNotUsedDesc=El tipo de IVA propuesto por defecto es 0. Este es el caso de asociaciones, particulares o algunas pequeñas sociedades.
VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA.
Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones a cerrar Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones a cerrar
Delays_MAIN_DELAY_PROPALS_TO_BILL=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones no facturadas Delays_MAIN_DELAY_PROPALS_TO_BILL=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones no facturadas
WebCalAddEventOnStatusPropal=Añadir evento en el calendario en el cambio de estado de las cotizaciones WebCalAddEventOnStatusPropal=Añadir evento en el calendario en el cambio de estado de las cotizaciones

View File

@ -13,8 +13,6 @@ VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que elige
VATIsNotUsedExampleFR=En Francia, se trata de asociaciones exentas de ITBIS o sociedades, organismos o profesiones liberales que han elegido el régimen fiscal de módulos (ITBIS en franquicia), pagando un ITBIS en franquicia sin hacer declaración de IVA. Esta elección hace aparecer la anotación "IVA no aplicable - art-293B del CGI" en las facturas. VATIsNotUsedExampleFR=En Francia, se trata de asociaciones exentas de ITBIS o sociedades, organismos o profesiones liberales que han elegido el régimen fiscal de módulos (ITBIS en franquicia), pagando un ITBIS en franquicia sin hacer declaración de IVA. Esta elección hace aparecer la anotación "IVA no aplicable - art-293B del CGI" en las facturas.
LocalTax1IsUsedDesc=Uso de un 2º tipo de impuesto (Distinto del ITBIS) LocalTax1IsUsedDesc=Uso de un 2º tipo de impuesto (Distinto del ITBIS)
LocalTax1IsNotUsedDesc=No usar un 2º tipo de impuesto (Distinto del ITBIS) LocalTax1IsNotUsedDesc=No usar un 2º tipo de impuesto (Distinto del ITBIS)
LocalTax2IsUsedDesc=Uso de un 3er. tipo de impuesto (Distinto del IVA)
LocalTax2IsNotUsedDesc=No usar un 3er. tipo de impuesto (Distinto del IVA)
UnitPriceOfProduct=Precio unitario sin ITBIS de un producto UnitPriceOfProduct=Precio unitario sin ITBIS de un producto
ShowVATIntaInAddress=Ocultar el identificador ITBIS en las direcciones de los documentos ShowVATIntaInAddress=Ocultar el identificador ITBIS en las direcciones de los documentos
OptionVatMode=Opción de carga de ITBIS OptionVatMode=Opción de carga de ITBIS

View File

@ -1,4 +1,4 @@
# Dolibarr language file - es_HN - admin # Dolibarr language file - Source file is en_US - admin
Permission91=Consultar impuestos e ISV Permission91=Consultar impuestos e ISV
Permission92=Crear/modificar impuestos e ISV Permission92=Crear/modificar impuestos e ISV
Permission93=Eliminar impuestos e ISV Permission93=Eliminar impuestos e ISV

View File

@ -1,4 +1,4 @@
# Dolibarr language file - es_MX - admin # Dolibarr language file - Source file is en_US - admin
Module30Name=Facturas y notas de crédito Module30Name=Facturas y notas de crédito
Module30Desc=Gestión de facturas y notas de crédito a clientes. Gestión facturas de proveedores Module30Desc=Gestión de facturas y notas de crédito a clientes. Gestión facturas de proveedores
BillsNumberingModule=Módulo de numeración de facturas y notas de crédito BillsNumberingModule=Módulo de numeración de facturas y notas de crédito

View File

@ -1,4 +1,4 @@
# Dolibarr language file - es_PU - admin # Dolibarr language file - Source file is en_US - admin
Permission91=Consultar impuestos e IGV Permission91=Consultar impuestos e IGV
Permission92=Crear/modificar impuestos e IGV Permission92=Crear/modificar impuestos e IGV
Permission93=Eliminar impuestos e IGV Permission93=Eliminar impuestos e IGV

View File

@ -1,4 +1,4 @@
# Dolibarr language file - es_PR - admin # Dolibarr language file - Source file is en_US - admin
Permission91=Consultar impuestos e IVU Permission91=Consultar impuestos e IVU
Permission92=Crear/modificar impuestos e IVU Permission92=Crear/modificar impuestos e IVU
Permission93=Eliminar impuestos e IVU Permission93=Eliminar impuestos e IVU

View File

@ -1,14 +1,11 @@
# Dolibarr language file - Source file is en_US - accountancy # Dolibarr language file - Source file is en_US - accountancy
Accounting=Contabilidade Accounting=Contabilidade
Globalparameters=Parametros globais Globalparameters=Parametros globais
Fiscalyear=Ano fiscal
Menuaccount=Contas contábeis Menuaccount=Contas contábeis
ConfigAccountingExpert=Configuração do módulo especialista em contabilidade ConfigAccountingExpert=Configuração do módulo especialista em contabilidade
Journaux=Jornais Journaux=Jornais
JournalFinancial=Jornais financeiros JournalFinancial=Jornais financeiros
Exports=Exportações
Selectmodelcsv=Escolha um modelo de exportação Selectmodelcsv=Escolha um modelo de exportação
Modelcsv_normal=Exportação classica
Modelcsv_CEGID=Export towards CEGID Expert Modelcsv_CEGID=Export towards CEGID Expert
BackToChartofaccounts=Return chart of accounts BackToChartofaccounts=Return chart of accounts
Back=Return Back=Return
@ -58,6 +55,10 @@ ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal
ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_SOCIAL_JOURNAL=Social journal
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer
ACCOUNTING_ACCOUNT_SUSPENSE=Account of wait ACCOUNTING_ACCOUNT_SUSPENSE=Account of wait
ACCOUNTING_PRODUCT_BUY_ACCOUNT=Codigo contavel padrao para compra de produtos
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Codigo contavel padrao para venda de produtos
ACCOUNTING_SERVICE_BUY_ACCOUNT=Codigo contavel padrao para compra de servicos
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Codigo contavel padrao para venda de serviços
Docref=Referência Docref=Referência
Code_tiers=Cliente/Fornecedor Code_tiers=Cliente/Fornecedor
Labelcompte=Label account Labelcompte=Label account
@ -80,8 +81,6 @@ ListAccounts=List of the accounting accounts
Pcgversion=Version of the plan Pcgversion=Version of the plan
Pcgtype=Class of account Pcgtype=Class of account
Pcgsubtype=Under class of account Pcgsubtype=Under class of account
Active=Statement
NewFiscalYear=New fiscal year
DescVentilCustomer=Consult here the annual breakdown accounting of your invoices customers DescVentilCustomer=Consult here the annual breakdown accounting of your invoices customers
TotalVente=Total turnover HT TotalVente=Total turnover HT
TotalMarge=Total sales margin TotalMarge=Total sales margin

View File

@ -94,7 +94,6 @@ YouCanEditPHPTZ=Para definir um fuso horário diferente PHP (não obrigatório),
OSEnv=OS Ambiente OSEnv=OS Ambiente
MaxNbOfLinesForBoxes=Numero de linhas máximo para as caixas MaxNbOfLinesForBoxes=Numero de linhas máximo para as caixas
PositionByDefault=Posição por padrao PositionByDefault=Posição por padrao
Position=Posição
MenusDesc=Os configuradores do menu definem o conteúdo das 2 barras de menus (a barra horizontal e a barra vertical). É possível atribuir configuradores diferentes segundo o usuário seja interno ou externo. MenusDesc=Os configuradores do menu definem o conteúdo das 2 barras de menus (a barra horizontal e a barra vertical). É possível atribuir configuradores diferentes segundo o usuário seja interno ou externo.
MenusEditorDesc=O editor de menus permite definir entradas personalizadas nos menus. Deve utilizar com prudência sobe pena de colocar o ERP numa situação instável sendo necessário uma reinstalação para encontrar um menu coerente. MenusEditorDesc=O editor de menus permite definir entradas personalizadas nos menus. Deve utilizar com prudência sobe pena de colocar o ERP numa situação instável sendo necessário uma reinstalação para encontrar um menu coerente.
MenuForUsers=menu para os usuarios MenuForUsers=menu para os usuarios
@ -103,7 +102,6 @@ SystemInfo=Informações de Sistema
SystemTools=Ferramentas do Sistema SystemTools=Ferramentas do Sistema
SystemToolsArea=Área de ferramentas do sistema SystemToolsArea=Área de ferramentas do sistema
SystemToolsAreaDesc=Esta área oferece diferentes funções da administração. Use o menu para escolher a Funcionalidade que procura. SystemToolsAreaDesc=Esta área oferece diferentes funções da administração. Use o menu para escolher a Funcionalidade que procura.
Purge=Limpar
PurgeAreaDesc=Esta página permite eliminar todos os arquivos criados ou guardados pelo ERP (Arquivos temporários ou todos os arquivos da pasta <b>%s</b>). O uso desta função não é necessária. Proporciona-se para os Usuários que albergam o ERP não servidor que oferece as permissões de eliminação de arquivos salvaguardados pela servidor Web. PurgeAreaDesc=Esta página permite eliminar todos os arquivos criados ou guardados pelo ERP (Arquivos temporários ou todos os arquivos da pasta <b>%s</b>). O uso desta função não é necessária. Proporciona-se para os Usuários que albergam o ERP não servidor que oferece as permissões de eliminação de arquivos salvaguardados pela servidor Web.
PurgeDeleteLogFile=Excluir arquivo de log <b>% s </ b> definido para o módulo Syslog (sem risco de perder dados) PurgeDeleteLogFile=Excluir arquivo de log <b>% s </ b> definido para o módulo Syslog (sem risco de perder dados)
PurgeDeleteTemporaryFiles=Eliminar todos os arquivos temporários (sem perigo de perca de dados) PurgeDeleteTemporaryFiles=Eliminar todos os arquivos temporários (sem perigo de perca de dados)
@ -487,7 +485,6 @@ Permission1237=Pedidos a fornecedores Export e seus detalhes
Permission1251=Execute as importações em massa de dados externos para o banco de dados (carga de dados) Permission1251=Execute as importações em massa de dados externos para o banco de dados (carga de dados)
Permission1321=Exportar faturas a clientes, atributos e cobranças Permission1321=Exportar faturas a clientes, atributos e cobranças
Permission1421=Exportar faturas de clientes e atributos Permission1421=Exportar faturas de clientes e atributos
Permission23001 =Ler tarefa agendada
Permission23002 =Criar/atualizar tarefa agendada Permission23002 =Criar/atualizar tarefa agendada
Permission23003 =Apagar tarefa agendada Permission23003 =Apagar tarefa agendada
Permission2401=Ler ações (eventos ou tarefas) vinculadas na sua conta Permission2401=Ler ações (eventos ou tarefas) vinculadas na sua conta
@ -541,7 +538,6 @@ LocalTax1IsUsed=Utilize segundo imposto
LocalTax1IsNotUsed=Não use o segundo imposto LocalTax1IsNotUsed=Não use o segundo imposto
LocalTax1IsUsedDesc=Use um segundo tipo de impostos (excepto o IVA) LocalTax1IsUsedDesc=Use um segundo tipo de impostos (excepto o IVA)
LocalTax1IsNotUsedDesc=Não use outro tipo de impostos (excepto o IVA) LocalTax1IsNotUsedDesc=Não use outro tipo de impostos (excepto o IVA)
LocalTax1Management=Segundo tipo de imposto
LocalTax2IsUsed=Use terceiro imposto LocalTax2IsUsed=Use terceiro imposto
LocalTax2IsNotUsed=Não use terceiro imposto LocalTax2IsNotUsed=Não use terceiro imposto
LocalTax2IsUsedDesc=Use um terceiro tipo de impostos (excepto o VAT) LocalTax2IsUsedDesc=Use um terceiro tipo de impostos (excepto o VAT)

View File

@ -2,7 +2,6 @@
IdAgenda=ID evento IdAgenda=ID evento
Actions=Eventos Actions=Eventos
ActionsArea=Área de eventos (Atividades e Tarefas) ActionsArea=Área de eventos (Atividades e Tarefas)
LocalAgenda=Calendário interno
ActionsOwnedBy=Evento de propriedade do ActionsOwnedBy=Evento de propriedade do
DoneBy=Concluído por DoneBy=Concluído por
Event=Evento Event=Evento

View File

@ -20,8 +20,6 @@ CurrentBalance=Saldo atual
ShowAllTimeBalance=Mostrar Balanço Desde do Inicio ShowAllTimeBalance=Mostrar Balanço Desde do Inicio
AllTime=Do inicio AllTime=Do inicio
RIB=Conta Bancaria RIB=Conta Bancaria
StandingOrders=Débitos Diretos
StandingOrder=Domicilio
AccountStatement=Extrato da Conta AccountStatement=Extrato da Conta
AccountStatementShort=Extrato AccountStatementShort=Extrato
AccountStatements=Extratos das Contas AccountStatements=Extratos das Contas
@ -112,7 +110,6 @@ ThenCheckLinesAndConciliate=Verificar as linhas presentes no relatorio do banco
BankDashboard=Somario de contas bancarias BankDashboard=Somario de contas bancarias
DefaultRIB=BAN padrao DefaultRIB=BAN padrao
AllRIB=Todos BAN AllRIB=Todos BAN
LabelRIB=Etiqueta BAN
NoBANRecord=Nao tem registro BAN NoBANRecord=Nao tem registro BAN
DeleteARib=Apagar registro BAN DeleteARib=Apagar registro BAN
ConfirmDeleteRib=Voce tem certeza que quer apagar este registro BAN ? ConfirmDeleteRib=Voce tem certeza que quer apagar este registro BAN ?

View File

@ -7,7 +7,6 @@ BoxOldestUnpaidSupplierBills=Primeira fatura pendentes do fornecedor
BoxLastActions=Últimas ações BoxLastActions=Últimas ações
BoxLastContracts=Últimos contratos BoxLastContracts=Últimos contratos
BoxLastContacts=Últimos contatos/endereços BoxLastContacts=Últimos contatos/endereços
BoxFicheInter=Últimas intervenções
BoxCurrentAccounts=Abrir saldo das contas BoxCurrentAccounts=Abrir saldo das contas
BoxTotalUnpaidCustomerBills=Total de faturas pendentes de clientes BoxTotalUnpaidCustomerBills=Total de faturas pendentes de clientes
BoxTotalUnpaidSuppliersBills=Total de faturas pendentes de fornecedores BoxTotalUnpaidSuppliersBills=Total de faturas pendentes de fornecedores

View File

@ -43,11 +43,8 @@ CatCusLinks=Linkes entre clientes/prospetivas e categorias
CatProdLinks=Linkes entre produtos/servicos e categorias CatProdLinks=Linkes entre produtos/servicos e categorias
CatMemberLinks=Linkes entre membros e categorias CatMemberLinks=Linkes entre membros e categorias
DeleteFromCat=Excluir da categoria DeleteFromCat=Excluir da categoria
DeletePicture=Apagar foto
ConfirmDeletePicture=Confirmar eliminação de fotografias
ExtraFieldsCategories=atributos complementares ExtraFieldsCategories=atributos complementares
CategoriesSetup=Configuração de categorias CategoriesSetup=Configuração de categorias
CategorieRecursiv=Ligação com a categoria automaticamente CategorieRecursiv=Ligação com a categoria automaticamente
CategorieRecursivHelp=Se ativado, o produto também será ligada a categoria original quando adicionando em uma subcategoria CategorieRecursivHelp=Se ativado, o produto também será ligada a categoria original quando adicionando em uma subcategoria
AddProductServiceIntoCategory=Adicione o seguinte produto / serviço AddProductServiceIntoCategory=Adicione o seguinte produto / serviço
ShowCategory=Mostrar categoria

View File

@ -1,6 +1,5 @@
# Dolibarr language file - Source file is en_US - commercial # Dolibarr language file - Source file is en_US - commercial
CommercialArea=Área Comercial CommercialArea=Área Comercial
CommercialCard=Ficha Comercial
DeleteAction=Eliminar um evento/tarefa DeleteAction=Eliminar um evento/tarefa
NewAction=Novo evento/tarefa NewAction=Novo evento/tarefa
AddAction=Criar evento/tarefa AddAction=Criar evento/tarefa

View File

@ -22,7 +22,6 @@ Contacts=Contatos
ThirdPartyContacts=Contatos de clientes/fornecedores ThirdPartyContacts=Contatos de clientes/fornecedores
ThirdPartyContact=Contato/Endereço de cliente/fornecedor ThirdPartyContact=Contato/Endereço de cliente/fornecedor
StatusContactValidated=Estado do Contato StatusContactValidated=Estado do Contato
CompanyName=Razão Social
CountryIsInEEC=País da Comunidadeee Económica Europeia CountryIsInEEC=País da Comunidadeee Económica Europeia
ThirdPartyName=Nome do cliente/fornecedor ThirdPartyName=Nome do cliente/fornecedor
ThirdParty=Cliente/Fornecedor ThirdParty=Cliente/Fornecedor
@ -56,7 +55,6 @@ LocalTax2IsUsedES=Sujeito a IRPF
LocalTax2IsNotUsedES=Não sujeito a IRPF LocalTax2IsNotUsedES=Não sujeito a IRPF
TypeLocaltax1ES=RE Tipo TypeLocaltax1ES=RE Tipo
TypeLocaltax2ES=IRPF Tipo TypeLocaltax2ES=IRPF Tipo
TypeES=Tipo
WrongCustomerCode=Código cliente incorreto WrongCustomerCode=Código cliente incorreto
WrongSupplierCode=Código do fornecedor incorreto WrongSupplierCode=Código do fornecedor incorreto
ProfId5Short=Prof. id 5 ProfId5Short=Prof. id 5
@ -108,7 +106,6 @@ ContactsAddresses=Contatos/Enderecos
NoContactDefinedForThirdParty=Nenhum contato definido para este cliente/fornecedor NoContactDefinedForThirdParty=Nenhum contato definido para este cliente/fornecedor
NoContactDefined=Nenhum contato definido NoContactDefined=Nenhum contato definido
DefaultContact=Contato por Padrao DefaultContact=Contato por Padrao
AddCompany=Criar empresa
AddThirdParty=Criar cliente/fornecedor AddThirdParty=Criar cliente/fornecedor
SupplierCode=Código do fornecedor SupplierCode=Código do fornecedor
SupplierAccount=Conta do fornecedor SupplierAccount=Conta do fornecedor

View File

@ -133,10 +133,6 @@ CalculationRuleDesc=Para calcular o total do VAT, há dois métodos: <br> Métod
CalculationRuleDescSupplier=De acordo com o fornecedor, escolher o método adequado aplicar mesma regra de cálculo e obter mesmo resultado esperado pelo seu fornecedor. CalculationRuleDescSupplier=De acordo com o fornecedor, escolher o método adequado aplicar mesma regra de cálculo e obter mesmo resultado esperado pelo seu fornecedor.
TurnoverPerProductInCommitmentAccountingNotRelevant=Relatório Volume de negócios por produto, quando se usa um modo de <b>contabilidade de caixa</b> não é relevante. Este relatório está disponível somente quando utilizar o modo de <b>contabilidade engajamento</b> (ver configuração do módulo de contabilidade). TurnoverPerProductInCommitmentAccountingNotRelevant=Relatório Volume de negócios por produto, quando se usa um modo de <b>contabilidade de caixa</b> não é relevante. Este relatório está disponível somente quando utilizar o modo de <b>contabilidade engajamento</b> (ver configuração do módulo de contabilidade).
AccountancyJournal=Codigo do jornal fiscal AccountancyJournal=Codigo do jornal fiscal
ACCOUNTING_PRODUCT_BUY_ACCOUNT=Codigo contavel padrao para compra de produtos
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Codigo contavel padrao para venda de produtos
ACCOUNTING_SERVICE_BUY_ACCOUNT=Codigo contavel padrao para compra de servicos
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Codigo contavel padrao para venda de serviços
ACCOUNTING_VAT_ACCOUNT=Codigo contavel padrao para credito VAT ACCOUNTING_VAT_ACCOUNT=Codigo contavel padrao para credito VAT
ACCOUNTING_VAT_BUY_ACCOUNT=Codigo contavel padrao para pagamento do VAT ACCOUNTING_VAT_BUY_ACCOUNT=Codigo contavel padrao para pagamento do VAT
ACCOUNTING_ACCOUNT_CUSTOMER=Codigo contavel padrao para clientes ACCOUNTING_ACCOUNT_CUSTOMER=Codigo contavel padrao para clientes

View File

@ -3,10 +3,7 @@ ContractsArea=Área Contratos
ListOfContracts=Lista de Contratos ListOfContracts=Lista de Contratos
AllContracts=Todos os Contratos AllContracts=Todos os Contratos
ContractCard=Ficha Contrato ContractCard=Ficha Contrato
ContractStatus=Estado do Contrato
ContractStatusNotRunning=Fora de Serviço ContractStatusNotRunning=Fora de Serviço
ContractStatusRunning=Em Serviço
ContractStatusClosed=Encerrado
ServiceStatusInitial=Inativo ServiceStatusInitial=Inativo
ServiceStatusRunning=Em Serviço ServiceStatusRunning=Em Serviço
ServiceStatusNotLate=Rodando, nao vencido ServiceStatusNotLate=Rodando, nao vencido

View File

@ -26,7 +26,6 @@ ErrorDatabaseAlreadyExists=Base de dados' %s' já existe.
IfDatabaseNotExistsGoBackAndUncheckCreate=Se não existe base de dados, volte e verifique a opção "Criar uma base de dados". IfDatabaseNotExistsGoBackAndUncheckCreate=Se não existe base de dados, volte e verifique a opção "Criar uma base de dados".
IfDatabaseExistsGoBackAndCheckCreate=Caso dados já existe, volte e desmarque "Criar uma base de dados" opção. IfDatabaseExistsGoBackAndCheckCreate=Caso dados já existe, volte e desmarque "Criar uma base de dados" opção.
WarningBrowserTooOld=Navegador antigo. Faça a atualizaçao do seu navegador para uma versao mais recente de Firefox, Chrome ou Opera, e altamente recomendado. WarningBrowserTooOld=Navegador antigo. Faça a atualizaçao do seu navegador para uma versao mais recente de Firefox, Chrome ou Opera, e altamente recomendado.
YouCanContinue=Pode continuar...
License=A usar licença License=A usar licença
ConfigurationFile=Arquivo de configuração ConfigurationFile=Arquivo de configuração
WebPagesDirectory=Directoria onde armazenar as páginas web WebPagesDirectory=Directoria onde armazenar as páginas web
@ -34,13 +33,11 @@ DocumentsDirectory=Directoria onde armazenar documentos enviados e/ou gerados
ForceHttps=Forcar conexoes seguras (https) ForceHttps=Forcar conexoes seguras (https)
CheckToForceHttps=Escolha esta opcao para forcar conexoes seguras (https).<br>Isto requere que o servidor web esta configurado para uso com certificado SSL. CheckToForceHttps=Escolha esta opcao para forcar conexoes seguras (https).<br>Isto requere que o servidor web esta configurado para uso com certificado SSL.
DolibarrDatabase=Base de dados Dolibarr DolibarrDatabase=Base de dados Dolibarr
Server=Servidor
DatabasePrefix=Prefixo tabela banco de dados DatabasePrefix=Prefixo tabela banco de dados
AdminLogin=Login para o administrador da base de dados Dolibarr. Deixar em branco se a conexão é feita com anônimo AdminLogin=Login para o administrador da base de dados Dolibarr. Deixar em branco se a conexão é feita com anônimo
PasswordAgain=Introduza a password uma segunda vez PasswordAgain=Introduza a password uma segunda vez
AdminPassword=Password para o administrador da base de dados Dolibarr. Deixar em branco se a conexão é feita com anônimo AdminPassword=Password para o administrador da base de dados Dolibarr. Deixar em branco se a conexão é feita com anônimo
CreateDatabase=Criar uma base de dados CreateDatabase=Criar uma base de dados
CreateUser=Criar usuário
DatabaseSuperUserAccess=Base de dados - Acesso Superuser DatabaseSuperUserAccess=Base de dados - Acesso Superuser
Experimental=(experimental, não operacional) Experimental=(experimental, não operacional)
KeepEmptyIfNoPassword=Deixar em branco se o usuário não tiver password KeepEmptyIfNoPassword=Deixar em branco se o usuário não tiver password
@ -69,7 +66,6 @@ WarningRemoveInstallDir=Atenção, por razões de segurança, uma vez que a inst
ThisPHPDoesNotSupportTypeBase=PHP Este sistema não suporta qualquer tipo de interface para acesso de dados %s ThisPHPDoesNotSupportTypeBase=PHP Este sistema não suporta qualquer tipo de interface para acesso de dados %s
DatabaseMigration=Estrutura migração de dados DatabaseMigration=Estrutura migração de dados
FreshInstall=Fresh instalar FreshInstall=Fresh instalar
Upgrade=Upgrade
UpgradeDesc=Use este modo se você tiver substituído Dolibarr antigos arquivos com arquivos de uma versão mais recente. Isto irá atualizar o seu banco de dados e dados. UpgradeDesc=Use este modo se você tiver substituído Dolibarr antigos arquivos com arquivos de uma versão mais recente. Isto irá atualizar o seu banco de dados e dados.
InstallNotAllowed=Instalação não permitidas pela <b>conf.php</b> permissões InstallNotAllowed=Instalação não permitidas pela <b>conf.php</b> permissões
YouMustCreateWithPermission=Você deve criar o arquivo %s e definir permissões escrever sobre ele para instalar o servidor web durante o processo. YouMustCreateWithPermission=Você deve criar o arquivo %s e definir permissões escrever sobre ele para instalar o servidor web durante o processo.
@ -92,7 +88,6 @@ NextStepMightLastALongTime=O passo seguinte pode demorar alguns minutos. Por fav
MigrationCustomerOrderShipping=Migrar espedicao para pedidos de cliente de armazenamento MigrationCustomerOrderShipping=Migrar espedicao para pedidos de cliente de armazenamento
MigrationShippingDelivery=Atualizar armazenamento de espediçoes MigrationShippingDelivery=Atualizar armazenamento de espediçoes
MigrationShippingDelivery2=Atualizar armazenamento de espediçao 2 MigrationShippingDelivery2=Atualizar armazenamento de espediçao 2
MigrationFinished=Migração terminada
LastStepDesc=<strong>Ultimo passo</strong>: Defina aqui o usuario e a senha que voce planeja usar para conectar-se ao software. Nao perca estas credenciais, pois sao da conta que administra todas as outras contas. LastStepDesc=<strong>Ultimo passo</strong>: Defina aqui o usuario e a senha que voce planeja usar para conectar-se ao software. Nao perca estas credenciais, pois sao da conta que administra todas as outras contas.
ActivateModule=Ativar modulo %s ActivateModule=Ativar modulo %s
ShowEditTechnicalParameters=Clique aqui para mostrar/editar parametros avançados (modo avançado) ShowEditTechnicalParameters=Clique aqui para mostrar/editar parametros avançados (modo avançado)

View File

@ -15,8 +15,6 @@ Language_en_IN=Ingles (India)
Language_en_NZ=Ingles (Nova Zelandia) Language_en_NZ=Ingles (Nova Zelandia)
Language_en_SA=Ingles (Arabia Saudita) Language_en_SA=Ingles (Arabia Saudita)
Language_en_US=Ingles (Estados Unidos) Language_en_US=Ingles (Estados Unidos)
Language_es_DO=Espanhol (República Dominicana)
Language_es_CL=Espanhol (Chile)
Language_es_MX=Espanhol (Mexico) Language_es_MX=Espanhol (Mexico)
Language_et_EE=Estone Language_et_EE=Estone
Language_fa_IR=Persio Language_fa_IR=Persio
@ -27,7 +25,6 @@ Language_fr_CH=Françes (Suiça)
Language_fr_FR=Françes Language_fr_FR=Françes
Language_he_IL=Ebreo Language_he_IL=Ebreo
Language_hu_HU=Ungeres Language_hu_HU=Ungeres
Language_id_ID=Indonésio
Language_is_IS=Islandes Language_is_IS=Islandes
Language_ja_JP=Japones Language_ja_JP=Japones
Language_nb_NO=Norveges (Bokmal) Language_nb_NO=Norveges (Bokmal)

View File

@ -12,8 +12,6 @@ Unsuscribe=Desenscrever
MailingStatusNotContact=Nao contactar mais MailingStatusNotContact=Nao contactar mais
ErrorMailRecipientIsEmpty=A endereço do destinatário está vazia ErrorMailRecipientIsEmpty=A endereço do destinatário está vazia
WarningNoEMailsAdded=nenhum Novo e-mail a Adicionar à lista destinatários. WarningNoEMailsAdded=nenhum Novo e-mail a Adicionar à lista destinatários.
ConfirmResetMailing=Confirma a limpeza do mailing?
NbOfRecipients=Número de destinatários
NbOfUniqueEMails=N<> de e-mails únicos NbOfUniqueEMails=N<> de e-mails únicos
NbOfEMails=N<> de E-mails NbOfEMails=N<> de E-mails
TotalNbOfDistinctRecipients=Número de destinatários únicos TotalNbOfDistinctRecipients=Número de destinatários únicos

Some files were not shown because too many files have changed in this diff Show More