Merge remote-tracking branch 'origin/4.0' into develop

Conflicts:
	htdocs/compta/prelevement/class/bonprelevement.class.php
	htdocs/filefunc.inc.php
	htdocs/langs/en_US/main.lang
	htdocs/societe/rib.php
This commit is contained in:
Laurent Destailleur 2016-08-01 15:15:32 +02:00
commit b267402df6
129 changed files with 9287 additions and 419 deletions

View File

@ -19,7 +19,7 @@ File added into doxygen generated documentation
<hr class="footer" />
<address class="footer"><small>Generated on $datetime
for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
for <a href="https://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
<!-- Google AdSense -->
@ -32,7 +32,7 @@ google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>
<!-- End google adsense -->
<br>

View File

@ -15,10 +15,7 @@ Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/"
# NOTE FOR APACHE 2.3:
# To restrict access to dolibarr from outside set lines
#
# <RequireAny>
# Require ip 127.0.0.1
# Require host localhost
# <RequireAny>
# Require local
#
# instead of
#

View File

@ -42,6 +42,7 @@ SolidCompression=yes
WizardImageFile=build\exe\doliwamp\doliwamp.bmp
WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
SetupIconFile=doc\images\dolibarr.ico
;To say the installer must be ran as admin
PrivilegesRequired=admin
DisableProgramGroupPage=yes
ChangesEnvironment=no
@ -148,8 +149,12 @@ Name: "{userdesktop}\Dolibarr Help center"; Filename: "{app}\rundolihelp.bat"; W
[Registry]
; Add "run as admin" flag. Same than command line: reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "<Path to your exe>" /t REG_SZ /d RUNASADMIN
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue;
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue;
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN";
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN";
Root: "HKLM32"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN";
Root: "HKLM32"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN";
Root: "HKLM64"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN"; Check: IsWin64
Root: "HKLM64"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN"; Check: IsWin64
[Code]
@ -239,9 +244,9 @@ begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\MSCRM','SMTPServer', value) then
begin
if value <> '' then smtpServer:=value;
end
end
end
end;
end;
end;
end;
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort', value) then
@ -419,7 +424,7 @@ begin
begin
themessage := FmtMessage(CustomMessage('FailedToDeleteLock'),[pathWithSlashes]);
MsgBox(themessage,mbInformation,MB_OK);
end
end;
// Check if parameters already defined in conf.php file
@ -592,7 +597,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
SaveStringToFile(destFileA,srcContents, False);
end
end;
if MsgBox(CustomMessage('DoliWampWillStartApacheMysql'),mbConfirmation,MB_YESNO) = IDYES then
@ -615,7 +620,7 @@ begin
StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
DeleteFile(srcFile);
@ -648,8 +653,8 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
SaveStringToFile(destFile, srcContents, False);
end
end
end;
end;
DeleteFile(srcFile);
@ -679,8 +684,8 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
SaveStringToFile(destFile,srcContents, False);
end
end
end;
end;
@ -703,7 +708,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -725,7 +730,7 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -757,7 +762,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
SaveStringToFile(destFile, srcContents, False);
end
end;
@ -780,7 +785,7 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -801,7 +806,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -822,7 +827,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -843,7 +848,7 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
//----------------------------------------------
@ -864,7 +869,7 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
//----------------------------------------------
@ -885,7 +890,7 @@ begin
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
//----------------------------------------------
@ -904,7 +909,7 @@ begin
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
//----------------------------------------------
@ -921,7 +926,7 @@ begin
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
//----------------------------------------------
// Create file php.ini in apache (if not exists)
@ -937,7 +942,7 @@ begin
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
SaveStringToFile(destFile,srcContents, False);
end
end;
@ -979,7 +984,7 @@ begin
res := False;
end
end;
end
else
@ -989,9 +994,9 @@ begin
res := False;
end
end;
end
end;
Result := res;

View File

@ -255,6 +255,9 @@ KeepAliveTimeout 30
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require all granted
<RequireAny>
Require ip 127.0.0.1
Require host localhost

View File

@ -19,17 +19,11 @@ Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/"
#
# instead of
#
# <RequireAny>
# Require ip 127.0.0.1
# Require host localhost
# <RequireAny>
# Require local
#
<Directory "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
<RequireAny>
Require ip 127.0.0.1
Require host localhost
</RequireAny>
Require local
</Directory>

View File

