Merge branch '3.6' of github.com:Dolibarr/dolibarr into 3.6

This commit is contained in:
Maxime Kohlhaas 2014-10-06 10:05:48 +02:00
commit 386f4bd82e
497 changed files with 23951 additions and 10553 deletions

View File

@ -21,7 +21,7 @@ NuSoap 0.9.5 LGPL 2.1+ Yes
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
PHPExcel 1.7.6 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
TCPDF 6.0.021 LGPL-3+ Yes PDF generation
TCPDF 6.0.093 LGPL-3+ Yes PDF generation
JS libraries:
jQuery 1.8.2 MIT License Yes JS library

View File

@ -2,6 +2,32 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users:
- Fix: Can upload files on services.
- Fix: sql errors on updat fichinter.
- Fix: debian script syntax error.
- Fix: error "menu param is not inside list" into pos module.
- Fix: Salary payments are not reflected on the reporting sheets.
- Fix: Unsubscribe emailing not working.
- Fix: Trigger on create category call failed because user is not passed on card.
- Fix: list event view lost type event filter.
- Fix: Save also code event.
- Fix: VAT payment - Add control on field date value.
- Fix: Salaries payment - Field date value is now required and add control on it.
- Fix: Iban was used instead of Bic into SEPA file.
- Fix: Must unaccent strings into SEPA file.
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
- Fix: cents for indian ruppes are calle paisa and paise.
- Fix: Invoices payments may be older than invoices.
- Fix: Withdrawal total amount is double
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
- Fix: Web service categorie WDSL declaration is correct
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
- Fix: Category creation failed and no message output
- Fix: Lanf for Payment Type
- Fix: PHPCheckstyle 1.5.5
***** ChangeLog for 3.6 compared to 3.5.* *****
For users:
- New: Update ckeditor to version 4.
@ -111,9 +137,34 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click)
Fix: Fusion PDF button on unpaid invoice is no more displayed.
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
Fix: Pb when showing log list of holiday module with some mysql versions.
Fix: Error with bad timezone pushed by some browsers.
Fix: shipping list SQL request was not filtering on shipping element
Fix: debian package provided by dolibarr team must use embedded libraries.
Fix: [ bug #1528 ] Leopard Services numeration module description is not translated.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances.
Fix: Update impayees.php
Fix: Link product, In list view and label product.
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
Fix: When disabled, all fields to add time into task line must be disabled.
Fix: Missing include files.lib.php in some pages that use dol_delete_recursive
Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref.
Fix: [ bug #1553 ] Saving User displays setup removes menu.
Fix: [ bug #1544 ] Can remove date from invoice.
Fix: list event view lost type event filter.
Fix: Add code save on create event.
Fix: SQL injection.
Fix: [ bug #1589 ] Menu type in "Edit menu" page is not translated
Fix: [ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them
Fix: [ bug #1577 ] When creating new Private individual third, selected third type is ignored
Fix: [ bug #1555 ] Update accountancy code of products does not throw PRODUCT_MODIFY trigger
Fix: [ bug #1548 ] Supplier payment card shows type in French
Fix: [ bug #1546 ] Incorrect page number when searching in the list of bank transactions
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.
@ -423,6 +474,7 @@ Fix: Add a limit into list to avoid browser to hang when database is too large.
Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
Fix: Agenda and Banks module were not working with multicompany module
Fix: [ bug #1317 ] Removing a category does not remove all child categories
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB).

View File

@ -1,3 +1,10 @@
dolibarr (3.6.1-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 23 Sep 2014 12:00:00 +0100
dolibarr (3.6.0-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]

View File

@ -39,7 +39,7 @@ Description: Web based software to manage a company or foundation
It's a web software you can install as a standalone program or on any web
hosting provider to use it from anywhere with any web browser.
.
Dolibarr was designed to be easy to use. Only the features that you need
Dolibarr was designed to be easy to use. Only the features that you need
are visible, depending on which modules were activated.
.
This is an example of most common used modules:
@ -68,4 +68,4 @@ Description: Web based software to manage a company or foundation
PDF exports,
And a lot more modules...
.
You can also add third parties external modules or develop yours.
You can also add external modules from third parties or develop yours.

View File

@ -61,7 +61,7 @@ License: GPL-3+
Files: htdocs/includes/adodbtime/*
Copyright: 2003-2005, John Lim
unknown, jackbbs
License: BSD
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@ -272,7 +272,7 @@ Comment:
Files: htdocs/includes/jquery/plugins/flot/*
Copyright: Flot team
License: Public Domain
License: Public-Domain
This work is not subject to copyright in any jurisdiction
Comment:
Those files are not shipped in the binary package because we configure

View File

@ -129,7 +129,7 @@ case "$1" in
then
# Create an empty conf.php with permission to web server
setup_empty_conf
else
#else
# File already exist. We add params not found.
#echo Add new params to overwrite path to use shared libraries/fonts
#grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config

View File

@ -8,16 +8,20 @@ echo "tmpdir = $tmpdir"
if [ -n "$1" ]; then
uscan_opts="--download-version=$1"
fi
uscan --noconf --force-download --no-symlink --verbose --destdir=$tmpdir $uscan_opts
#uscan --noconf --force-download --no-symlink --verbose --destdir=$tmpdir $uscan_opts
cd $tmpdir
# Other method to download (comment uscan if you use this)
wget http://www.dolibarr.org/files/stable/standard/dolibarr-3.5.4.tgz
# Rename file to add +dfsg
tgzfile=$(echo *.tgz)
version=$(echo "$tgzfile" | perl -pi -e 's/^dolibarr-//; s/\.tgz$//; s/_/./g; s/\+nmu1//; ')
cd - >/dev/null
mv $tmpdir/dolibarr-${version}.tgz ../
echo "File ../dolibarr-${version}.tgz is ready for git-import"
echo "File ../dolibarr-${version}.tgz is ready for git-import-orig"
rm -rf $tmpdir

View File

@ -17,9 +17,9 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.6.0
AppVerName=DoliWamp-3.6.1
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
OutputBaseFilename=DoliWamp-3.6.0
OutputBaseFilename=DoliWamp-3.6.1
; ----- End of change
;OutputManifestFile=build\doliwampbuild.log
; Define full path from which all relative path are defined
@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com
AppSupportURL=http://www.dolibarr.org
AppUpdatesURL=http://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
AppCopyright=Copyright (C) 2008-2014 Laurent Destailleur, NLTechno
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
@ -108,8 +108,8 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
; Mysql data files (does not overwrite if exists)
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*"
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,nltechno*\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,default.properties,install.lock"

View File

@ -442,6 +442,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
@ -460,8 +461,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
@ -610,9 +611,6 @@ if ($nboftargetok) {
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
#print "Create directory $RPMDIR\n";
#$ret=`mkdir -p "$RPMDIR"`;
print "Remove target ".$FILENAMERPM."...\n";
unlink("$NEWDESTI/".$FILENAMERPM);
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
@ -620,13 +618,13 @@ if ($nboftargetok) {
print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
$ret=`$cmd`;
# Set owners
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
# Removed files we don't need
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`;
print "Set permissions on files/dir\n";
$ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
@ -747,10 +745,18 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
# Removed duplicate license files
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`;
# Removed files we don't need
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`;
# Rename upstream changelog to match debian rules
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;

View File

@ -36,14 +36,13 @@ complete release of Dolibarr, step by step.
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z in build/rpm/*.spec
- Commit all changes.
- Add a Tag (x.y.z)
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
- Check content of built packages.
- Move build files into www.dolibarr.org web site
(/home/dolibarr/wwwroot/files/stable).
- Run makepack-dolibarr.pl again with option to publish files on
sourceforge.
sourceforge. This will also add official tag.
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
on server to point to new files (used by some web sites).

View File

@ -333,6 +333,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release

View File

@ -569,6 +569,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release

View File

@ -338,6 +338,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release

View File

@ -349,6 +349,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
htdocs/.gitignore vendored
View File

@ -2,6 +2,7 @@
/custom*
/extensions*
/nltechno*
/teclib*
/bootstrap*
/google*
/multicompany*

View File

@ -94,7 +94,7 @@ abstract class ActionsAdherentCardCommon
/**
* Load data control
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id of object
* @return void
*/
@ -228,7 +228,7 @@ abstract class ActionsAdherentCardCommon
/**
* Set content of ->tpl array, to use into template
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id
* @return string HTML output
*/

View File

@ -76,7 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
/**
* Assign custom values for canvas
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id
* @return void
*/

View File

@ -1081,7 +1081,7 @@ class Adherent extends CommonObject
if ($rowid) $sql.= " AND d.rowid=".$rowid;
elseif ($ref || $fk_soc) {
$sql.= " AND d.entity IN (".getEntity().")";
if ($ref) $sql.= " AND d.rowid='".$ref."'";
if ($ref) $sql.= " AND d.rowid='".$this->db->escape($ref)."'";
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
}
elseif ($ref_ext)

View File

@ -328,6 +328,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
{
if (GETPOST('deletephoto'))
{
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/'.$object->photo;
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/thumbs';
dol_delete_file($fileimg);

View File

@ -534,4 +534,3 @@ print '<br>';
llxFooter();
$db->close();
?>

View File

@ -473,7 +473,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
}*/
}
if (isset($_POST["country"]) && $_POST["country"]=='0') {
if (isset($_POST["country"]) && $_POST["country"]=='0')
{
$ok=0;
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
}
@ -532,7 +533,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$result = $db->query($sql);
if ($result) // Add is ok
{
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
setEventMessage($langs->transnoentities("RecordSaved"));
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
}
else
{

View File

@ -500,7 +500,7 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($def as $reldir)
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
{

View File

@ -219,6 +219,10 @@ if (function_exists("ldap_connect"))
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup
if(in_array('posixGroup',$info['objectclass']))
$info['gidNumber'] = $ldap->getNextGroupGid();
$result1=$ldap->delete($dn); // To be sure to delete existing records
$result2=$ldap->add($dn,$info,$user); // Now the test
$result3=$ldap->delete($dn); // Clean what we did

View File

@ -206,9 +206,9 @@ else
// Add vat rates examples specific to country
$vat_rates=array();
$sql.="SELECT taux as vat_rate";
$sql="SELECT taux as vat_rate";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.=" WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$mysoc->country_code."' AND taux != 0";
$sql.=" WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$mysoc->country_code."' AND taux <> 0";
$sql.=" ORDER BY t.taux ASC";
$resql=$db->query($sql);
if ($resql)

View File

@ -317,7 +317,7 @@ if ($action == 'create')
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>';
if ($parent_rowid)
{
print 'Left';
print $langs->trans('Left');
print '<input type="hidden" name="type" value="left">';
}
else

View File

@ -143,4 +143,3 @@ print '</table>';
llxFooter();
$db->close();
?>

View File

@ -77,7 +77,7 @@ if($action)
if($action == 'STOCK_USE_VIRTUAL_STOCK') {
$res = dolibarr_set_const($db, "STOCK_USE_VIRTUAL_STOCK", GETPOST('STOCK_USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity);
}
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_INVOICE') {
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_INVOICE", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_INVOICE','alpha'),'chaine',0,'',$conf->entity);
}
@ -329,7 +329,7 @@ if ($virtualdiffersfromphysical)
print '</table>';
}
$db->close();
llxFooter();
?>
$db->close();

View File

@ -81,7 +81,7 @@ else
print '<td width="300">'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '</tr>'."\n";
// arraytest is an array of test to do
$arraytest=array();
if (preg_match('/mysql/i',$db->type))
@ -91,7 +91,7 @@ else
'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_general_ci')
);
}
$listtouse=array();
if ($listname == 'listofvars') $listtouse=$listofvars;
if ($listname == 'listofstatus') $listtouse=$listofstatus;
@ -124,4 +124,5 @@ else
}
llxFooter();
?>
$db->close();

View File

@ -130,4 +130,3 @@ else
llxFooter();
$db->close();
?>

View File

@ -379,4 +379,3 @@ print '</table>';
llxFooter();
$db->close();
?>

View File

@ -118,5 +118,3 @@ print info_admin($langs->trans("SystemInfoDesc")).'<br>';
llxFooter();
$db->close();
?>

View File

@ -350,4 +350,3 @@ print "<br><br>";
llxFooter();
$db->close();
?>

View File

@ -166,4 +166,3 @@ if (preg_match('/^confirm/i',$choice))
llxFooter();
$db->close();
?>

View File

@ -23,7 +23,7 @@
*/
require '../../main.inc.php';
include_once $dolibarr_main_document_root.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("other");
@ -174,4 +174,3 @@ if (! empty($result['return']))
llxFooter();
$db->close();
?>

View File

@ -69,4 +69,3 @@ print $langs->trans("SeeAlso").': <a href="'.$urlwikitranslatordoc.'" target="_b
llxFooter();
$db->close();
?>

View File

@ -146,4 +146,3 @@ print '</table>';
llxFooter();
$db->close();
?>

View File

@ -55,6 +55,8 @@ print '</div>';
print '<div class="principal">';
$page=GETPOST('menu','alpha');
if (empty($page)) $page='facturation';
if (in_array(
$page,
array(

View File

@ -75,4 +75,3 @@ include_once 'affPied.php';
print '</div></div></div>'."\n";
print '</body></html>'."\n";
?>

View File

@ -191,5 +191,3 @@ $obj_facturation->paiementLe('RESET');
// Affichage des templates
require ('tpl/facturation1.tpl.php');
?>

View File

@ -39,6 +39,7 @@ if ( $_SESSION['uid'] > 0 )
}
$usertxt=GETPOST('user','',1);
$err=GETPOST("err");
/*
@ -64,7 +65,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
<div class="contenu">
<div class="principal_login">
<?php if (! empty($_GET["err"])) print $_GET["err"]."<br><br>\n"; ?>
<?php if ($err) print dol_escape_htmltag($err)."<br><br>\n"; ?>
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Identification"); ?></legend>
<form id="frmLogin" method="POST" action="index_verif.php">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />

View File

@ -78,4 +78,3 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
}
print '</li></ul>';
print '</div>';
?>

View File

@ -74,7 +74,7 @@ class Categorie extends CommonObject
function fetch($id,$label='')
{
global $conf;
// Check parameters
if (empty($id) && empty($label)) return -1;
@ -137,7 +137,7 @@ class Categorie extends CommonObject
* -3 : categorie invalide
* -4 : category already exists
*/
function create($user='')
function create($user)
{
global $conf,$langs,$hookmanager;
$langs->load('categories');
@ -1137,11 +1137,11 @@ class Categorie extends CommonObject
$cats = array();
$typeid=-1; $table='';;
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; }
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; }
else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
else if ($type == '2' || $type == 'customer') { $typeid=2; $table='societe'; $type='societe'; }
else if ($type == '3' || $type == 'member') { $typeid=3; $table='member'; $type='member'; }
else if ($type == '4' || $type == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
else if ($type == '4' || $type == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
$sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";

View File

@ -138,11 +138,13 @@ if ($action == 'add' && $user->rights->categorie->creer)
// Create category in database
if (! $error)
{
$result = $object->create();
$result = $object->create($user);
if ($result > 0)
{
$action = 'confirmed';
$_POST["addcat"] = '';
} else {
setEventMessage($object->error,'errors');
}
}
}

View File

@ -520,4 +520,3 @@ if($object->type == 4)
llxFooter();
$db->close();
?>

View File

@ -140,6 +140,7 @@ class ActionComm extends CommonObject
if ($result > 0)
{
$this->type_id=$cactioncomm->id;
$this->code=$cactioncomm->code;
}
else if ($result == 0)
{
@ -283,7 +284,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname";
@ -877,7 +878,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location,";
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " u.firstname, u.lastname,";
$sql.= " s.nom as socname,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
@ -1070,4 +1071,3 @@ class ActionComm extends CommonObject
}
?>

View File

@ -966,7 +966,7 @@ llxFooter();
* @param int $year Year
* @param int $monthshown Current month shown in calendar view
* @param string $style Style to use for this day
* @param array &$eventarray Array of events
* @param array $eventarray Array of events
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
* @param int $maxnbofchar Nb of characters to show for event line
* @param string $newparam Parameters on current URL

View File

@ -195,7 +195,7 @@ if ($resql)
$head = calendars_prepare_head('');
dol_fiche_head($head, 'card', $langs->trans('Events'), 0, 'list');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1);
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,$actioncode);
dol_fiche_end();
// Add link to show birthdays

View File

@ -821,11 +821,11 @@ if ($id > 0)
/*
* Barre d'actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
print '<div class="tabsAction">';
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
@ -933,4 +933,3 @@ dol_htmloutput_mesg('',$mesgs);
// End of page
llxFooter();
$db->close();
?>

View File

@ -612,12 +612,12 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
// On defini prix unitaire
if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level)
{
$pu_ht = $prod->multiprices [$object->client->price_level];
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
$pu_ht = $prod->multiprices[$object->client->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{

View File

@ -8,7 +8,7 @@
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-214 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>
*
* This program is free software; you can redistribute it and/or modify
@ -797,7 +797,10 @@ class Propal extends CommonObject
$fk_parent_line,
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label
$this->lines[$i]->label,
$this->lines[$i]->date_start,
$this->lines[$i]->date_end,
$this->lines[$i]->array_options
);
if ($result < 0)
@ -932,6 +935,10 @@ class Propal extends CommonObject
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,6 +28,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@ -52,17 +55,23 @@ foreach($linkedObjectBlock as $object)
<a href="<?php echo DOL_URL_ROOT.'/comm/propal.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowPropal"),"propal").' '.$object->ref; ?></a></td>
<td><?php echo $object->ref_client; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->propale->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="3"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->propale->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@ -1,15 +1,15 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 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) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012 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>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
@ -291,6 +291,13 @@ class Commande extends CommonOrder
}
}
// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}
if (! $error)
{
// Appel des triggers
@ -301,13 +308,6 @@ class Commande extends CommonOrder
// Fin appel triggers
}
// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}
if (! $error)
{
$this->db->commit();
@ -725,7 +725,8 @@ class Commande extends CommonOrder
$fk_parent_line,
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label
$this->lines[$i]->label,
$this->lines[$i]->array_options
);
if ($result < 0)
{
@ -863,6 +864,10 @@ class Commande extends CommonOrder
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);

View File

@ -156,7 +156,7 @@ if ($resql)
print "<tr ".$bc[$var].">";
print '<td>';
$result='';
$lien=$lienfin='';
$lien = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">';
@ -164,7 +164,7 @@ if ($resql)
$name=$obj->nom;
$result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
$result.=$lien.(dol_trunc($name,$maxlen)).$lienfin;
print $result;
print '</td>';
print '<td>'.$obj->town.'&nbsp;</td>';
@ -185,7 +185,7 @@ else
dol_print_error($db);
}
llxFooter();
$db->close();
llxFooter();
?>

View File

@ -269,10 +269,12 @@ else if ($action == 'add' && $user->rights->commande->creer) {
if ($ret < 0)
$error ++;
if (! $error) {
if (! $error)
{
$object_id = $object->create($user);
if ($object_id > 0) {
if ($object_id > 0)
{
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
$classname = ucfirst($subelement);
@ -280,15 +282,20 @@ else if ($action == 'add' && $user->rights->commande->creer) {
dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
$result = $srcobject->fetch($object->origin_id);
if ($result > 0) {
if ($result > 0)
{
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject, 'fetch_lines'))
$lines = $srcobject->fetch_lines();
{
$srcobject->fetch_lines();
$lines = $srcobject->lines;
}
$fk_parent_line = 0;
$num = count($lines);
for($i = 0; $i < $num; $i ++) {
for($i = 0; $i < $num; $i ++)
{
$label = (! empty($lines [$i]->label) ? $lines [$i]->label : '');
$desc = (! empty($lines [$i]->desc) ? $lines [$i]->desc : $lines [$i]->libelle);
$product_type = (! empty($lines [$i]->product_type) ? $lines [$i]->product_type : 0);
@ -581,8 +588,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{

View File

@ -34,7 +34,7 @@ $langs->load("sendings");
// Security check
$socid=0;
$comid = isset($_GET["id"])?$_GET["id"]:'';
$comid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'commande',$comid,'');
@ -47,8 +47,8 @@ $result=restrictedArea($user,'commande',$comid,'');
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
$commande = new Commande($db);
$commande->fetch($_GET["id"]);
$commande->info($_GET["id"]);
$commande->fetch($comid);
$commande->info($comid);
$soc = new Societe($db);
$soc->fetch($commande->socid);

View File

@ -340,7 +340,7 @@ if ($resql)
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
print img_picto($langs->trans("Late"),"warning");
if(!empty($objp->note_private))
{

View File

@ -45,7 +45,7 @@ $langs->load('companies');
if (! $user->rights->facture->creer)
accessforbidden();
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$id = (GETPOST('id')?GETPOST('id','int'):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
@ -97,7 +97,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('bills');
$langs->load('products');
$langs->load('main');
@ -213,13 +213,17 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$result=$objectsrc->fetch($orders_id[$ii]);
if ($result > 0)
{
if ($closeOrders)
if ($closeOrders)
{
$objectsrc->classifyBilled();
$objectsrc->setStatut(3);
}
$lines = $objectsrc->lines;
if (empty($lines) && method_exists($objectsrc,'fetch_lines')) $lines = $objectsrc->fetch_lines();
if (empty($lines) && method_exists($objectsrc, 'fetch_lines'))
{
$objectsrc->fetch_lines();
$lines = $objectsrc->lines;
}
$fk_parent_line=0;
$num=count($lines);
for ($i=0;$i<$num;$i++)

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,6 +23,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@ -47,17 +50,23 @@ foreach($linkedObjectBlock as $object)
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->commande->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->commande->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -259,17 +259,22 @@ if ($id > 0 || ! empty($ref))
//Total pages
$totalPages = ceil($total_lines/$viewline);
if ($page > 0)
{
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) $limitsql = $viewline;
$nbline = $limitsql;
}
else
{
if ($totalPages == 0) {
$page = 0;
$limitsql = $nbline;
} else {
if ($page > 0) {
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) {
$limitsql = $viewline;
}
$nbline = $limitsql;
} else {
$page = 0;
$limitsql = $nbline;
}
}
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets
@ -467,7 +472,7 @@ if ($id > 0 || ! empty($ref))
// VAT
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid";
// Salary payment
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment_salary'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as sal ON bu3.url_id = sal.rowid";

View File

@ -34,7 +34,7 @@ $langs->load("categories");
$langs->load("bills");
$action=GETPOST('action');
$id=GETPOST('id');
$id=GETPOST('id','int');
$ref=GETPOST('ref');
// Security check

View File

@ -56,6 +56,7 @@ $search_ref=GETPOST('search_ref','alpha');
*/
$tripandexpense_static=new Deplacement($db);
$userstatic = new User($db);
llxHeader();
@ -132,12 +133,23 @@ if ($resql)
$var=!$var;
print '<tr '.$bc[$var].'>';
// Id
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$obj->rowid.'</a></td>';
// Type
print '<td>'.$langs->trans($obj->type).'</td>';
// Date
print '<td>'.dol_print_date($db->jdate($obj->dd),'day').'</td>';
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->firstname.' '.$obj->name.'</a></td>';
// User
print '<td align="left">';
$userstatic->id = $obj->rowid;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
print $userstatic->getNomUrl(1);
print '</td>';
if ($obj->socid) print '<td>'.$soc->getNomUrl(1).'</td>';
else print '<td>&nbsp;</td>';
print '<td align="right">'.$obj->km.'</td>';
$tripandexpense_static->statut=$obj->fk_statut;

View File

@ -248,18 +248,23 @@ else if ($action == 'setmode' && $user->rights->facture->creer) {
dol_print_error($db, $object->error);
}
else if ($action == 'setinvoicedate' && $user->rights->facture->creer) {
else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
{
$object->fetch($id);
$old_date_lim_reglement = $object->date_lim_reglement;
$object->date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
$date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
if (empty($date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate');
exit;
}
$object->date=$date;
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement)
$object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date)
$object->date_lim_reglement = $object->date;
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
$result = $object->update($user);
if ($result < 0)
dol_print_error($db, $object->error);
if ($result < 0) dol_print_error($db, $object->error);
}
else if ($action == 'setconditions' && $user->rights->facture->creer) {
@ -267,18 +272,14 @@ else if ($action == 'setconditions' && $user->rights->facture->creer) {
$object->cond_reglement_code = 0; // To clean property
$object->cond_reglement_id = 0; // To clean property
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
if ($result < 0)
dol_print_error($db, $object->error);
if ($result < 0) dol_print_error($db, $object->error);
$old_date_lim_reglement = $object->date_lim_reglement;
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement)
$object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date)
$object->date_lim_reglement = $object->date;
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
$result = $object->update($user);
if ($result < 0)
dol_print_error($db, $object->error);
if ($result < 0) dol_print_error($db, $object->error);
}
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
@ -923,7 +924,11 @@ else if ($action == 'add' && $user->rights->facture->creer)
if ($result > 0)
{
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject, 'fetch_lines')) $lines = $srcobject->fetch_lines();
if (empty($lines) && method_exists($srcobject, 'fetch_lines'))
{
$srcobject->fetch_lines();
$lines = $srcobject->lines;
}
$fk_parent_line=0;
$num=count($lines);
@ -1143,12 +1148,10 @@ else if ($action == 'addline' && $user->rights->facture->creer)
// We define price for product
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level))
{
$pu_ht = $prod->multiprices [$object->client->price_level];
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
$pu_ht = $prod->multiprices[$object->client->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
}
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
@ -1819,15 +1822,7 @@ $now = dol_now();
llxHeader('', $langs->trans('Bill'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
print '
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#linktoorder").click(function() {
jQuery("#commande").toggle();
});
});
</script>
';
/**
* *******************************************************************
@ -2218,7 +2213,7 @@ if ($action == 'create')
// Payment mode
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
$form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
$form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id', 'CRDT');
print '</td></tr>';
// Project
@ -3158,10 +3153,13 @@ if ($action == 'create')
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none');
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
}
else
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT');
}
print '</td></tr>';
@ -3538,15 +3536,26 @@ if ($action == 'create')
// Linked object block
$somethingshown = $object->showLinkedObjectBlock();
if (empty($somethingshown) && $object->statut > 0) {
if (empty($somethingshown) && ! empty($conf->commande->enabled))
{
print '<br><a href="#" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';
print '
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#linktoorder").click(function() {
jQuery("#commande").toggle();
});
});
</script>
';
print '<div id="commande" style="display:none">';
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "commande as c";
$sql .= ' WHERE c.fk_soc = ' . $soc->id . '';
$sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $soc->id . '';
$resqlorderlist = $db->query($sql);
if ($resqlorderlist) {

View File

@ -420,4 +420,3 @@ elseif (file_exists($fileimagebis))
$db->close();
llxFooter();
?>

View File

@ -8,7 +8,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
@ -391,7 +391,7 @@ class Facture extends CommonInvoice
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label,
''
$this->lines[$i]->array_options
);
if ($result < 0)
{
@ -593,6 +593,10 @@ class Facture extends CommonInvoice
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
@ -1564,11 +1568,11 @@ class Facture extends CommonInvoice
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_CANCEL',$this,$user,$langs,$conf);
if ($result < 0) {
$error++;
$error++;
$this->errors=$interface->errors;
$this->db->rollback();
return -1;
}
// Fin appel triggers
@ -3574,7 +3578,7 @@ class FactureLigne extends CommonInvoiceLine
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result = $interface->run_triggers('LINEBILL_INSERT',$this,$user,$langs,$conf);
if ($result < 0)
if ($result < 0)
{
$error++;
$this->errors=$interface->errors;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
*
@ -142,7 +142,7 @@ if ($object->id > 0)
/*
* Facture
*/
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
@ -450,7 +450,7 @@ if ($object->id > 0)
/*
* Buttons
*/
*/
print "\n<div class=\"tabsAction\">\n";
// Add a withdraw request
@ -467,7 +467,11 @@ if ($object->id > 0)
}
else
{
if ($num == 0) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPayed")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
if ($num == 0)
{
if ($object->statut > 0) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPayed")).'">'.$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

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,6 +23,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@ -47,16 +50,22 @@ foreach($linkedObjectBlock as $object)
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans("TotalHT"); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@ -108,8 +108,8 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
$error++;
setEventMessage($langs->transnoentities("ErrorPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'errors');
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
}

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 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
@ -164,7 +165,7 @@ class BonPrelevement extends CommonObject
/**
* Add line to withdrawal
*
* @param int &$line_id id line to add
* @param int $line_id id line to add
* @param int $client_id id invoice customer
* @param string $client_nom name of cliente
* @param int $amount amount of invoice
@ -917,7 +918,7 @@ class BonPrelevement extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
$sql.= " ref, entity, datec";
$sql.= ") VALUES (";
$sql.= "'".$ref."'";
$sql.= "'".$this->db->escape($ref)."'";
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ")";
@ -1219,11 +1220,11 @@ class BonPrelevement extends CommonObject
/**
* Generate a withdrawal file. Generation Formats:
* France: CFONB
* Spain: AEB19 (if external module EsAEB is enabled)
* Others: Warning message
* File is generated with name this->filename
* Generate a withdrawal file.
* Generation Formats:
* - Europe: SEPA (France: CFONB no more supported, Spain: AEB19 if external module EsAEB is enabled)
* - Others countries: Warning message
* File is generated with name this->filename
*
* @return int 0 if OK, <0 if KO
*/
@ -1410,8 +1411,8 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' </PmtInf>'.$CrLf);
fputs($this->file, ' </CstmrDrctDbtInitn>'.$CrLf);
fputs($this->file, '</Document>'.$CrLf);
$sql = "SELECT pl.amount";
/*$sql = "SELECT pl.amount";
$sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
@ -1419,14 +1420,14 @@ class BonPrelevement extends CommonObject
$sql.= " WHERE pl.fk_prelevement_bons = ".$this->id;
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
$sql.= " AND pf.fk_facture = f.rowid";
//Lines
$i = 0;
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
@ -1437,7 +1438,7 @@ class BonPrelevement extends CommonObject
else
{
$result = -2;
}
}*/
}
@ -1574,7 +1575,7 @@ class BonPrelevement extends CommonObject
* @param string $row_bic rib.bic AS bic,
* @param string $row_datec soc.datec,
* @param string $row_drum soc.rowid AS drum
* @return void
* @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)
{
@ -1598,15 +1599,15 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .=' </DrctDbtTx>'.$CrLf;
$XML_DEBITOR .=' <DbtrAgt>'.$CrLf;
$XML_DEBITOR .=' <FinInstnId>'.$CrLf;
$XML_DEBITOR .=' <BIC>'.$row_iban.'</BIC>'.$CrLf;
$XML_DEBITOR .=' <BIC>'.$row_bic.'</BIC>'.$CrLf;
$XML_DEBITOR .=' </FinInstnId>'.$CrLf;
$XML_DEBITOR .=' </DbtrAgt>'.$CrLf;
$XML_DEBITOR .=' <Dbtr>'.$CrLf;
$XML_DEBITOR .=' <Nm>'.strtoupper($row_nom).'</Nm>'.$CrLf;
$XML_DEBITOR .=' <Nm>'.strtoupper(dol_string_unaccent($row_nom)).'</Nm>'.$CrLf;
$XML_DEBITOR .=' <PstlAdr>'.$CrLf;
$XML_DEBITOR .=' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.$row_zip.' '.$row_town.'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.dol_string_unaccent($row_zip.' '.$row_town).'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' </PstlAdr>'.$CrLf;
$XML_DEBITOR .=' </Dbtr>'.$CrLf;
$XML_DEBITOR .=' <DbtrAcct>'.$CrLf;
@ -1689,7 +1690,8 @@ class BonPrelevement extends CommonObject
}
/**
* Write sender of request (me)
* Write sender of request (me).
* Note: The tag PmtInf is opened here but closed into caller
*
* @param string $configuration conf
* @param date $ladate Date

View File

@ -78,19 +78,19 @@ $sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_line)
{
$sql.= " AND pl.rowid = '".$search_line."'";
$sql.= " AND pl.rowid = '".$db->escape($search_line)."'";
}
if ($search_bon)
{
$sql.= " AND p.ref LIKE '%".$search_bon."%'";
$sql.= " AND p.ref LIKE '%".$db->escape($search_bon)."%'";
}
if ($search_code)
{
$sql.= " AND s.code_client LIKE '%".$search_code."%'";
$sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
}
if ($search_societe)
{
$sql .= " AND s.nom LIKE '%".$search_societe."%'";
$sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'";
}
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($conf->liste_limit+1, $offset);
@ -104,7 +104,7 @@ if ($result)
$urladd = "&amp;statut=".$statut;
$urladd .= "&amp;search_bon=".$search_bon;
print_barre_liste($langs->trans("WithdrawalsLines"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
print"\n<!-- debut table -->\n";
print '<table class="liste" width="100%">';

View File

@ -76,7 +76,8 @@ $sql.= " AND pl.fk_prelevement_bons = p.rowid";
$sql.= " AND pl.fk_soc = s.rowid";
$sql.= " AND p.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
$sql.= " ".$db->order($sortfield, $sortorder);
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql);
if ($result)

View File

@ -30,7 +30,7 @@ $langs->load("companies");
if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check
$socid = $_GET["socid"];
$socid = GETPOST("socid",'int');
if ($user->societe_id > 0)
{
$action = '';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Juanjo Menent <jmenent@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
@ -538,6 +539,69 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
print '</tr>';
}
/*
* Salaries
*/
print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
$sql = "SELECT p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount, u.firstname, u.lastname, p.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
$sql.= " WHERE p.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY u.rowid";
$sql.= " ORDER BY u.firstname";
dol_syslog("get payment salaries sql=".$sql);
$result=$db->query($sql);
$subtotal_ht = 0;
$subtotal_ttc = 0;
if ($result)
{
$num = $db->num_rows($result);
$var=true;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total_ht -= $obj->amount;
$total_ttc -= $obj->amount;
$subtotal_ht += $obj->amount;
$subtotal_ttc += $obj->amount;
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print "<td>".$langs->trans("Salaries")." <a href=\"".DOL_URL_ROOT."/compta/salaries/index.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
print '<td align="right">'.price(-$obj->amount).'</td>';
print '</tr>';
$i++;
}
}
else
{
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '</tr>';
}
}
else
{
dol_print_error($db);
}
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
print '<td colspan="3" align="right">'.price(-$subtotal_ttc).'</td>';
print '</tr>';
/*
* VAT

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Juanjo Menent <jmenent@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
@ -469,6 +470,44 @@ $parameters["mode"] = $modecompta;
$hookmanager->initHooks(array('externalbalance'));
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
/*
* Salaries
*/
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments sql=".$sql);
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
$decaiss[$obj->dm] += $obj->amount;
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
$decaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
}
/*
* Show result array
*/

View File

@ -80,7 +80,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
$sal->num_payment=GETPOST("num_payment");
$sal->fk_user_creat=$user->id;
if (empty($datep) || empty($datesp) || empty($dateep))
if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
$error++;
@ -219,7 +219,7 @@ if ($action == 'create')
print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
print '</td></tr>';

View File

@ -71,8 +71,8 @@ $form = new Form($db);
$salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type,";
$sql.= " s.num_payment, pst.code as payment_code";
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type, s.num_payment,";
$sql.= " pst.code as payment_code";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id,";
$sql.= " ".MAIN_DB_PREFIX."user as u";
@ -87,7 +87,7 @@ if ($filtre) {
if ($typeid) {
$sql .= " AND s.fk_typepayment=".$typeid;
}
$sql.= " GROUP BY s.rowid, s.fk_typepayment, s.amount, s.datev, s.label";
//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code";
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1,$offset);
@ -176,6 +176,7 @@ else
}
$db->close();
llxFooter();
$db->close();

View File

@ -300,7 +300,7 @@ if ($id > 0)
* Payments
*/
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
$sql.= "c.libelle as paiement_type";
$sql.= "c.code as type_code,c.libelle as paiement_type";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
@ -333,8 +333,9 @@ if ($id > 0)
print "<tr ".$bc[$var]."><td>";
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print "</tr>";
$totalpaye += $objp->amount;
$i++;