@ -1117,6 +1117,7 @@ if ($nboftargetok) {
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n";
$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
next;

View File

@ -2,4 +2,4 @@ README
------
Scripts in this directory can be used to load or purge data of a database instance.
WARNING: This may erase data.
WARNING: Some of this script may delete definitely data.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -15,7 +15,7 @@
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
if [ "x$mydir" = "x" ]
if [ "x$mydir" = 'x' -o "x$mydir" = 'x./' ]
then
export mydir="."
fi
@ -132,24 +132,7 @@ then
exit;;
esac
# ---------------------------- chemin d'acces du repertoire documents
#DIALOG=${DIALOG=dialog}
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
#trap "rm -f $fichtemp" 0 1 2 5 15
#$DIALOG --title "Init Dolibarr with demo values" --clear \
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp
#valret=$?
#case $valret in
# 0)
#docs=`cat $fichtemp`;;
# 1)
#exit;;
# 255)
#exit;;
#esac
# ---------------------------- confirmation
DIALOG=${DIALOG=dialog}
$DIALOG --title "Init Dolibarr with demo values" --clear \
@ -177,6 +160,25 @@ echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
export res=$?
# ---------------------------- copy demo files
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
if [ "x$documentdir" != "x" ]
then
echo cp -pr $mydir/documents_demo/* "$documentdir/"
cp -pr $mydir/documents_demo/* "$documentdir/"
echo cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
mkdir -p "$documentdir/ecm/Administrative documents"
mkdir -p "$documentdir/ecm/Images"
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
else
echo Detection of documents directory failed so demo files were not copied.
fi
if [ "x$res" = "x0" ]
then
echo "Success, file successfully loaded."

File diff suppressed because one or more lines are too long

View File

@ -187,7 +187,6 @@ export list="
--ignore-table=$base.llx_bt_webseedfiles
--ignore-table=$base.llx_c_civilite
--ignore-table=$base.llx_c_dolicloud_plans
--ignore-table=$base.llx_c_lead_status
--ignore-table=$base.llx_c_source
--ignore-table=$base.llx_cabinetmed_c_banques
--ignore-table=$base.llx_cabinetmed_c_ccam

126
dev/initdemo/updatedemo.php Executable file
View File

@ -0,0 +1,126 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*
* Get a distant dump file and load it into a mysql database
*/
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Global variables
$error=0;
$confirm=isset($argv[1])?$argv[1]:'';
// Include Dolibarr environment
$res=0;
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
/*
* Main
*/
if (empty($confirm))
{
print "Usage: $script_file confirm\n";
print "Return code: 0 if success, <>0 if error\n";
exit(-1);
}
$tmp=dol_getdate(dol_now());
$tables=array(
'propal'=>array(0=>'datep', 1=>'fin_validite', 2=>'date_valid', 3=>'date_cloture'),
'commande'=>array(0=>'date_commande', 1=>'date_valid', 2=>'date_cloture'),
'facture'=>array(0=>'datef', 1=>'date_valid', 2=>'date_lim_reglement'),
'paiement'=>array(0=>'datep'),
'bank'=>array(0=>'datev', 1=>'dateo'),
'commande_fournisseur'=>array(0=>'date_commande', 1=>'date_valid', 3=>'date_creation', 4=>'date_approve', 5=>'date_approve2', 6=>'date_livraison'),
'supplier_proposal'=>array(0=>'datec', 1=>'date_valid', 2=>'date_cloture')
);
$year=2010;
$currentyear=$tmp['year'];
while ($year <= $currentyear)
{
//$year=2021;
$delta=($currentyear - $year);
//$delta=-1;
if ($delta)
{
foreach($tables as $tablekey => $tableval)
{
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i=0;
while ($i < $num)
{
$obj=$db->fetch_object($resql);
if ($obj)
{
print ".";
$sql2="UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
$j=0;
foreach($tableval as $field)
{
if ($j) $sql2.=", ";
$sql2.= $field." = DATE_ADD(".$field.", INTERVAL ".$delta." YEAR)";
$j++;
}
$sql2.=" WHERE rowid = ".$obj->rowid;
//print $sql2."\n";
$resql2 = $db->query($sql2);
if (! $resql2) dol_print_error($db);
}
$i++;
}
}
else dol_print_error($db);
}
}
$year++;
}
print "\n";
exit(0);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -58,7 +58,17 @@ if ($action == 'add') {
$obj = $db->fetch_object($result);
// Clean code
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
// To manage zero or not at the end of the accounting account
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
{
$account_number = GETPOST('account_number');
}
else
{
$account_number = clean_account(GETPOST('account_number'));
}
if (GETPOST('account_category') <= 0) {
$account_parent = '';
} else {
@ -98,7 +108,17 @@ if ($action == 'add') {
$obj = $db->fetch_object($result2);
// Clean code
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
// To manage zero or not at the end of the accounting account
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
{
$account_number = GETPOST('account_number');
}
else
{
$account_number = clean_account(GETPOST('account_number'));
}
if (GETPOST('account_category') <= 0) {
$account_parent = '';
} else {

View File

@ -130,6 +130,7 @@ if ($action == 'update') {
}
}
// TO DO Mutualize code for yes/no constants
if ($action == 'setlistsorttodo') {
$setlistsorttodo = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
@ -155,6 +156,18 @@ if ($action == 'setlistsortdone') {
}
}
if ($action == 'setmanagezero') {
$setmanagezero = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
/*
* View
*/
@ -286,6 +299,7 @@ foreach ( $list_account as $key ) {
print '</td></tr>';
}
// TO DO Mutualize code for yes/no constants
$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
@ -314,6 +328,20 @@ if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
}
print '</tr>';
$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print "</table>\n";
dol_fiche_end();

View File

@ -596,7 +596,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
)
{
$ok=0;

View File

@ -141,7 +141,7 @@ print '</td></tr>';
// ICS
print '<tr class="pair"><td class="fieldrequired">'.$langs->trans("ICS").'</td>';
print '<td align="left">';
print '<input type="text" name="PRELEVEMENT_ICS" value="'.$conf->global->PRELEVEMENT_ICS.'" size="9" ></td>';
print '<input type="text" name="PRELEVEMENT_ICS" value="'.$conf->global->PRELEVEMENT_ICS.'" size="15" ></td>';
print '</td></tr>';
//User

View File

@ -176,7 +176,7 @@ if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING);
}
}
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">';
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">';
print "</td>";
print '</tr>';
@ -187,7 +187,7 @@ print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
print $langs->trans("AntiVirusParamExample");
print '</td>';
print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" class="minwidth500imp" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">';
print "</td>";
print '</tr>';

View File

@ -72,7 +72,7 @@ function printBookmarksList($aDb, $aLangs)
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
{
$ret.='<div class="menu_contenu"><a class="vsmenu" title="'.$obj->title.'" href="'.$obj->url.'"'.($obj->target == 1?' target="_blank"':'').'>';
$ret.=' '.img_object('','bookmark').' ';
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $ret.=' '.img_object('','bookmark').' ';
$ret.= dol_trunc($obj->title, 20).'</a><br></div>';
$i++;
}

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -118,9 +118,14 @@ if ($catname || $id > 0)
$categstatic->ref=$cat->label;
$categstatic->label=$cat->label;
$categstatic->type=$cat->type;
$categstatic->color=$cat->color;
print '<span class="noborderoncategories" '.($categstatic->color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>';
print $categstatic->getNomUrl(1,'');
print '</span>';
print "</td>\n";
print "\t\t<td>";
print $cat->description;
print "</td>\n";
print "\t\t<td>".$cat->description."</td>\n";
print "\t</tr>\n";
}
print "</table>";