View File

@ -72,6 +72,16 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
$tva->label=GETPOST("label");
$tva->note=GETPOST("note");
if (empty($tva->datev))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateValue")),'errors');
$error++;
}
if (empty($tva->datep))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DatePayment")),'errors');
$error++;
}
if (empty($tva->type_payment) || $tva->type_payment < 0)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors');

View File

@ -94,7 +94,7 @@ abstract class ActionsContactCardCommon
/**
* Load data control
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id of object
* @return void
*/
@ -228,7 +228,7 @@ abstract class ActionsContactCardCommon
/**
* Set content of ->tpl array, to use into template
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id
* @return string HTML output
*/

View File

@ -75,7 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
/**
* Assign custom values for canvas
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id
* @return void
*/

View File

@ -31,22 +31,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
$langs->load("companies");
// Security check
$contactid = isset($_GET["id"])?$_GET["id"]:'';
$contactid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
/*
* View
*/
* View
*/
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$contact = new Contact($db);
$contact->fetch($_GET["id"], $user);
$contact->info($_GET["id"]);
$contact->fetch($contactid, $user);
$contact->info($contactid);
$head = contact_prepare_head($contact);

View File

@ -172,11 +172,11 @@ if (strlen($search_phone))
}
if (strlen($search_phoneper))
{
$sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'";
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phoneper)."%'";
}
if (strlen($search_phonepro))
{
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'";
$sql .= " AND p.phone LIKE '%".$db->escape($search_phonepro)."%'";
}
if (strlen($search_phonemob))
{

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 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) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
@ -41,6 +41,7 @@ class Contrat extends CommonObject
public $table_element='contrat';
public $table_element_line='contratdet';
public $fk_element='fk_contrat';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id;
var $ref;
@ -411,7 +412,7 @@ class Contrat extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
if ($ref)
{
$sql.= " WHERE ref='".$ref."'";
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
$sql.= " AND entity IN (".getEntity('contract').")";
}
else $sql.= " WHERE rowid=".$id;
@ -833,6 +834,7 @@ class Contrat extends CommonObject
function delete($user)
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
@ -1963,7 +1965,7 @@ class ContratLigne
$sql.= " t.commentaire";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as t";
if ($id) $sql.= " WHERE t.rowid = ".$id;
if ($ref) $sql.= " WHERE t.rowid = '".$ref."'";
if ($ref) $sql.= " WHERE t.rowid = '".$this->db->escape($ref)."'";
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@ -250,7 +250,11 @@ if ($action == 'add' && $user->rights->contrat->creer)
{
$srcobject->fetch_thirdparty();
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
if (empty($lines) && method_exists($srcobject,'fetch_lines'))
{
$srcobject->fetch_lines();
$lines = $srcobject->lines;
}
$fk_parent_line=0;
$num=count($lines);
@ -337,10 +341,10 @@ if ($action == 'add' && $user->rights->contrat->creer)
}
else
{
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
$result = $object->create($user);
if ($result > 0)
{
@ -715,7 +719,7 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
$error ++;
if (! $error) {
$result = $object->insertExtraFields();
if ($result < 0) {
$error ++;
@ -948,7 +952,7 @@ if ($action == 'create')
// Other attributes
$parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Other attributes
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
print $object->showOptionals($extrafields, 'edit');
@ -1112,7 +1116,7 @@ else
// Other attributes
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
$res = $object->fetch_optionals($object->id, $extralabels);
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
foreach ($extrafields->attribute_label as $key => $label) {
@ -1132,16 +1136,16 @@ else
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
}
if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) {
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formcontract">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value);
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} else {
@ -1153,9 +1157,9 @@ else
}
}
}
print "</table>";

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$langs->load("contracts");
// Security check
$contratid = isset($_GET["id"])?$_GET["id"]:'';
$contratid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat',$contratid,'');
@ -41,8 +41,8 @@ $result = restrictedArea($user, 'contrat',$contratid,'');
llxHeader();
$contrat = new Contrat($db);
$contrat->fetch($_GET["id"]);
$contrat->info($_GET["id"]);
$contrat->fetch($contratid);
$contrat->info($contratid);
$head = contract_prepare_head($contrat);

View File

@ -28,7 +28,7 @@ $extrasize=GETPOST('size');
if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
if (GETPOST('type')=='date') $extrasize='';
if (GETPOST('type')=='datetime') $extrasize='';
if (GETPOST('type')=='select') $extrasize='';
if (GETPOST('type')=='select') $extrasize='';
// Add attribute
@ -87,7 +87,7 @@ if ($action == 'add')
$mesg[]=$langs->trans("ErrorNoValueForRadioType");
$action = 'create';
}
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param'))
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param'))
{
// Construct array for parameter (value of select list)
$parameters = GETPOST('param');
@ -95,7 +95,7 @@ if ($action == 'add')
foreach($parameters_array as $param_ligne)
{
if (!empty($param_ligne)) {
if (preg_match_all('/,/',$param_ligne,$matches))
if (preg_match_all('/,/',$param_ligne,$matches))
{
if (count($matches[0])>1) {
$error++;
@ -104,7 +104,7 @@ if ($action == 'add')
$action = 'create';
}
}
else
else
{
$error++;
$langs->load("errors");
@ -112,12 +112,12 @@ if ($action == 'add')
$action = 'create';
}
}
}
}
}
if (! $error)
{
// attrname must be alphabetical and lower case only
// attrname must be alphabetical and lower case only
if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname']))
{
// Construct array for parameter (value of select list)
@ -139,8 +139,8 @@ if ($action == 'add')
list($key,$value) = explode(',',$param_ligne);
$params['options'][$key] = $value;
}
}
}
$result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params);
if ($result > 0)
{
@ -164,7 +164,7 @@ if ($action == 'add')
$action = 'create';
}
}
else
else
{
setEventMessage($mesg,'errors');
}

View File

@ -229,5 +229,3 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
}
?>

View File

@ -43,5 +43,3 @@ else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
if ($result < 0) setEventMessage($object->error,'errors');
}
?>

View File

@ -65,9 +65,10 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
$sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country";
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
$sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_pays as p)";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
$sql.= " ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE z.fk_pays = p.rowid";
$sql.= " AND z.active = 1 AND p.active = 1";
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
@ -81,8 +82,8 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$sql.= ", p.code as country_code, p.libelle as country";
$sql.= ", d.code_departement as county_code , d.nom as county";
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON fk_pays = p.rowid';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid';
$sql.= " WHERE";
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";

View File

@ -125,7 +125,7 @@ class Canvas
/**
* Shared method for canvas to assign values for templates
*
* @param string &$action Action string
* @param string $action Action string
* @param int $id Object id (if ref not provided)
* @param string $ref Object ref (if id not provided)
* @return void
@ -181,7 +181,7 @@ class Canvas
/**
* Shared method for canvas to execute actions
*
* @param string &$action Action string
* @param string $action Action string
* @param int $id Object id
* @return mixed Return return code of doActions of canvas
* @deprecated This function is called if you add a doActions class inside your canvas. Try to not

View File

@ -1089,7 +1089,6 @@ abstract class CommonObject
}
}
/**
* Save a new position (field rang) for details lines.
* You can choose to set position for lines with already a position or lines without any position defined.
@ -2039,7 +2038,7 @@ abstract class CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
if (! empty($id)) $sql.= " AND rowid = ".$id;
if (! empty($ref)) $sql.= " AND ref = '".$ref."'";
if (! empty($ref)) $sql.= " AND ref = '".$this->db->escape($ref)."'";
$resql = $this->db->query($sql);
if ($resql)
@ -2121,11 +2120,11 @@ abstract class CommonObject
foreach ($tab as $key => $value)
{
// Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine)
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key))
// Test fetch_array ! is_int($key) because fetch_array result is a mix table with some key as alpha and some key as int (depend db engine)
if ($key != 'rowid' && $key != 'tms' && ! is_int($key))
{
// we can add this attribute to adherent object
$this->array_options["options_$key"]=$value;
// we can add this attribute to object properties
$this->array_options["options_".$key]=$value;
}
}
}

View File

@ -201,4 +201,3 @@ class dolprintIPP
return $ipp->printer_attributes;
}
}
?>

View File

@ -154,7 +154,7 @@ class ExtraFields
{
$table=$elementtype.'_extrafields';
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
{
if ($type=='boolean') {
$typedb='int';
@ -226,8 +226,7 @@ class ExtraFields
// Clean parameters
if (empty($pos)) $pos=0;
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
{
if(is_array($param) and count($param) > 0)
{
@ -681,6 +680,7 @@ class ExtraFields
}
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
$out.='<option value="0">&nbsp;</option>';
foreach ($param['options'] as $key=>$val )
{
list($val, $parent) = explode('|', $val);
@ -975,11 +975,11 @@ class ExtraFields
// Several field into label (eq table:code|libelle:rowid)
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label))
if(is_array($fields_label) && count($fields_label)>1)
{
foreach ($fields_label as $field_toshow)
{
$translabel=$langs->trans($obj->field_toshow);
$translabel=$langs->trans($obj->$field_toshow);
if ($translabel!=$field_toshow) {
$value.=dol_trunc($translabel,18).' ';
}else {
@ -1040,7 +1040,7 @@ class ExtraFields
* Fill array_options property of object by extrafields value (using for data sent by forms)
*
* @param array $extralabels $array of extrafields
* @param object &$object Object
* @param object $object Object
* @param string $onlykey Only following key is filled
* @return int 1 if array_options set / 0 if no value
*/