View File

@ -876,7 +876,7 @@ else
{
print "\n\n<div class=\"tabsAction\">\n";
if (($object->statut == 0) && $user->rights->mailing->creer)
if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;id='.$object->id.'">'.$langs->trans("EditMailing").'</a>';
}

View File

@ -1939,7 +1939,7 @@ if ($action == 'create')
print '<tr>';
print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Rate','multicurrency_tx');
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';

View File

@ -2183,7 +2183,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<tr>';
print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Rate','multicurrency_tx');
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';

View File

@ -1298,9 +1298,9 @@ class Account extends CommonObject
}
/**
* Return 1 is IBAN is need for UE country
* Return 1 if IBAN / BIC is mandatory (otherwise option)
*
* @return int 1 yes / 0 No
* @return int 1 = mandatory / 0 = Not mandatory
*/
function needIBAN()
{
@ -1342,7 +1342,7 @@ class Account extends CommonObject
//'CH', // Switzerland - No. Swizerland in not in EEC
);
if (in_array($country_code,$country_code_in_EEC)) return 1; // France, Spain, Gabon, ...
if (in_array($country_code,$country_code_in_EEC)) return 1; // France, Spain, ...
return 0;
}
@ -1388,10 +1388,10 @@ class Account extends CommonObject
$fieldarray=self::getAccountNumberOrder();
}
if ($this->needIBAN()) {
//if ($this->needIBAN()) { // return always IBAN and BIC (this was old behaviour)
$fieldarray[]='IBAN';
$fieldarray[]='BIC';
}
//}
//Get the order the properties are shown
return $fieldarray;

View File

@ -152,7 +152,7 @@ if($error)
$amount = GETPOST('amount','int');
}
print load_fiche_titre($langs->trans("BankTransfer"), '', 'title_bank.png');
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'title_bank.png');
print $langs->trans("TransferDesc");
print "<br><br>";

View File

@ -1863,7 +1863,7 @@ if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
$now = dol_now();
llxHeader('', $langs->trans('Bill'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
llxHeader('', $langs->trans('InvoiceCustomer'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
// Mode creation
@ -2855,7 +2855,7 @@ else if ($id > 0 || ! empty($ref))
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="20%">' . $langs->trans('Ref') . '</td>';
print '<tr><td class="titlefield">' . $langs->trans('Ref') . '</td>';
print '<td colspan="5">';
$morehtmlright = '';
$discount = new DiscountAbsolute($db);
@ -2870,7 +2870,7 @@ else if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Ref customer
print '<tr><td width="20%">';
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
@ -3483,7 +3483,7 @@ else if ($id > 0 || ! empty($ref))
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Rate','multicurrency_tx');
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';

View File

@ -458,8 +458,8 @@ class Facture extends CommonInvoice
{
$newinvoiceline=$this->lines[$i];
$newinvoiceline->fk_facture=$this->id;
$newinvoiceline->origin = $this->element;
$newinvoiceline->origin_id = $this->lines[$i]->id;
$newinvoiceline->origin = $this->element; // TODO This seems not used. Here we but origin 'facture' but after
$newinvoiceline->origin_id = $this->lines[$i]->id; // we put an id of object !
if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
{
// Reset fk_parent_line for no child products and special product
@ -2962,9 +2962,10 @@ class Facture extends CommonInvoice
$field2='fk_paiementfourn';
}
$sql = 'SELECT pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, t.code';
$sql = 'SELECT pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code';
$sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t';
$sql.= ' WHERE pf.'.$field.' = '.$this->id;
//$sql.= ' WHERE pf.'.$field.' = 1';
$sql.= ' AND pf.'.$field2.' = p.rowid';
$sql.= ' AND p.fk_paiement = t.id';
if ($filtertype) $sql.=" AND t.code='PRE'";
@ -2978,7 +2979,7 @@ class Facture extends CommonInvoice
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep);
$retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num);
$i++;
}
$this->db->free($resql);

View File

@ -114,7 +114,7 @@ else if ($action == 'deletecontact' && $user->rights->facture->creer)
* View
*/
llxHeader('', $langs->trans("Bill"), "Facture");
llxHeader('', $langs->trans("InvoiceCustomer"));
$form = new Form($db);
$formcompany = new FormCompany($db);
@ -146,7 +146,7 @@ if ($id > 0 || ! empty($ref))
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
@ -163,13 +163,10 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Ref customer
print '<tr><td width="20%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="5">';
print '<td colspan="3">';
print $object->ref_client;
print '</td></tr>';

View File

@ -82,7 +82,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
* View
*/
llxHeader();
llxHeader('', $langs->trans("InvoiceCustomer"));
$form = new Form($db);
@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref))
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans('Ref').'</td>';
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
@ -130,13 +130,10 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Ref customer
print '<tr><td width="20%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="5">';
print '<td colspan="3">';
print $object->ref_client;
print '</td></tr>';

View File

@ -35,7 +35,7 @@ $langs->load("bills");
* View
*/
llxHeader();
llxHeader('', $langs->trans("InvoiceCustomer"));
$fac = new Facture($db);
$fac->fetch($_GET["facid"]);

View File

@ -60,7 +60,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
* View
*/
llxHeader();
llxHeader('', $langs->trans("InvoiceCustomer"));
$form = new Form($db);
@ -81,7 +81,7 @@ if ($id > 0 || ! empty($ref))
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
@ -98,13 +98,10 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Ref customer
print '<tr><td width="20%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="5">';
print '<td colspan="3">';
print $object->ref_client;
print '</td></tr>';

View File

@ -106,7 +106,7 @@ if ($action == "delete")
$now=dol_now();
llxHeader('', $langs->trans("Bill"));
llxHeader('', $langs->trans("InvoiceCustomer"));
$form = new Form($db);
@ -155,7 +155,7 @@ if ($object->id > 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="5">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
$result=$discount->fetch(0,$object->id);
@ -171,24 +171,24 @@ if ($object->id > 0)
print "</td></tr>";
// Ref customer
print '<tr><td width="20%">';
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="5">';
print '<td colspan="3">';
print $object->ref_client;
print '</td></tr>';
// Third party
print '<tr><td>'.$langs->trans('Company').'</td>';
print '<td colspan="5">'.$object->thirdparty->getNomUrl(1,'compta');
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1,'compta');
print ' &nbsp; (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans('OtherBills').'</a>)</td>';
print '</tr>';
// Type
print '<tr><td>'.$langs->trans('Type').'</td><td colspan="5">';
print '<tr><td>'.$langs->trans('Type').'</td><td colspan="3">';
print $object->getLibType();
if ($object->type == Facture::TYPE_REPLACEMENT)
{
@ -229,7 +229,7 @@ if ($object->id > 0)
print '</td></tr>';
// Discounts
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent);
else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
@ -443,7 +443,7 @@ if ($object->id > 0)
print '<tr><td>'.$langs->trans('Status').'</td>';
print '<td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
print '<tr><td>'.$langs->trans("RIB").'</td><td colspan="5">';
print '<tr><td>'.$langs->trans("RIB").'</td><td colspan="3">';
print $object->thirdparty->display_rib();
print '</td></tr>';
@ -509,7 +509,7 @@ if ($object->id > 0)
{
if ($num == 0)
{
if ($object->statut > Facture::STATUS_DRAFT) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPayed")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
if ($object->statut > Facture::STATUS_DRAFT) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPaid")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("Draft")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
}
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("RequestAlreadyDone")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
*
* 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

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -187,7 +187,7 @@ if ($action == 'delete')
* View
*/
llxHeader();
llxHeader("",$langs->trans("SalaryPayment"));
$form = new Form($db);
@ -339,7 +339,7 @@ if ($id)
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
print "<tr>";
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '</td></tr>';

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -81,7 +81,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
$form = new Form($db);
llxHeader("","",$langs->trans("SalaryPayment"));
llxHeader("",$langs->trans("SalaryPayment"));
if ($object->id)
@ -107,7 +107,7 @@ if ($object->id)
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '</td></tr>';

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
@ -221,7 +221,7 @@ if ($result)
}
print '<tr class="liste_total"><td colspan="6" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td class="liste_total" align="right">'.price($total,0,$outputlangs,1,-1,-1,$conf->currency)."</td>";
print '<td class="liste_total" align="right">'.price($total)."</td>";
print "<td></td></tr>";
print "</table>";

View File

@ -44,9 +44,7 @@ $result = restrictedArea($user, 'salaries', '', '', '');
* View
*/
$help_url='EN:Module_Salaries|FR:Module Fiche de paie|ES:M&oacute;dulo Salarios';
llxHeader("",$langs->trans("Salaries"),$help_url);
llxHeader("",$langs->trans("SalaryPayment"));
$salpayment = new PaymentSalary($db);
$result = $salpayment->fetch($id);

View File

@ -548,7 +548,7 @@ else
}
else {
print '<tr><td><label for="socid">'.$langs->trans("ThirdParty").'</label></td><td colspan="3" class="maxwidthonsmartphone">';
print $form->select_company($socid,'socid','',1);
print $form->select_company($socid,'socid','','SelectThirdParty');
print '</td></tr>';
}
}

View File

@ -429,7 +429,7 @@ abstract class CommonDocGenerator
'line_fulldesc'=>doc_getlinedesc($line,$outputlangs),
'line_product_ref'=>$line->product_ref,
'line_product_label'=>$line->product_label,
'line_product_type'=>$line->product_type,
'line_product_type'=>$line->product_type,
'line_desc'=>$line->desc,
'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits),
'line_up'=>price2num($line->subprice),
@ -443,9 +443,9 @@ abstract class CommonDocGenerator
'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs),
'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs),
'line_date_start'=>$line->date_start,
'line_date_start_rfc'=>dol_print_date($line->date_start,'rfc'),
'line_date_start_rfc'=>dol_print_date($line->date_start,'dayrfc'),
'line_date_end'=>$line->date_end,
'line_date_end_rfc'=>dol_print_date($line->date_end,'rfc')
'line_date_end_rfc'=>dol_print_date($line->date_end,'dayrfc')
);
// Retrieve extrafields

View File

@ -170,7 +170,8 @@ class HookManager
'printObjectLine',
'printObjectSubLine',
'createDictionaryFieldList',
'editDictionaryFieldlist'
'editDictionaryFieldlist',
'getFormMail'
)
)) $hooktype='addreplace';
// Deprecated hook types ('returnvalue')

View File