View File

@ -114,8 +114,8 @@ class HookManager
*
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
* @param array $parameters Array of parameters
* @param Object &$object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @param Object $object Object to use hooks on
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Deprecated. Must always return an int and things to print into ->resprints.
* Can also return some values into an array ->results.

View File

@ -1492,9 +1492,9 @@ class Form
/**
* constructProductListOption
*
* @param resultset &$objp Resultset of fetch
* @param string &$opt Option
* @param string &$optJson Option
* @param resultset $objp Resultset of fetch
* @param string $opt Option
* @param string $optJson Option
* @param int $price_level Price level
* @param string $selected Preselected value
* @return void
@ -2329,8 +2329,8 @@ class Form
dol_syslog(get_class($this)."::select_type_paiements ".$selected.", ".$htmlname.", ".$filtertype.", ".$format,LOG_DEBUG);
$filterarray=array();
if ($filtertype == 'CRDT') $filterarray=array(0,2);
elseif ($filtertype == 'DBIT') $filterarray=array(1,2);
if ($filtertype == 'CRDT') $filterarray=array(0,2,3);
elseif ($filtertype == 'DBIT') $filterarray=array(1,2,3);
elseif ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype);
$this->load_cache_types_paiements();
@ -2809,7 +2809,7 @@ class Form
* Show a form to select a project
*
* @param int $page Page
* @param int $socid Id third party
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id pre-selected project
* @param string $htmlname Name of select field
* @return void
@ -3055,12 +3055,13 @@ class Form
/**
* Affiche formulaire de selection des modes de reglement
*
* @param string $page Page
* @param int $selected Id mode pre-selectionne
* @param string $htmlname Name of select html field
* @param string $page Page
* @param int $selected Id mode pre-selectionne
* @param string $htmlname Name of select html field
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
* @return void
*/
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id')
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='')
{
global $langs;
if ($htmlname != "none")
@ -3070,7 +3071,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$this->select_types_paiements($selected,$htmlname);
$this->select_types_paiements($selected,$htmlname,$filtertype);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@ -3769,7 +3770,7 @@ class Form
}
elseif ($typehour=='text')
{
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.((int) $hourSelected).'">';
print '<input type="text" size="3" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.((int) $hourSelected).'">';
}
print $langs->trans('Hours');
@ -4079,7 +4080,7 @@ class Form
/**
* Return HTML code to output a barcode
*
* @param Object &$object Object containing data to retrieve file name
* @param Object $object Object containing data to retrieve file name
* @param int $width Width of photo
* @return string HTML code to output barcode
*/

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