@ -5012,7 +5012,9 @@ class Form
*/
static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
{
global $user;
global $conf,$user;
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
$tmpvar="MAIN_SELECTEDFIELDS_".$varpage;
if (! empty($user->conf->$tmpvar))

View File

@ -140,8 +140,8 @@ class FormProjets
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
if ($socid > 0 && empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
if (!empty($filterkey)) {
$sql .= ' AND p.title LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= " AND p.title LIKE '%".$this->db->escape($filterkey)."%'";
$sql .= " OR p.ref LIKE '%".$this->db->escape($filterkey)."%'";
}
$sql.= " ORDER BY p.ref ASC";

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -25,9 +25,12 @@
* This is source documentation for Dolibarr ERP/CRM.<br>
* This documentation can be built or updated running the script <b>dolibarr-doxygen-build.pl</b> or from Eclipse with Doxygen plugin.<br>
* <br>
* Dolibarr official web site: <a href="http://www.dolibarr.org">www.dolibarr.org</a><br>
* Dolibarr official web site: <a href="https://www.dolibarr.org">www.dolibarr.org</a><br>
* <br>
* Dolibarr french portal: <a href="http://www.dolibarr.fr">www.dolibarr.fr</a><br>
* Dolibarr spanish portal: <a href="http://www.dolibarr.es">www.dolibarr.es</a><br>
* Dolibarr italian portal: <a href="http://www.dolibarr.it">www.dolibarr.it</a><br>
* Dolibarr greek portal: <a href="http://www.dolibarr.gr">www.dolibarr.gr</a><br>
* Dolibarr german portal: <a href="http://www.dolibarr.de">www.dolibarr.de</a><br>
* <br>
*/

View File

@ -182,15 +182,16 @@ function getBrowserInfo($user_agent)
elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; }
// Name
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
elseif (preg_match('/chrome(\/|\s)([\d\.]+)/i', $user_agent, $reg)) { $name='chrome'; $version=$reg[2]; } // we can have 'chrome (Mozilla...) chrome x.y' in one string
elseif (preg_match('/chrome/i', $user_agent, $reg)) { $name='chrome'; }
elseif (preg_match('/iceweasel/i', $user_agent)) { $name='iceweasel'; $version=$reg[2]; }
elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; $version=$reg[2]; }
elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
elseif (preg_match('/chrome(\/|\s)([\d\.]+)/i', $user_agent, $reg)) { $name='chrome'; $version=$reg[2]; } // we can have 'chrome (Mozilla...) chrome x.y' in one string
elseif (preg_match('/chrome/i', $user_agent, $reg)) { $name='chrome'; }
elseif (preg_match('/iceweasel/i', $user_agent)) { $name='iceweasel'; }
elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; }
elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
if ($tablet) {
$layout = 'tablet';
} elseif ($phone) {
@ -1008,26 +1009,26 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
global $conf,$langs;
$ret='';
$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
$countriesusingstate=array('AU','CA','US','IN','GB','ES','UK','TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
// Address
$ret .= $object->address;
// Zip/Town/State
if (in_array($object->country_code,array('US','AU')) || ! empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) // US: title firstname name \n address lines \n town, state, zip \n country
if (in_array($object->country_code,array('AU', 'CA', 'US')) || ! empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) // US: title firstname name \n address lines \n town, state, zip \n country
{
$ret .= ($ret ? $sep : '' ).$object->town;
if ($object->state)
{
$ret.=", ".$object->state;
$ret.=($ret?", ":'').$object->state;
}
if ($object->zip) $ret .= ', '.$object->zip;
if ($object->zip) $ret .= ($ret?", ":'').$object->zip;
}
else if (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country
{
$ret .= ($ret ? $sep : '' ).$object->town;
if ($object->state)
{
$ret.=", ".$object->state;
$ret.=($ret?", ":'').$object->state;
}
if ($object->zip) $ret .= ($ret ? $sep : '' ).$object->zip;
}
@ -5602,7 +5603,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
*
* @param string $file Original filename (full or relative path)
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image. Use '.png' for generated thumb files.
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image (default).
* @return string New file name (full or relative path, including the thumbs/)
*/
function getImageFileNameForSize($file, $extName, $extImgTarget='')

View File

@ -319,14 +319,16 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
{
for ($page=$start_page; $page <= $end_page; ++$page) {
$pdf->setPage($page);
$tmpm=$pdf->getMargins();
$tMargin = $tmpm['top'];
if ($page == $start_page) {
// first page
$height = $pdf->h - $start_y - $pdf->bMargin;
$height = $pdf->getPageHeight() - $start_y - $pdf->getBreakMargin();
} elseif ($page == $end_page) {
// last page
$height = $end_y - $pdf->tMargin;
$height = $end_y - $tMargin;
} else {
$height = $pdf->h - $pdf->tMargin - $pdf->bMargin;
$height = $pdf->getPageHeight() - $tMargin - $pdf->getBreakMargin();
}
}
}
@ -953,7 +955,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($line) // Free text
{
//$line="eee<br>\nfd<strong>sf</strong>sdf<br>\nghfghg<br>";
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) // by default
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
$width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) {

View File

@ -133,8 +133,10 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
*/
function print_start_menu_array_auguria()
{
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**

View File

@ -342,8 +342,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
*/
function print_start_menu_array()
{
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**
@ -1062,7 +1064,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/compta/bank/search.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire);
$newmenu->add("/compta/bank/budget.php",$langs->trans("ListTransactionsByCategory"),1,$user->rights->banque->lire);
$newmenu->add("/compta/bank/virement.php",$langs->trans("BankTransfers"),1,$user->rights->banque->transfer);
$newmenu->add("/compta/bank/virement.php",$langs->trans("MenuBankInternalTransfer"),1,$user->rights->banque->transfer);
}
if (! empty($conf->categorie->enabled)) {

View File

@ -307,8 +307,10 @@ class MenuManager
*/
function print_start_menu_array_empty()
{
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
* Classe permettant de generer les commandes au modele Einstein
* Classe to generate PDF orders with template Einstein
*/
class pdf_einstein extends ModelePDFCommandes
{
@ -173,7 +173,7 @@ class pdf_einstein extends ModelePDFCommandes
{
$object->fetch_thirdparty();
$deja_regle = "";
$deja_regle = 0;
// Definition of $dir and $file
if ($object->specimen)
@ -213,11 +213,12 @@ class pdf_einstein extends ModelePDFCommandes
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$pdf->SetAutoPageBreak(1,0);
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -401,7 +402,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
@ -552,11 +553,13 @@ class pdf_einstein extends ModelePDFCommandes
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
// Affiche zone versements
/*
if ($deja_regle)
{
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
}
*/
// Pied de page
$this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
@ -839,7 +842,7 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull)
{
// Nothing to do
}
@ -1103,7 +1106,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
if (empty($hidetop))

View File

@ -166,7 +166,7 @@ class pdf_crabe extends ModelePDFFactures
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{
global $user,$langs,$conf,$mysoc,$db,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
@ -251,15 +251,17 @@ class pdf_crabe extends ModelePDFFactures
// Set nblignes with the new facture lines content after hook
$nblignes = count($object->lines);
$nbpayments = count($object->getListOfPayments());
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$pdf->SetAutoPageBreak(1,0);
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -336,6 +338,11 @@ class pdf_crabe extends ModelePDFFactures
$height_incoterms = 0;
if ($conf->incoterm->enabled)
{
if (is_object($object->thirdparty))
{
$object->fk_incoterms=$object->thirdparty->fk_incoterms;
$object->location_incoterms=$object->thirdparty->location_incoterms;
}
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)
{
@ -484,7 +491,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
@ -551,7 +558,7 @@ class pdf_crabe extends ModelePDFFactures
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne= $sign * $object->lines[$i]->multicurrency_total_tva;
else $tvaligne= $sign * $object->lines[$i]->total_tva;
}
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
@ -746,6 +753,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','', $default_font_size - 4);
// Loop on each deposits and credit notes included
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql.= " re.description, re.fk_facture_source,";
@ -790,12 +798,15 @@ class pdf_crabe extends ModelePDFFactures
}
// Loop on each payment
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
// TODO Call getListOfPaymentsgetListOfPayments instead of hard coded sql
$sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount,";
$sql.= " cp.code";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
//$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1";
$sql.= " ORDER BY p.datep";
$resql=$this->db->query($sql);
if ($resql)
{
@ -1037,7 +1048,7 @@ class pdf_crabe extends ModelePDFFactures
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull)
{
// Nothing to do
}
@ -1347,7 +1358,7 @@ class pdf_crabe extends ModelePDFFactures
}
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
if (empty($hidetop))
@ -1584,7 +1595,7 @@ class pdf_crabe extends ModelePDFFactures
$posy=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
$posx=$this->marge_gauche;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
$hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;

View File

@ -20,7 +20,7 @@
/**
* \defgroup document Module mass mailings
* \brief Module pour gerer des generations de documents
* \file htdocs/core/modules/modDocument.class.php
* \file htdocs/core/modules/modDocumentGeneration.class.php
* \ingroup document
* \brief Fichier de description et activation du module Generation document
*/

View File

@ -145,7 +145,7 @@ class modOpenSurvey extends DolibarrModules
'langs'=>'opensurvey',
'position'=>200,
'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled.
'perms'=>'',
'perms'=>'$user->rights->opensurvey->read',
'target'=>'',
'user'=>0);
$r++;
@ -173,7 +173,7 @@ class modOpenSurvey extends DolibarrModules
'langs'=>'opensurvey',
'position'=>220,
'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled.
'perms'=>'',
'perms'=>'$user->rights->opensurvey->read',
'target'=>'',
'user'=>0);
$r++;

View File

@ -190,7 +190,7 @@ class modResource extends DolibarrModules
$r++;
$this->rights[$r][0] = 63004;
$this->rights[$r][1] = 'Link resources';
$this->rights[$r][1] = 'Link resources to agenda events';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'link';
$r++;

View File

@ -77,7 +77,7 @@ class modSociete extends DolibarrModules
$this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codeclient_leopard";
$this->const[$r][2] = "mod_codeclient_monkey";
$this->const[$r][3] = 'Module to control third parties codes';
$this->const[$r][4] = 0;
$r++;

View File

@ -91,8 +91,8 @@ class pdf_azur extends ModelePDFPropales
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 1; // Affiche si il y a eu escompte
$this->option_credit_note = 1; // Support credit notes
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
@ -230,7 +230,7 @@ class pdf_azur extends ModelePDFPropales
{
$object->fetch_thirdparty();
// $deja_regle = 0;
$deja_regle = 0;
// Definition of $dir and $file
if ($object->specimen)
@ -270,11 +270,8 @@ class pdf_azur extends ModelePDFPropales
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -323,12 +320,20 @@ class pdf_azur extends ModelePDFPropales
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0;
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
$this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top = 90;
$tab_top = 90;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
$tab_height = 130;
$tab_height_newpage = 150;
@ -406,7 +411,7 @@ class pdf_azur extends ModelePDFPropales
if (! empty($realpatharray[$i])) $imglinesize=pdf_getSizeForImage($realpatharray[$i]);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforsignature+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
$showpricebeforepagebreak=1;
@ -414,7 +419,7 @@ class pdf_azur extends ModelePDFPropales
$posYAfterDescription=0;
// We start with Photo of product line
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforsignature+$heightforinfotot))) // If photo too high, we moved completely on new page
{
$pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -436,9 +441,10 @@ class pdf_azur extends ModelePDFPropales
// Description of product line
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
@ -451,7 +457,7 @@ class pdf_azur extends ModelePDFPropales
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforsignature+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
{
@ -488,7 +494,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
@ -624,13 +630,13 @@ class pdf_azur extends ModelePDFPropales
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1;
}
// Affiche zone infos
@ -765,7 +771,7 @@ class pdf_azur extends ModelePDFPropales
/**
* Show payments table
*
* @param PDF $pdf Object PDF
* @param TCPDF $pdf Object PDF
* @param Object $object Object proposal
* @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output
@ -780,7 +786,7 @@ class pdf_azur extends ModelePDFPropales
/**
* Show miscellaneous information (payment mode, payment term, ...)
*
* @param PDF $pdf Object PDF
* @param TCPDF $pdf Object PDF
* @param Object $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
@ -1002,7 +1008,7 @@ class pdf_azur extends ModelePDFPropales
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull)
{
// Nothing to do
}
@ -1292,7 +1298,7 @@ class pdf_azur extends ModelePDFPropales
}
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
if (empty($hidetop))
@ -1594,7 +1600,6 @@ class pdf_azur extends ModelePDFPropales
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab_top = $posy + 4;
$tab_hl = 4;
$pdf->SetFont('','', $default_font_size - 1);
$posx = 120;
$largcol = ($this->page_largeur - $this->marge_droite - $posx);
@ -1607,7 +1612,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1);
$pdf->SetXY($posx, $tab_top + $tab_hl);
$pdf->MultiCell($largcol, $tab_hl*6, '', 1, 'R');
$pdf->MultiCell($largcol, $tab_hl*3, '', 1, 'R');
return ($tab_hl*7);
}

View File

@ -850,7 +850,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull)
{
// Nothing to do
}

View File

@ -283,7 +283,7 @@ if ($action == 'builddoc')
* View
*/
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
llxHeader('',$langs->trans("Donation"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
$form=new Form($db);
$formfile = new FormFile($db);
@ -424,7 +424,7 @@ if (! empty($id) && $action == 'edit')
print '<table class="border" width="100%">';
// Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
print $object->getNomUrl();
print '</td>';
print '</tr>';
@ -554,13 +554,13 @@ if (! empty($id) && $action != 'edit')
if (! empty($conf->projet->enabled)) $nbrows++;
// Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="2">';
print $form->showrefnav($object, 'rowid', $linkback, 1, 'rowid', 'ref', '');
print '</td>';
print '</tr>';
// Date
print '<tr><td width="25%">'.$langs->trans("Date").'</td><td colspan="2">';
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
print dol_print_date($object->date,"day");
print "</td>";

View File

@ -81,7 +81,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
$form = new Form($db);
llxHeader("","",$langs->trans("Donations"));
llxHeader("",$langs->trans("Donation"));
if ($object->id)
@ -107,7 +107,7 @@ if ($object->id)
$linkback = '<a href="'.DOL_URL_ROOT.'/don/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '</td></tr>';

View File

@ -38,7 +38,7 @@ $result = restrictedArea($user, 'don', $id, '');
* View
*/
llxHeader();
llxHeader("",$langs->trans("Donation"));
if ($id)
{

View File

@ -239,14 +239,15 @@ class EcmDirectory // extends CommonObject
/**
* Update cache of nb of documents into database
*
* @param string $sign '+' or '-'
* @param string $value '+' or '-' or new number
* @return int <0 if KO, >0 if OK
*/
function changeNbOfFiles($sign)
function changeNbOfFiles($value)
{
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
$sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1";
if (preg_match('/[0-9]+/', $value)) $sql.= " cachenbofdoc = ".(int) $value;
else $sql.= " cachenbofdoc = cachenbofdoc ".$value." 1";
$sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::changeNbOfFiles", LOG_DEBUG);
@ -256,6 +257,12 @@ class EcmDirectory // extends CommonObject
$this->error="Error ".$this->db->lasterror();
return -1;
}
else
{
if (preg_match('/[0-9]+/', $value)) $this->cachenbofdoc = (int) $value;
else if ($value == '+') $this->cachenbofdoc++;
else if ($value == '-') $this->cachenbofdoc--;
}
return 1;
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2016 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
@ -272,7 +272,13 @@ print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
print '/ecm/'.$relativepath;
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>';
print count($filearray);
$nbofiles=count($filearray);
print $nbofiles;
// Test if nb is same than in cache
if ($nbofiles != $ecmdir->cachenbofdoc)
{
$ecmdir->changeNbOfFiles((string) $nbofiles);
}
print '</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
print dol_print_size($totalsize);

View File

@ -201,8 +201,11 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
}
// Refresh directory view
// This refresh list of dirs, not list of files (for preformance reason). List of files is refresh only if dir was not synchronized.
// To refresh content of dir with cache, just open the dir in edit mode.
if ($action == 'refreshmanual')
{
$ecmdirtmp = new EcmDirectory($db);
// This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate

View File

@ -50,6 +50,7 @@ $(document).ready(function() {
);
$('#refreshbutton').click( function() {
console.log("Click on refreshbutton");
$.pleaseBePatient("<?php echo $langs->trans('PleaseBePatient'); ?>");
$.get( "<?php echo DOL_URL_ROOT . '/ecm/ajax/ecmdatabase.php'; ?>", {
action: "build",

View File

@ -682,6 +682,10 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessages($langs->transnoentitiesnoconv("OnlyOwnerCanCancel"), '', 'errors'); // Should not happened
}
}
if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->creer)
@ -1782,24 +1786,21 @@ else
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
{
print '<tr class="liste_titre">';
print '<td colspan="2"></td>';
//print '<td style="text-align:center;">'.$langs->trans('Date').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
if (! empty($conf->projet->enabled)) print '<td>'.$langs->trans('Project').'</td>';
print '<td align="center">'.$langs->trans('Type').'</td>';
print '<td>'.$langs->trans('Description').'</td>';
print '<td style="text-align:right;">'.$langs->trans('VAT').'</td>';
print '<td style="text-align:right;">'.$langs->trans('PriceUTTC').'</td>';
print '<td style="text-align:right;">'.$langs->trans('Qty').'</td>';
print '<td align="right">'.$langs->trans('VAT').'</td>';
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
print '<td align="right">'.$langs->trans('Qty').'</td>';
print '<td colspan="3"></td>';
print '</tr>';
print '<tr '.$bc[true].'>';
print '<td></td>';
// Select date
print '<td style="text-align:center;">';
print '<td align="center">';
$form->select_date($date?$date:-1,'date');
print '</td>';
@ -1822,29 +1823,29 @@ else
print '</td>';
// Select VAT
print '<td style="text-align:right;">';
print '<td align="right">';
$defaultvat=-1;
if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false);
print '</td>';
// Unit price
print '<td style="text-align:right;">';
print '<td align="right">';
print '<input type="text" size="5" name="value_unit" value="'.$value_unit.'">';
print '</td>';
// Quantity
print '<td style="text-align:right;">';
print '<td align="right">';
print '<input type="text" size="2" name="qty" value="'.($qty?$qty:1).'">';
print '</td>';
if ($action != 'editline')
{
print '<td style="text-align:right;"></td>';
print '<td style="text-align:right;"></td>';
print '<td align="right"></td>';
print '<td align="right"></td>';
}
print '<td style="text-align:center;"><input type="submit" value="'.$langs->trans("Add").'" name="bouton" class="button"></td>';
print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'" name="bouton" class="button"></td>';
print '</tr>';
} // Fin si c'est payé/validé
@ -1904,12 +1905,6 @@ if ($action != 'create' && $action != 'edit')
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=save&id='.$object->id.'">'.$langs->trans('ValidateAndSubmit').'</a>';
}
if ($user->rights->expensereport->supprimer)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
}
}
@ -1929,12 +1924,6 @@ if ($action != 'create' && $action != 'edit')
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=brouillonner&id='.$id.'">'.$langs->trans('BROUILLONNER').'</a>';
// Enregistrer depuis le statut "Refusée"
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=save_from_refuse&id='.$object->id.'">'.$langs->trans('ValidateAndSubmit').'</a>';
if ($user->rights->expensereport->supprimer)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
}
}
@ -1976,23 +1965,18 @@ if ($action != 'create' && $action != 'edit')
// Cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a>';
}
if($user->rights->expensereport->supprimer)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
}
// If status is Appoved
// --------------------
if ($user->rights->expensereport->approve && $object->fk_statut == 5)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=refuse&id='.$object->id.'">'.$langs->trans('Deny').'</a>';
}
/* Si l'état est "A payer"
* ET user à droit de "to_paid"
* Afficher : "Annuler" / "Payer" / "Supprimer"
*/
// If bank module is used
if ($user->rights->expensereport->to_paid && ! empty($conf->banque->enabled) && $object->fk_statut == 5)
{
// Pay
@ -2006,59 +1990,41 @@ if ($action != 'create' && $action != 'edit')
}
}
// If bank module is not used
if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == 5)
{
if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
}
// Cancel
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a>';
}
// Delete
if($user->rights->expensereport->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
}
/* Si l'état est "Payée"
* ET user à droit "approve"
* ET user à droit "to_paid"
* Afficher : "Annuler"
*/
if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_statut==6)
if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == 5)
{
// Cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a>';
if($user->rights->expensereport->supprimer)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
// Cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a>';
}
/* Si l'état est "Annulée"
* ET user à droit "supprimer"
* Afficher : "Supprimer"
*/
if ($user->rights->expensereport->supprimer && $object->fk_statut==4)
// TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled.
if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == 6)
{
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
{
// Brouillonner
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=brouillonner&id='.$object->id.'">'.$langs->trans('ReOpen').'</a>';
}
// Delete
// Cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a>';
}
/* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */
if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
else if($user->rights->expensereport->supprimer && $object->fk_statut != 6)
{
// Delete
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';

View File

@ -81,7 +81,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
$form = new Form($db);
llxHeader("","",$langs->trans("TripCard"));
llxHeader("",$langs->trans("ExpenseReport"));
if ($object->id)
@ -107,7 +107,7 @@ if ($object->id)
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';

View File

@ -1865,7 +1865,7 @@ elseif (! empty($object->id))
print '<tr>';
print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Rate','multicurrency_tx');
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';

View File

@ -1657,7 +1657,7 @@ else
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td class="nowrap" width="20%">'.$langs->trans("Ref").'</td><td colspan="4">';
print '<tr><td class="titlefield nowrap">'.$langs->trans("Ref").'</td><td colspan="4">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td>';
print "</tr>\n";
@ -1902,7 +1902,7 @@ else
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Rate','multicurrency_tx');
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';

View File

@ -112,7 +112,7 @@ else if ($action == 'deletecontact' && $user->rights->fournisseur->facture->cree
* View
*/
llxHeader('', $langs->trans("Bill"), "Facture");
llxHeader('',$langs->trans('SupplierInvoice'));
$form = new Form($db);
$formcompany = new FormCompany($db);
@ -144,7 +144,7 @@ if ($id > 0 || ! empty($ref))
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Reference du facture
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print "</td></tr>";

View File

@ -81,7 +81,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
$form = new Form($db);
llxHeader();
llxHeader('',$langs->trans('SupplierInvoice'));
if ($object->id > 0)
{
@ -110,7 +110,7 @@ if ($object->id > 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print '<tr><td class="titlefield nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td>';
print "</tr>\n";
@ -197,7 +197,7 @@ if ($object->id > 0)
print '<table class="border" width="100%">';
// Nb of files
print '<tr><td width="30%" class="nowrap">'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td class="titlefield nowrap">'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalSizeOfAttachedFiles').'</td><td colspan="3">'.$totalsize.' '.$langs->trans('bytes').'</td></tr>';

View File

@ -43,7 +43,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
* View
*/
llxHeader();
llxHeader('',$langs->trans('SupplierInvoice'));
$object = new FactureFournisseur($db);
$object->fetch($id);

View File

@ -67,7 +67,7 @@ if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer)
$form = new Form($db);
llxHeader();
llxHeader('',$langs->trans('SupplierInvoice'));
if ($object->id > 0)
{
@ -83,7 +83,7 @@ if ($object->id > 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="20%" class="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print '<tr><td class="titlefield nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '</td>';
print "</tr>\n";
@ -167,7 +167,6 @@ if ($object->id > 0)
print '<br>';
$colwidth=20;
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();

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