Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
986475e8c1
6
.gitignore
vendored
6
.gitignore
vendored
@ -16,4 +16,8 @@ doxygen_warnings.log
|
||||
.idea
|
||||
*.iml
|
||||
Thumbs.db
|
||||
|
||||
# Vagrant generated files
|
||||
.vagrant
|
||||
/index.html
|
||||
/phpmyadmin
|
||||
/xhprof
|
||||
|
||||
@ -60,6 +60,7 @@ Copyright (C) 2013
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Adolfo Segura <adolfo.segura@gmail.com>
|
||||
|
||||
Copyright (C) 2012
|
||||
- Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
|
||||
53
ChangeLog
53
ChangeLog
@ -6,6 +6,17 @@ English Dolibarr ChangeLog
|
||||
For users:
|
||||
- New: Add list of orders products in tab "consumption" on thirdparties.
|
||||
- New: Add graph stats for suppliers orders in tab "stats" on products.
|
||||
- New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you
|
||||
use the "print" view on screen.
|
||||
|
||||
For translators:
|
||||
- Update language files.
|
||||
|
||||
For developers:
|
||||
- New: Add path file of trigger into admin trigger list page.
|
||||
- New: More phpunit tests.
|
||||
- New: Payments and supplier payment pages tabs can now be extended from modules.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||
@ -76,6 +87,8 @@ For users:
|
||||
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count.
|
||||
- Fix: [ bug #1022 ] correct margin calculation for credit notes.
|
||||
- Fix: Better management of using ajax for upload form (to solve problem when enabling ajax jquery multifile upload in some cases).
|
||||
- Fix: Lost stats filters into year selection.
|
||||
- Fix: Some config data are shared between suppliers orders and suppliers invoices
|
||||
|
||||
New experimental module:
|
||||
- New: [ task #157 ] Add a Skype button (adherents / third parties / contacts)
|
||||
@ -134,7 +147,11 @@ parameter. All methods addline in this case were modified to remove this paramet
|
||||
|
||||
5) Property ->tel on objects is now ->phone
|
||||
|
||||
|
||||
6) Trigger LINEPROPAL_MODIFY is renamed into LINEPROPAL_UPDATE and
|
||||
Trigger CONTRACT_LINE_DELETE rnamed into LINECONTRACT_DELETE to match naming rules.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB)
|
||||
Fix: Document cerfa doesn't contained firstname & lastname from donator
|
||||
@ -145,6 +162,17 @@ Fix: wrong buy price update
|
||||
Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
|
||||
Fix: [ bug #1145 ] Agenda button list type do not display
|
||||
Fix: [ bug #1148 ] Product consomation : supplier order bad status
|
||||
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
|
||||
Fix: [ bug #1174 ] Product translated description not good into PDF
|
||||
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
|
||||
Fix: [ bug #1162 ] Translaction for morning and afternoon
|
||||
Fix: [ bug #1161 ] Search on product label
|
||||
Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
|
||||
Fix: [ bug #1171 ] Documents lost in interventions after validating
|
||||
Fix: fix unsubscribe URL into mailing when sending manually (not by script)
|
||||
Fix: [ bug #1182 ] ODT company_country tag is htmlencoded
|
||||
Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type
|
||||
Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal
|
||||
|
||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||
Fix: Display buying price on line edit when no supplier price is defined
|
||||
@ -175,7 +203,6 @@ Fix: there was no escaping on filter fields in supplier product list
|
||||
Fix: bugs on margin reports and better margin calculation on credit notes
|
||||
Qual: Add travis-ci integration
|
||||
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
For users:
|
||||
- New: Can use ODS templates as document templates.
|
||||
@ -272,6 +299,12 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.5 compared to 3.3.4 *****
|
||||
- Fix: jcrop file to match debian rules
|
||||
- Fix: Add missing country UK.
|
||||
- Fix: Minor fix into package.
|
||||
- Fix: Add missing label on project field.
|
||||
|
||||
***** ChangeLog for 3.3.4 compared to 3.3.3 *****
|
||||
- Fix: [ bug #1001 ] Social Contribution : State not correct
|
||||
- Fix: Better management of pdf generation when tcpdf is not available.
|
||||
@ -442,7 +475,6 @@ Dolibarr license has also been updated from GPLv2+ to GPLv3+.
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.3 compared to 3.2.2 *****
|
||||
|
||||
- Fix: Some permission into agenda module.
|
||||
- Fix: Generation of PDF was not using correct font for some languages.
|
||||
- Fix some translations.
|
||||
@ -596,7 +628,6 @@ WARNING: To reduce technic debt, all functions dolibarr_xxx were renamed int dol
|
||||
|
||||
|
||||
***** ChangeLog for 3.1.3 compared to 3.1.2 *****
|
||||
|
||||
Fix: PgSQL - property must be set if success
|
||||
Fix: Provide a solution for backup when mysqldump is not available
|
||||
Fix: Bug #460 - Wrong entity assignment when creating a warehouse
|
||||
@ -605,7 +636,6 @@ Fix: bug #405 - Late icon always displayed on comm/propal.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.1.2 compared to 3.1.1 *****
|
||||
|
||||
- Fix: Can clone a proposal
|
||||
- Fix: Add member ID in substitution method
|
||||
- Fix: Duplicate end tag and missing form parts
|
||||
@ -618,7 +648,6 @@ Fix: bug #405 - Late icon always displayed on comm/propal.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.1.1 compared to 3.1.0 *****
|
||||
|
||||
- New: Add option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS. With this option added,
|
||||
credit notes are not removed from total amount of invoice but are just
|
||||
payments used to reducs remain to pay.
|
||||
@ -740,7 +769,6 @@ For translators:
|
||||
|
||||
|
||||
***** ChangeLog for 3.0 compared to 2.9.* *****
|
||||
|
||||
For users:
|
||||
- New: Can edit date of cheque receipts.
|
||||
- New: Add Sales journal and Purchase journal report.
|
||||
@ -836,7 +864,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.9 compared to 2.8.* *****
|
||||
|
||||
For users:
|
||||
- New: POS module allow to choose which warehouse to use.
|
||||
- New: Support "Department/State" field on company setup, contact,
|
||||
@ -954,7 +981,6 @@ For users:
|
||||
|
||||
|
||||
***** ChangeLog for 2.8 compared to 2.7.* *****
|
||||
|
||||
For users:
|
||||
- New: Support note on trips module
|
||||
- New: Can link contacts to projects
|
||||
@ -1005,7 +1031,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.7.1 compared to 2.7 *****
|
||||
|
||||
For users:
|
||||
- Fix: Bad decimal management for it_IT and fr_BE languages.
|
||||
- Fix: A third party created from a member is created as a
|
||||
@ -1018,7 +1043,6 @@ For users:
|
||||
|
||||
|
||||
***** ChangeLog for 2.7 compared to 2.6.* *****
|
||||
|
||||
For users:
|
||||
- New: Add a print icon to show a page to print without menus.
|
||||
- New: Can add a free text on bank cheque receipts.
|
||||
@ -1117,7 +1141,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.6 compared to 2.5.* *****
|
||||
|
||||
For users:
|
||||
- New: Add filter on status in emailing selector for Dolibarr users.
|
||||
- New: Can add bookmarks on all pages.
|
||||
@ -1200,7 +1223,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.5 compared to 2.4.* *****
|
||||
|
||||
For users:
|
||||
- Sessions timeout can be configured to overwrite PHP setup.
|
||||
- Can filter on date in services list.
|
||||
@ -1264,7 +1286,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.4 compared to 2.2.* *****
|
||||
|
||||
For users:
|
||||
- Add a calendar module (module agenda) with ical/vcal/rss export.
|
||||
- Look enhancement in graphics (thanks artichow).
|
||||
@ -1319,7 +1340,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.2 compared to 2.1.* *****
|
||||
|
||||
- Add more statistics on main page.
|
||||
- Add option to add message on login page.
|
||||
- Management of categories for third parties.
|
||||
@ -1353,7 +1373,6 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.1 compared to 2.0.* *****
|
||||
|
||||
- Added a better installer.
|
||||
- Support user and groups permissions.
|
||||
- Translation in english and support for several languages.
|
||||
@ -1418,12 +1437,10 @@ For developers:
|
||||
|
||||
|
||||
***** ChangeLog for 2.0.1 compared to 2.0 *****
|
||||
|
||||
Minor bug fixes
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 2.0 compared to 1.0.* *****
|
||||
|
||||
ChangeLog file size is so important, that it is not included inside Dolibarr
|
||||
package. You can find it at www.dolibarr.org
|
||||
|
||||
70
build/README
70
build/README
@ -7,10 +7,27 @@ All sub-directories of "build" directory contains files required to build
|
||||
automatically Dolibarr packages.
|
||||
There are several tools:
|
||||
|
||||
|
||||
|
||||
- To build full Dolibarr packages, launch the script
|
||||
> Edit version in makepack-dolibarr.pl file.
|
||||
> Launch command perl makepack-dolibarr.pl
|
||||
|
||||
Note: Prerequisites to build tgz, debian, rpm package
|
||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||
|
||||
Note: Prerequisites to build autoexe DoliWamp package:
|
||||
> Install InnoSetup
|
||||
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
|
||||
> Install WampServer into "C:\Program Files\Wamp"
|
||||
For example by running wampserver2.2e-php5.4.3-httpd-2.4.2-mysql5.5.24-x64.exe (http://www.wampserver.com)
|
||||
> Install WampServer addon to have versions: Apache2.2.11, Mysql5.0.45, Php5.3.0
|
||||
For example by running WampServer2-APACHE2211.exe (http://www.wampserver.com)
|
||||
For example by running WampServer2-MYSQL5045.exe (http://www.wampserver.com)
|
||||
For example by running WampServer2-PHP530.exe (http://www.wampserver.com)
|
||||
> To build from Windows (running from makepack-dolibarr.pl script is however
|
||||
recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
|
||||
The .exe file will be build into directory build.
|
||||
|
||||
- To build a translaction package, launch the script
|
||||
> perl makepack-dolibarrlang.pl
|
||||
|
||||
@ -20,17 +37,6 @@ There are several tools:
|
||||
- To build a package for a module, launch the script
|
||||
> perl makepack-dolibarrmodule.pl
|
||||
|
||||
- To build an autoexe DoliWamp package:
|
||||
> Install InnoSetup (http://www.jrsoftware.org)
|
||||
> Install WampServer into "C:\Program Files\Wamp" (http://www.wampserver.com)
|
||||
> Install WampServer addon to have versions:
|
||||
Apache2.2.6, Mysql5.0.45, Php5.2.5
|
||||
> Modify file build/exe/doliwamp.iss to change variable SourceDir
|
||||
with value of Dolibarr repository.
|
||||
> Modify AppVerName and OutputBaseFilename.
|
||||
> Launch innosetup, open file build/exe/doliwamp.iss and click on
|
||||
button "Compile". The .exe file will be build into directory build.
|
||||
|
||||
- To build developper documentation, launch the script
|
||||
> perl dolybarr-doxygen-build.pl
|
||||
|
||||
@ -43,24 +49,33 @@ generated packages will not contains this "build" directory.
|
||||
|
||||
We can find in "build", following sub-directories:
|
||||
|
||||
* deb:
|
||||
* aps:
|
||||
To build APS package.
|
||||
|
||||
* debian:
|
||||
To build Debian package.
|
||||
|
||||
* rpm:
|
||||
To build Redhat or Mandrake package.
|
||||
* dmg:
|
||||
To build Mac OS package (not ready yet).
|
||||
|
||||
* tgz:
|
||||
To build a tgz package.
|
||||
* doap:
|
||||
To build Doap descriptor to promote/describe Dolibarr releases.
|
||||
|
||||
* doxygen:
|
||||
Dir with config file to build doxygen documentation.
|
||||
|
||||
* exe:
|
||||
To build exe package for Windows that distribute Dolibarr sources or
|
||||
to build the complete DoliWamp package.
|
||||
|
||||
* tgz:
|
||||
To build a zip package.
|
||||
* launchpad:
|
||||
Doc file to explain how to use launchpad.
|
||||
|
||||
* doap:
|
||||
To build Doap descriptor to promote/describe Dolibarr releases.
|
||||
* live:
|
||||
Doc file to explain how to create a demo live CD.
|
||||
|
||||
* obs:
|
||||
Doc file to explain how to push release onto OBS.
|
||||
|
||||
* pad:
|
||||
To build a PAD file descriptor to promote/describe Dolibarr releases.
|
||||
@ -68,5 +83,14 @@ To build a PAD file descriptor to promote/describe Dolibarr releases.
|
||||
* patch:
|
||||
Script file to generate a patch file to distribute a Dolibarr mod.
|
||||
|
||||
* dmg:
|
||||
To build dmg DoliMamp package for Mac OS X
|
||||
* perl:
|
||||
Tool to install dolibarr when using virtualmin pro
|
||||
|
||||
* rpm:
|
||||
To build Redhat, Opensuse or Mandriva package.
|
||||
|
||||
* tgz:
|
||||
To build a tgz package.
|
||||
|
||||
* zip:
|
||||
To build a zip package.
|
||||
|
||||
@ -3,14 +3,21 @@ dolibarr (3.6.0-1) unstable; urgency=low
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 30 Dec 2013 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.0-1) unstable; urgency=low
|
||||
dolibarr (3.5.0-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 30 Dec 2013 12:00:00 +0100
|
||||
|
||||
dolibarr (3.4.2-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* Maintenance release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 30 Dec 2013 12:00:00 +0100
|
||||
|
||||
dolibarr (3.4.1-3) unstable; urgency=low
|
||||
|
||||
@ -25,17 +32,3 @@ dolibarr (3.4.0-3) unstable; urgency=low
|
||||
* Maintenance release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
|
||||
dolibarr (3.4.1) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* Maintenance release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
|
||||
dolibarr (3.4.0) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
|
||||
@ -22,7 +22,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 </a> $doxygenversion </small></address>
|
||||
for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
|
||||
|
||||
|
||||
<!-- Google AdSense -->
|
||||
@ -40,5 +40,6 @@ google_ad_height = 60;
|
||||
<!-- End google adsense -->
|
||||
<br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -20,12 +20,12 @@ AppName=DoliWamp
|
||||
AppVerName=DoliWamp-3.6.0-beta
|
||||
; 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-beta
|
||||
; Define full path from wich all relative path are defined
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
; Define full path from which all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
|
||||
SourceDir=..\..\..
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
AppId=doliwamp
|
||||
AppPublisher=NLTechno
|
||||
AppPublisherURL=http://www.nltechno.com
|
||||
@ -51,7 +51,6 @@ CreateUninstallRegKey=yes
|
||||
OutputDir=build
|
||||
ShowLanguageDialog=auto
|
||||
ShowUndisplayableLanguages=no
|
||||
;LanguageDetectionMethod=none
|
||||
LanguageDetectionMethod=uilanguage
|
||||
;SignedUninstaller=yes
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
"RPM_FEDORA"=>"rpmbuild",
|
||||
"RPM_MANDRIVA"=>"rpmbuild",
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg",
|
||||
"DEB"=>"dpkg dpatch",
|
||||
"APS"=>"zip",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe"
|
||||
);
|
||||
@ -67,6 +67,23 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
|
||||
|
||||
$SOURCE="$DIR/..";
|
||||
$DESTI="$SOURCE/build";
|
||||
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Missing environment variables.\n";
|
||||
print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n";
|
||||
print "Example: DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'\n";
|
||||
print "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Directory of environment variable DESTIBETARC or DESTISTABLE does not exist.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Detect OS type
|
||||
# --------------
|
||||
@ -74,7 +91,7 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='
|
||||
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
|
||||
elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
|
||||
if (! $OS) {
|
||||
print "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Error: Can't detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
@ -113,8 +130,8 @@ for (0..@ARGV-1) {
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
|
||||
|
||||
print "Makepack version $VERSION\n";
|
||||
@ -208,7 +225,7 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
||||
last;
|
||||
} else {
|
||||
# Pas erreur ou erreur autre que programme absent
|
||||
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
||||
print " Found ".$req."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,6 +355,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||
$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`;
|
||||
@ -396,6 +414,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'TGZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMETGZ.tgz...\n";
|
||||
@ -422,6 +441,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'XZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMEXZ.xz...\n";
|
||||
@ -452,6 +472,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'ZIP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
|
||||
print "Remove target $FILENAMEZIP.zip...\n";
|
||||
@ -486,6 +507,7 @@ if ($nboftargetok) {
|
||||
if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; }
|
||||
if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; }
|
||||
if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; }
|
||||
mkdir($DESTI.'/'.$subdir);
|
||||
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
|
||||
|
||||
$ARCH='noarch';
|
||||
@ -582,6 +604,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'DEB')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_debian-ubuntu');
|
||||
if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
|
||||
|
||||
$olddir=getcwd();
|
||||
@ -742,6 +765,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'APS')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_aps');
|
||||
if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
|
||||
|
||||
$newbuild = $BUILD;
|
||||
@ -826,6 +850,7 @@ if ($nboftargetok) {
|
||||
if ($target eq 'EXEDOLIWAMP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
mkdir($DESTI.'/package_windows');
|
||||
if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
|
||||
|
||||
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
|
||||
|
||||
@ -45,9 +45,9 @@ elsif ( "$^O" =~ /cygwin/i || "$^O" =~ /win32/i ) {
|
||||
$CR = "\r";
|
||||
}
|
||||
if ( !$OS ) {
|
||||
print "makepack-dolbarrlang.pl was not able to detect your OS.\n";
|
||||
print "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "makepack-dolibarrlang.pl aborted.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='
|
||||
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
|
||||
elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
|
||||
if (! $OS) {
|
||||
print "makepack-dolbarrmodule.pl was not able to detect your OS.\n";
|
||||
print "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
@ -59,7 +59,7 @@ if ($OS =~ /windows/) {
|
||||
if (! $TEMP || ! -d $TEMP) {
|
||||
print "Error: A temporary directory can not be find.\n";
|
||||
print "Check that TEMP or TMP environment variable is set correctly.\n";
|
||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 2;
|
||||
}
|
||||
|
||||
@ -41,9 +41,9 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='
|
||||
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
|
||||
elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
|
||||
if (! $OS) {
|
||||
print "makepack-dolbarrtheme.pl was not able to detect your OS.\n";
|
||||
print "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "makepack-dolibarrtheme.pl aborted.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ a package onto OBS
|
||||
#----------------------------------
|
||||
https://build.opensuse.org
|
||||
|
||||
Packaging rules: http://en.opensuse.org/Portal:Packaging
|
||||
|
||||
Add attributes:
|
||||
OBS:Screenshots URL of screenshot
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.3.0</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Version>3.5.0</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.3.0</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Version>3.5.0</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.4</Program_Version>
|
||||
<Program_Release_Month>07</Program_Release_Month>
|
||||
<Program_Release_Day>07</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Version>3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@ -17,15 +17,15 @@
|
||||
<Contact_Info>
|
||||
<Author_First_Name>NLTechno</Author_First_Name>
|
||||
<Author_Last_Name>NLTechno</Author_Last_Name>
|
||||
<Author_Email>dolibarr@nltechno.com</Author_Email>
|
||||
<Author_Email>contact@nltechno.com</Author_Email>
|
||||
<Contact_First_Name>NLTechno</Contact_First_Name>
|
||||
<Contact_Last_Name>NLTechno</Contact_Last_Name>
|
||||
<Contact_Email>dolibarr@nltechno.com</Contact_Email>
|
||||
<Contact_Email>contact@nltechno.com</Contact_Email>
|
||||
</Contact_Info>
|
||||
<Support_Info>
|
||||
<Sales_Email>dolibarr@nltechno.com</Sales_Email>
|
||||
<Support_Email>dolibarr@nltechno.com</Support_Email>
|
||||
<General_Email>dolibarr@nltechno.com</General_Email>
|
||||
<Sales_Email>support@nltechno.com</Sales_Email>
|
||||
<Support_Email>support@nltechno.com</Support_Email>
|
||||
<General_Email>support@nltechno.com</General_Email>
|
||||
<Sales_Phone />
|
||||
<Support_Phone />
|
||||
<General_Phone />
|
||||
@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.4</Program_Version>
|
||||
<Program_Release_Month>07</Program_Release_Month>
|
||||
<Program_Release_Day>07</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Version>3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
|
||||
@ -159,6 +159,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/boutique
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
@ -330,5 +331,5 @@ 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 Nov 6 2013 Laurent Destailleur 3.6.0-0.12.b
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -239,6 +239,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/boutique
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
@ -558,5 +559,5 @@ 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 Nov 6 2013 Laurent Destailleur 3.6.0-0.1.b
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -156,6 +156,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/boutique
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
@ -335,5 +336,5 @@ 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 Nov 6 2013 Laurent Destailleur 3.6.0-0.1.b
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -167,6 +167,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/boutique
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
@ -345,5 +346,5 @@ 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 Nov 6 2013 Laurent Destailleur 3.6.0-0.1.b
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -49,3 +49,8 @@ with
|
||||
//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
||||
window.location.href=pRef
|
||||
* Replace hard coded string with i18n["String"];
|
||||
|
||||
|
||||
JCROP:
|
||||
------
|
||||
* Remove analytics tag into file index.html
|
||||
|
||||
0
dev/initdata/dolibarr-mysql2pgsql.pl
Normal file → Executable file
0
dev/initdata/dolibarr-mysql2pgsql.pl
Normal file → Executable file
0
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file → Normal file
0
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file → Normal file
0
dev/initdata/mysqldump_dolibarr_3.1.0.sql
Executable file → Normal file
0
dev/initdata/mysqldump_dolibarr_3.1.0.sql
Executable file → Normal file
@ -131,6 +131,8 @@ class modMyModule extends DolibarrModules
|
||||
// 'user' to add a tab in user view
|
||||
// 'group' to add a tab in group view
|
||||
// 'contact' to add a tab in contact view
|
||||
// 'payment' to add a tab in payment view
|
||||
// 'payment_supplier' to add a tab in supplier payment view
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
$this->tabs = array();
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ fi
|
||||
|
||||
if [ "x$1" = "xall" ]
|
||||
then
|
||||
for fic in ar_SA bg_BG ca_ES da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW
|
||||
for fic in ar_SA bg_BG ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW
|
||||
do
|
||||
echo "tx pull -l $fic $2 $3"
|
||||
tx pull -l $fic $2 $3
|
||||
|
||||
@ -20,7 +20,7 @@ fi
|
||||
|
||||
if [ "x$1" = "xall" ]
|
||||
then
|
||||
for fic in ar_SA bg_BG ca_ES da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW
|
||||
for fic in ar_SA bg_BG ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR lv_LV nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sv_SE tr_TR uz_UZ vi_VN zh_CN zh_TW
|
||||
do
|
||||
echo "tx push --skip -t -l $fic $2 $3"
|
||||
tx push --skip -t -l $fic $2 $3
|
||||
|
||||
60
dev/vagrant/README.md
Normal file
60
dev/vagrant/README.md
Normal file
@ -0,0 +1,60 @@
|
||||
Vagrant development box for Dolibarr
|
||||
====================================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
[Vagrant](http://vagrantup.com) is a tool to make development easier using [VirtualBox](http://virtualbox.org) virtual machines.
|
||||
|
||||
These machines have been created with [PuPHEt](http://puphpet.com) and combine the power of Vagrant with [Puppet](http://puppetlabs.com) to automate the development machine provisionning.
|
||||
|
||||
What you need
|
||||
-------------
|
||||
|
||||
Latest versions of:
|
||||
|
||||
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
|
||||
- [Vagrant](http://downloads.vagrantup.com/)
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
### VM startup
|
||||
|
||||
`cd` into the vagrant box directory and simply type `vagrant up`.
|
||||
|
||||
That's all you need to do. It will build a brand new VirtalBox machine for you with everything you need to develop on Dolibarr.
|
||||
|
||||
### Name resolution
|
||||
For easy access to the VM you need to setup name resolution to the machines IP.
|
||||
|
||||
Edit the [hosts](https://fr.wikipedia.org/wiki/Hosts) file on the machine you run Vagrant on to map the virtual machine's IP to it's Vhost name.
|
||||
|
||||
Example syntax:
|
||||
|
||||
192.168.42.101 dev.dolibarr.org
|
||||
|
||||
Once this is done, you will be able to access your VM's service at <http://dolibarr.dev>
|
||||
|
||||
Available boxes
|
||||
---------------
|
||||
|
||||
### dolibardev
|
||||
|
||||
Somewhat bleeding edge vagrant box for develop branch related work.
|
||||
|
||||
- IP: 192.168.42.101
|
||||
- Vhost: dev.dolibarr.org
|
||||
- OS: Debian Wheezy 7.2
|
||||
- Webserver: Apache 2.2
|
||||
- PHP: mod_php 5.5
|
||||
- Database: MySQL 5.5
|
||||
- Root user: root
|
||||
- Root password: root
|
||||
- Database name: dolibarr
|
||||
- Database user: user
|
||||
- Database password: user
|
||||
- Initial data: dev/initdata/mysqldump_dolibarr-3.5.0.sql
|
||||
- Debugger: XDebug
|
||||
- Profiler: Xhprof
|
||||
- phpMyAdmin: <http://192.168.42.101/phpmyadmin>
|
||||
42
dev/vagrant/dolibarrdev/Vagrantfile
vendored
Normal file
42
dev/vagrant/dolibarrdev/Vagrantfile
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "debian-wheezy72-x64-vbox43"
|
||||
config.vm.box_url = "https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box"
|
||||
|
||||
config.vm.network "private_network", ip: "192.168.42.101"
|
||||
|
||||
|
||||
config.vm.synced_folder "../../../", "/var/www", id: "vagrant-root", :nfs => false, owner: "www-data", group: "www-data"
|
||||
|
||||
config.vm.usable_port_range = (2200..2250)
|
||||
config.vm.provider :virtualbox do |virtualbox|
|
||||
virtualbox.customize ["modifyvm", :id, "--name", "dolibarrdev"]
|
||||
virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
virtualbox.customize ["modifyvm", :id, "--memory", "512"]
|
||||
virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :path => "shell/initial-setup.sh"
|
||||
config.vm.provision :shell, :path => "shell/update-puppet.sh"
|
||||
config.vm.provision :shell, :path => "shell/librarian-puppet-vagrant.sh"
|
||||
config.vm.provision :puppet do |puppet|
|
||||
puppet.facter = {
|
||||
"ssh_username" => "vagrant"
|
||||
}
|
||||
|
||||
puppet.manifests_path = "puppet/manifests"
|
||||
puppet.options = ["--verbose", "--hiera_config /vagrant/hiera.yaml", "--parser future"]
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
config.ssh.username = "vagrant"
|
||||
|
||||
config.ssh.shell = "bash -l"
|
||||
|
||||
config.ssh.keep_alive = true
|
||||
config.ssh.forward_agent = false
|
||||
config.ssh.forward_x11 = false
|
||||
config.vagrant.host = :detect
|
||||
end
|
||||
|
||||
52
dev/vagrant/dolibarrdev/files/dot/.bash_aliases
Normal file
52
dev/vagrant/dolibarrdev/files/dot/.bash_aliases
Normal file
@ -0,0 +1,52 @@
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
source /etc/bash_completion
|
||||
fi
|
||||
|
||||
__has_parent_dir () {
|
||||
# Utility function so we can test for things like .git/.hg without firing up a
|
||||
# separate process
|
||||
test -d "$1" && return 0;
|
||||
|
||||
current="."
|
||||
while [ ! "$current" -ef "$current/.." ]; do
|
||||
if [ -d "$current/$1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
current="$current/..";
|
||||
done
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
__vcs_name() {
|
||||
if [ -d .svn ]; then
|
||||
echo "-[svn]";
|
||||
elif __has_parent_dir ".git"; then
|
||||
echo "-[$(__git_ps1 'git %s')]";
|
||||
elif __has_parent_dir ".hg"; then
|
||||
echo "-[hg $(hg branch)]"
|
||||
fi
|
||||
}
|
||||
|
||||
black=$(tput -Txterm setaf 0)
|
||||
red=$(tput -Txterm setaf 1)
|
||||
green=$(tput -Txterm setaf 2)
|
||||
yellow=$(tput -Txterm setaf 3)
|
||||
dk_blue=$(tput -Txterm setaf 4)
|
||||
pink=$(tput -Txterm setaf 5)
|
||||
lt_blue=$(tput -Txterm setaf 6)
|
||||
|
||||
bold=$(tput -Txterm bold)
|
||||
reset=$(tput -Txterm sgr0)
|
||||
|
||||
# Nicely formatted terminal prompt
|
||||
export PS1='\n\[$bold\]\[$black\][\[$dk_blue\]\@\[$black\]]-[\[$green\]\u\[$yellow\]@\[$green\]\h\[$black\]]-[\[$pink\]\w\[$black\]]\[\033[0;33m\]$(__vcs_name) \[\033[00m\]\[$reset\]\n\[$reset\]\$ '
|
||||
|
||||
alias ls='ls -F --color=always'
|
||||
alias dir='dir -F --color=always'
|
||||
alias ll='ls -l'
|
||||
alias cp='cp -iv'
|
||||
alias rm='rm -i'
|
||||
alias mv='mv -iv'
|
||||
alias grep='grep --color=auto -in'
|
||||
alias ..='cd ..'
|
||||
414
dev/vagrant/dolibarrdev/files/dot/.vimrc
Normal file
414
dev/vagrant/dolibarrdev/files/dot/.vimrc
Normal file
@ -0,0 +1,414 @@
|
||||
set rtp+=$GOROOT/misc/vim
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Maintainer:
|
||||
" Amir Salihefendic
|
||||
" http://amix.dk - amix@amix.dk
|
||||
"
|
||||
" Version:
|
||||
" 5.0 - 29/05/12 15:43:36
|
||||
"
|
||||
" Blog_post:
|
||||
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
|
||||
"
|
||||
" Awesome_version:
|
||||
" Get this config, nice color schemes and lots of plugins!
|
||||
"
|
||||
" Install the awesome version from:
|
||||
"
|
||||
" https://github.com/amix/vimrc
|
||||
"
|
||||
" Syntax_highlighted:
|
||||
" http://amix.dk/vim/vimrc.html
|
||||
"
|
||||
" Raw_version:
|
||||
" http://amix.dk/vim/vimrc.txt
|
||||
"
|
||||
" Sections:
|
||||
" -> General
|
||||
" -> VIM user interface
|
||||
" -> Colors and Fonts
|
||||
" -> Files and backups
|
||||
" -> Text, tab and indent related
|
||||
" -> Visual mode related
|
||||
" -> Moving around, tabs and buffers
|
||||
" -> Status line
|
||||
" -> Editing mappings
|
||||
" -> vimgrep searching and cope displaying
|
||||
" -> Spell checking
|
||||
" -> Misc
|
||||
" -> Helper functions
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => General
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Sets how many lines of history VIM has to remember
|
||||
set history=700
|
||||
|
||||
" Enable filetype plugins
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
|
||||
" Set to auto read when a file is changed from the outside
|
||||
set autoread
|
||||
|
||||
" With a map leader it's possible to do extra key combinations
|
||||
" like <leader>w saves the current file
|
||||
let mapleader = ","
|
||||
let g:mapleader = ","
|
||||
|
||||
" Fast saving
|
||||
nmap <leader>w :w!<cr>
|
||||
|
||||
" :W sudo saves the file
|
||||
" (useful for handling the permission-denied error)
|
||||
command W w !sudo tee % > /dev/null
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => VIM user interface
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Set 7 lines to the cursor - when moving vertically using j/k
|
||||
set so=7
|
||||
|
||||
" Turn on the WiLd menu
|
||||
set wildmenu
|
||||
|
||||
" Ignore compiled files
|
||||
set wildignore=*.o,*~,*.pyc
|
||||
if has("win16") || has("win32")
|
||||
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
|
||||
else
|
||||
set wildignore+=.git\*,.hg\*,.svn\*
|
||||
endif
|
||||
|
||||
"Always show current position
|
||||
set ruler
|
||||
|
||||
" Height of the command bar
|
||||
set cmdheight=2
|
||||
|
||||
" A buffer becomes hidden when it is abandoned
|
||||
set hid
|
||||
|
||||
" Configure backspace so it acts as it should act
|
||||
set backspace=eol,start,indent
|
||||
set whichwrap+=<,>,h,l
|
||||
|
||||
" Ignore case when searching
|
||||
set ignorecase
|
||||
|
||||
" When searching try to be smart about cases
|
||||
set smartcase
|
||||
|
||||
" Highlight search results
|
||||
set hlsearch
|
||||
|
||||
" Makes search act like search in modern browsers
|
||||
set incsearch
|
||||
|
||||
" Don't redraw while executing macros (good performance config)
|
||||
set lazyredraw
|
||||
|
||||
" For regular expressions turn magic on
|
||||
set magic
|
||||
|
||||
" Show matching brackets when text indicator is over them
|
||||
set showmatch
|
||||
" How many tenths of a second to blink when matching brackets
|
||||
set mat=2
|
||||
|
||||
" No annoying sound on errors
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
set t_vb=
|
||||
set tm=500
|
||||
|
||||
" Add a bit extra margin to the left
|
||||
set foldcolumn=1
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Colors and Fonts
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Enable syntax highlighting
|
||||
syntax enable
|
||||
|
||||
try
|
||||
colorscheme desert
|
||||
catch
|
||||
endtry
|
||||
|
||||
set background=dark
|
||||
|
||||
" Set extra options when running in GUI mode
|
||||
if has("gui_running")
|
||||
set guioptions-=T
|
||||
set guioptions-=e
|
||||
set t_Co=256
|
||||
set guitablabel=%M\ %t
|
||||
endif
|
||||
|
||||
" Set utf8 as standard encoding and en_US as the standard language
|
||||
set encoding=utf8
|
||||
|
||||
" Use Unix as the standard file type
|
||||
set ffs=unix,dos,mac
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Files, backups and undo
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Turn backup off, since most stuff is in SVN, git et.c anyway...
|
||||
set nobackup
|
||||
set nowb
|
||||
set noswapfile
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Text, tab and indent related
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Use spaces instead of tabs
|
||||
set expandtab
|
||||
|
||||
" Be smart when using tabs ;)
|
||||
set smarttab
|
||||
|
||||
" 1 tab == 4 spaces
|
||||
set shiftwidth=4
|
||||
set tabstop=4
|
||||
|
||||
" Linebreak on 500 characters
|
||||
set lbr
|
||||
set tw=500
|
||||
|
||||
set ai "Auto indent
|
||||
set si "Smart indent
|
||||
set wrap "Wrap lines
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""
|
||||
" => Visual mode related
|
||||
""""""""""""""""""""""""""""""
|
||||
" Visual mode pressing * or # searches for the current selection
|
||||
" Super useful! From an idea by Michael Naumann
|
||||
vnoremap <silent> * :call VisualSelection('f', '')<CR>
|
||||
vnoremap <silent> # :call VisualSelection('b', '')<CR>
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Moving around, tabs, windows and buffers
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Treat long lines as break lines (useful when moving around in them)
|
||||
map j gj
|
||||
map k gk
|
||||
|
||||
" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
|
||||
map <space> /
|
||||
map <c-space> ?
|
||||
|
||||
" Disable highlight when <leader><cr> is pressed
|
||||
map <silent> <leader><cr> :noh<cr>
|
||||
|
||||
" Smart way to move between windows
|
||||
map <C-j> <C-W>j
|
||||
map <C-k> <C-W>k
|
||||
map <C-h> <C-W>h
|
||||
map <C-l> <C-W>l
|
||||
|
||||
" Close the current buffer
|
||||
map <leader>bd :Bclose<cr>
|
||||
|
||||
" Close all the buffers
|
||||
map <leader>ba :1,1000 bd!<cr>
|
||||
|
||||
" Useful mappings for managing tabs
|
||||
map <leader>tn :tabnew<cr>
|
||||
map <leader>to :tabonly<cr>
|
||||
map <leader>tc :tabclose<cr>
|
||||
map <leader>tm :tabmove
|
||||
map <leader>t<leader> :tabnext
|
||||
|
||||
" Opens a new tab with the current buffer's path
|
||||
" Super useful when editing files in the same directory
|
||||
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
|
||||
|
||||
" Switch CWD to the directory of the open buffer
|
||||
map <leader>cd :cd %:p:h<cr>:pwd<cr>
|
||||
|
||||
" Specify the behavior when switching between buffers
|
||||
try
|
||||
set switchbuf=useopen,usetab,newtab
|
||||
set stal=2
|
||||
catch
|
||||
endtry
|
||||
|
||||
" Return to last edit position when opening files (You want this!)
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
" Remember info about open buffers on close
|
||||
set viminfo^=%
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""
|
||||
" => Status line
|
||||
""""""""""""""""""""""""""""""
|
||||
" Always show the status line
|
||||
set laststatus=2
|
||||
|
||||
" Format the status line
|
||||
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Editing mappings
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Remap VIM 0 to first non-blank character
|
||||
map 0 ^
|
||||
|
||||
" Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
|
||||
nmap <M-j> mz:m+<cr>`z
|
||||
nmap <M-k> mz:m-2<cr>`z
|
||||
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
|
||||
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
|
||||
|
||||
if has("mac") || has("macunix")
|
||||
nmap <D-j> <M-j>
|
||||
nmap <D-k> <M-k>
|
||||
vmap <D-j> <M-j>
|
||||
vmap <D-k> <M-k>
|
||||
endif
|
||||
|
||||
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
|
||||
func! DeleteTrailingWS()
|
||||
exe "normal mz"
|
||||
%s/\s\+$//ge
|
||||
exe "normal `z"
|
||||
endfunc
|
||||
autocmd BufWrite *.py :call DeleteTrailingWS()
|
||||
autocmd BufWrite *.coffee :call DeleteTrailingWS()
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => vimgrep searching and cope displaying
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" When you press gv you vimgrep after the selected text
|
||||
vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
|
||||
|
||||
" Open vimgrep and put the cursor in the right position
|
||||
map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>
|
||||
|
||||
" Vimgreps in the current file
|
||||
map <leader><space> :vimgrep // <C-R>%<C-A><right><right><right><right><right><right><right><right><right>
|
||||
|
||||
" When you press <leader>r you can search and replace the selected text
|
||||
vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
|
||||
|
||||
" Do :help cope if you are unsure what cope is. It's super useful!
|
||||
"
|
||||
" When you search with vimgrep, display your results in cope by doing:
|
||||
" <leader>cc
|
||||
"
|
||||
" To go to the next search result do:
|
||||
" <leader>n
|
||||
"
|
||||
" To go to the previous search results do:
|
||||
" <leader>p
|
||||
"
|
||||
map <leader>cc :botright cope<cr>
|
||||
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
|
||||
map <leader>n :cn<cr>
|
||||
map <leader>p :cp<cr>
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Spell checking
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Pressing ,ss will toggle and untoggle spell checking
|
||||
map <leader>ss :setlocal spell!<cr>
|
||||
|
||||
" Shortcuts using <leader>
|
||||
map <leader>sn ]s
|
||||
map <leader>sp [s
|
||||
map <leader>sa zg
|
||||
map <leader>s? z=
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Misc
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Remove the Windows ^M - when the encodings gets messed up
|
||||
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
|
||||
|
||||
" Quickly open a buffer for scripbble
|
||||
map <leader>q :e ~/buffer<cr>
|
||||
|
||||
" Toggle paste mode on and off
|
||||
map <leader>pp :setlocal paste!<cr>
|
||||
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Helper functions
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
function! CmdLine(str)
|
||||
exe "menu Foo.Bar :" . a:str
|
||||
emenu Foo.Bar
|
||||
unmenu Foo
|
||||
endfunction
|
||||
|
||||
function! VisualSelection(direction, extra_filter) range
|
||||
let l:saved_reg = @"
|
||||
execute "normal! vgvy"
|
||||
|
||||
let l:pattern = escape(@", '\\/.*$^~[]')
|
||||
let l:pattern = substitute(l:pattern, "\n$", "", "")
|
||||
|
||||
if a:direction == 'b'
|
||||
execute "normal ?" . l:pattern . "^M"
|
||||
elseif a:direction == 'gv'
|
||||
call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.' . a:extra_filter)
|
||||
elseif a:direction == 'replace'
|
||||
call CmdLine("%s" . '/'. l:pattern . '/')
|
||||
elseif a:direction == 'f'
|
||||
execute "normal /" . l:pattern . "^M"
|
||||
endif
|
||||
|
||||
let @/ = l:pattern
|
||||
let @" = l:saved_reg
|
||||
endfunction
|
||||
|
||||
|
||||
" Returns true if paste mode is enabled
|
||||
function! HasPaste()
|
||||
if &paste
|
||||
return 'PASTE MODE '
|
||||
en
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Don't close window, when deleting a buffer
|
||||
command! Bclose call <SID>BufcloseCloseIt()
|
||||
function! <SID>BufcloseCloseIt()
|
||||
let l:currentBufNum = bufnr("%")
|
||||
let l:alternateBufNum = bufnr("#")
|
||||
|
||||
if buflisted(l:alternateBufNum)
|
||||
buffer #
|
||||
else
|
||||
bnext
|
||||
endif
|
||||
|
||||
if bufnr("%") == l:currentBufNum
|
||||
new
|
||||
endif
|
||||
|
||||
if buflisted(l:currentBufNum)
|
||||
execute("bdelete! ".l:currentBufNum)
|
||||
endif
|
||||
endfunction
|
||||
7
dev/vagrant/dolibarrdev/hiera.yaml
Normal file
7
dev/vagrant/dolibarrdev/hiera.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
:backends: yaml
|
||||
:yaml:
|
||||
:datadir: '/vagrant/puppet/hieradata'
|
||||
:hierarchy:
|
||||
- common
|
||||
:logger: console
|
||||
13
dev/vagrant/dolibarrdev/puppet/Puppetfile
Normal file
13
dev/vagrant/dolibarrdev/puppet/Puppetfile
Normal file
@ -0,0 +1,13 @@
|
||||
forge "http://forge.puppetlabs.com"
|
||||
mod 'stdlib', :git => 'git://github.com/puphpet/puppetlabs-stdlib.git'
|
||||
mod 'concat', :git => 'git://github.com/puphpet/puppetlabs-concat.git'
|
||||
mod 'apt', :git => 'git://github.com/puphpet/puppetlabs-apt.git'
|
||||
mod 'yum', :git => 'git://github.com/puphpet/puppet-yum.git'
|
||||
mod 'vcsrepo', :git => 'git://github.com/puphpet/puppetlabs-vcsrepo.git'
|
||||
mod 'ntp', :git => 'git://github.com/puphpet/puppetlabs-ntp.git'
|
||||
mod 'iptables', :git => 'git://github.com/puphpet/puppet-iptables.git'
|
||||
mod 'apache', :git => 'git://github.com/puphpet/puppetlabs-apache.git'
|
||||
mod 'php', :git => 'git://github.com/puphpet/puppet-php.git'
|
||||
mod 'composer', :git => 'git://github.com/puphpet/puppet-composer.git'
|
||||
mod 'puphpet', :git => 'git://github.com/puphpet/puppet-puphpet.git'
|
||||
mod 'mysql', :git => 'git://github.com/puphpet/puppetlabs-mysql.git'
|
||||
121
dev/vagrant/dolibarrdev/puppet/hieradata/common.yaml
Normal file
121
dev/vagrant/dolibarrdev/puppet/hieradata/common.yaml
Normal file
@ -0,0 +1,121 @@
|
||||
---
|
||||
vagrantfile-local:
|
||||
vm:
|
||||
box: debian-wheezy72-x64-vbox43
|
||||
box_url: 'https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box'
|
||||
hostname: null
|
||||
network:
|
||||
private_network: 192.168.42.101
|
||||
forwarded_port:
|
||||
IoUPe5V4KFVe:
|
||||
host: ''
|
||||
guest: ''
|
||||
provider:
|
||||
virtualbox:
|
||||
modifyvm:
|
||||
name: dolibarrdev
|
||||
natdnshostresolver1: on
|
||||
memory: '512'
|
||||
setextradata:
|
||||
VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
|
||||
provision:
|
||||
puppet:
|
||||
manifests_path: puppet/manifests
|
||||
options:
|
||||
- --verbose
|
||||
- '--hiera_config /vagrant/hiera.yaml'
|
||||
- '--parser future'
|
||||
synced_folder:
|
||||
w8TR2T1V5h4o:
|
||||
id: vagrant-root
|
||||
source: ../../../
|
||||
target: /var/www
|
||||
nfs: 'false'
|
||||
usable_port_range: 2200..2250
|
||||
ssh:
|
||||
host: null
|
||||
port: null
|
||||
private_key_path: null
|
||||
username: vagrant
|
||||
guest_port: null
|
||||
keep_alive: true
|
||||
forward_agent: false
|
||||
forward_x11: false
|
||||
shell: 'bash -l'
|
||||
vagrant:
|
||||
host: ':detect'
|
||||
server:
|
||||
packages:
|
||||
- nano
|
||||
- ack-grep
|
||||
dot_files:
|
||||
-
|
||||
bash_aliases: null
|
||||
_prevent_empty: ''
|
||||
apache:
|
||||
modules:
|
||||
- php
|
||||
- rewrite
|
||||
vhosts:
|
||||
vkJFW364QjeN:
|
||||
servername: dev.dolibarr.org
|
||||
docroot: /var/www/htdocs
|
||||
port: '80'
|
||||
setenv:
|
||||
- 'APP_ENV dev'
|
||||
override:
|
||||
- All
|
||||
user: www-data
|
||||
group: www-data
|
||||
default_vhost: true
|
||||
mpm_module: prefork
|
||||
php:
|
||||
version: '55'
|
||||
composer: '1'
|
||||
modules:
|
||||
php:
|
||||
- cli
|
||||
- intl
|
||||
- mcrypt
|
||||
- curl
|
||||
- imagick
|
||||
- gd
|
||||
pear: { }
|
||||
pecl: { }
|
||||
ini:
|
||||
display_errors: On
|
||||
error_reporting: '-1'
|
||||
session.save_path: /var/lib/php/session
|
||||
timezone: UTC
|
||||
xdebug:
|
||||
install: '1'
|
||||
settings:
|
||||
xdebug.default_enable: '1'
|
||||
xdebug.remote_autostart: '0'
|
||||
xdebug.remote_connect_back: '1'
|
||||
xdebug.remote_enable: '1'
|
||||
xdebug.remote_handler: dbgp
|
||||
xdebug.remote_port: '9000'
|
||||
xhprof:
|
||||
install: '1'
|
||||
location: /var/www/xhprof
|
||||
mysql:
|
||||
root_password: root
|
||||
phpmyadmin: '1'
|
||||
databases:
|
||||
4TUR1gNNdrQV:
|
||||
grant:
|
||||
- ALTER
|
||||
- CREATE
|
||||
- DELETE
|
||||
- DROP
|
||||
- INDEX
|
||||
- INSERT
|
||||
- SELECT
|
||||
- UPDATE
|
||||
name: dolibarr
|
||||
host: localhost
|
||||
user: user
|
||||
password: user
|
||||
sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql
|
||||
|
||||
541
dev/vagrant/dolibarrdev/puppet/manifests/default.pp
Normal file
541
dev/vagrant/dolibarrdev/puppet/manifests/default.pp
Normal file
@ -0,0 +1,541 @@
|
||||
## Begin Server manifest
|
||||
|
||||
if $server_values == undef {
|
||||
$server_values = hiera('server', false)
|
||||
}
|
||||
|
||||
# Ensure the time is accurate, reducing the possibilities of apt repositories
|
||||
# failing for invalid certificates
|
||||
include '::ntp'
|
||||
|
||||
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ] }
|
||||
File { owner => 0, group => 0, mode => 0644 }
|
||||
|
||||
group { 'puppet': ensure => present }
|
||||
group { 'www-data': ensure => present }
|
||||
|
||||
user { $::ssh_username:
|
||||
shell => '/bin/bash',
|
||||
home => "/home/${::ssh_username}",
|
||||
ensure => present
|
||||
}
|
||||
|
||||
user { ['apache', 'nginx', 'httpd', 'www-data']:
|
||||
shell => '/bin/bash',
|
||||
ensure => present,
|
||||
groups => 'www-data',
|
||||
require => Group['www-data']
|
||||
}
|
||||
|
||||
file { "/home/${::ssh_username}":
|
||||
ensure => directory,
|
||||
owner => $::ssh_username,
|
||||
}
|
||||
|
||||
# copy dot files to ssh user's home directory
|
||||
exec { 'dotfiles':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "cp -r /vagrant/files/dot/.[a-zA-Z0-9]* /home/${::ssh_username}/ && chown -R ${::ssh_username} /home/${::ssh_username}/.[a-zA-Z0-9]*",
|
||||
onlyif => "test -d /vagrant/files/dot",
|
||||
require => User[$::ssh_username]
|
||||
}
|
||||
|
||||
case $::osfamily {
|
||||
# debian, ubuntu
|
||||
'debian': {
|
||||
class { 'apt': }
|
||||
|
||||
Class['::apt::update'] -> Package <|
|
||||
title != 'python-software-properties'
|
||||
and title != 'software-properties-common'
|
||||
|>
|
||||
|
||||
ensure_packages( ['augeas-tools'] )
|
||||
}
|
||||
# redhat, centos
|
||||
'redhat': {
|
||||
class { 'yum': extrarepo => ['epel'] }
|
||||
|
||||
Class['::yum'] -> Yum::Managed_yumrepo <| |> -> Package <| |>
|
||||
|
||||
exec { 'bash_git':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > /home/${::ssh_username}/.bash_git",
|
||||
creates => "/home/${::ssh_username}/.bash_git"
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_git':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => [
|
||||
Exec['dotfiles'],
|
||||
Exec['bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_aliases':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => [
|
||||
File_line['link ~/.bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
ensure_packages( ['augeas'] )
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
'debian': {
|
||||
add_dotdeb { 'packages.dotdeb.org': release => $lsbdistcodename }
|
||||
|
||||
if is_hash($php_values) {
|
||||
# Debian Squeeze 6.0 can do PHP 5.3 (default) and 5.4
|
||||
if $lsbdistcodename == 'squeeze' and $php_values['version'] == '54' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php54': release => 'squeeze-php54' }
|
||||
}
|
||||
# Debian Wheezy 7.0 can do PHP 5.4 (default) and 5.5
|
||||
elsif $lsbdistcodename == 'wheezy' and $php_values['version'] == '55' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php55': release => 'wheezy-php55' }
|
||||
}
|
||||
}
|
||||
}
|
||||
'ubuntu': {
|
||||
apt::key { '4F4EA0AAE5267A6C': }
|
||||
|
||||
if is_hash($php_values) {
|
||||
# Ubuntu Lucid 10.04, Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.3 (default <= 12.10) and 5.4 (default <= 13.04)
|
||||
if $lsbdistcodename in ['lucid', 'precise', 'quantal', 'raring'] and $php_values['version'] == '54' {
|
||||
if $lsbdistcodename == 'lucid' {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'], options => '' }
|
||||
} else {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
}
|
||||
# Ubuntu Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.5
|
||||
elsif $lsbdistcodename in ['precise', 'quantal', 'raring'] and $php_values['version'] == '55' {
|
||||
apt::ppa { 'ppa:ondrej/php5': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
elsif $lsbdistcodename in ['lucid'] and $php_values['version'] == '55' {
|
||||
err('You have chosen to install PHP 5.5 on Ubuntu 10.04 Lucid. This will probably not work!')
|
||||
}
|
||||
}
|
||||
}
|
||||
'redhat', 'centos': {
|
||||
if is_hash($php_values) {
|
||||
if $php_values['version'] == '54' {
|
||||
class { 'yum::repo::remi': }
|
||||
}
|
||||
# remi_php55 requires the remi repo as well
|
||||
elsif $php_values['version'] == '55' {
|
||||
class { 'yum::repo::remi': }
|
||||
class { 'yum::repo::remi_php55': }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !empty($server_values['packages']) {
|
||||
ensure_packages( $server_values['packages'] )
|
||||
}
|
||||
|
||||
define add_dotdeb ($release){
|
||||
apt::source { $name:
|
||||
location => 'http://packages.dotdeb.org',
|
||||
release => $release,
|
||||
repos => 'all',
|
||||
required_packages => 'debian-keyring debian-archive-keyring',
|
||||
key => '89DF5277',
|
||||
key_server => 'keys.gnupg.net',
|
||||
include_src => true
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Apache manifest
|
||||
|
||||
if $yaml_values == undef {
|
||||
$yaml_values = loadyaml('/vagrant/puppet/hieradata/common.yaml')
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = $yaml_values['apache']
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
|
||||
$webroot_location = $puphpet::params::apache_webroot_location
|
||||
|
||||
exec { "exec mkdir -p ${webroot_location}":
|
||||
command => "mkdir -p ${webroot_location}",
|
||||
onlyif => "test -d ${webroot_location}",
|
||||
}
|
||||
|
||||
if ! defined(File[$webroot_location]) {
|
||||
file { $webroot_location:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => [
|
||||
Exec["exec mkdir -p ${webroot_location}"],
|
||||
Group['www-data']
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
class { 'apache':
|
||||
user => $apache_values['user'],
|
||||
group => $apache_values['group'],
|
||||
default_vhost => $apache_values['default_vhost'],
|
||||
mpm_module => $apache_values['mpm_module'],
|
||||
manage_user => false,
|
||||
manage_group => false
|
||||
}
|
||||
|
||||
if $::osfamily == 'debian' {
|
||||
case $apache_values['mpm_module'] {
|
||||
'prefork': { ensure_packages( ['apache2-mpm-prefork'] ) }
|
||||
'worker': { ensure_packages( ['apache2-mpm-worker'] ) }
|
||||
'event': { ensure_packages( ['apache2-mpm-event'] ) }
|
||||
}
|
||||
} elsif $::osfamily == 'redhat' and ! defined(Iptables::Allow['tcp/80']) {
|
||||
iptables::allow { 'tcp/80':
|
||||
port => '80',
|
||||
protocol => 'tcp'
|
||||
}
|
||||
}
|
||||
|
||||
create_resources(apache::vhost, $apache_values['vhosts'])
|
||||
|
||||
define apache_mod {
|
||||
if ! defined(Class["apache::mod::${name}"]) {
|
||||
class { "apache::mod::${name}": }
|
||||
}
|
||||
}
|
||||
|
||||
if count($apache_values['modules']) > 0 {
|
||||
apache_mod { $apache_values['modules']: }
|
||||
}
|
||||
|
||||
## Begin PHP manifest
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
Class['Php'] -> Class['Php::Devel'] -> Php::Module <| |> -> Php::Pear::Module <| |> -> Php::Pecl::Module <| |>
|
||||
|
||||
if $php_prefix == undef {
|
||||
$php_prefix = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => 'php5-',
|
||||
default => 'php-',
|
||||
}
|
||||
}
|
||||
|
||||
if $php_fpm_ini == undef {
|
||||
$php_fpm_ini = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => '/etc/php5/fpm/php.ini',
|
||||
default => '/etc/php.ini',
|
||||
}
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
include apache::params
|
||||
|
||||
$php_webserver_service = 'httpd'
|
||||
$php_webserver_user = $apache::params::user
|
||||
|
||||
class { 'php':
|
||||
service => $php_webserver_service
|
||||
}
|
||||
} elsif is_hash($nginx_values) {
|
||||
include nginx::params
|
||||
|
||||
$php_webserver_service = "${php_prefix}fpm"
|
||||
$php_webserver_user = $nginx::params::nx_daemon_user
|
||||
|
||||
class { 'php':
|
||||
package => $php_webserver_service,
|
||||
service => $php_webserver_service,
|
||||
service_autorestart => false,
|
||||
config_file => $php_fpm_ini,
|
||||
}
|
||||
|
||||
service { $php_webserver_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
require => Package[$php_webserver_service]
|
||||
}
|
||||
}
|
||||
|
||||
class { 'php::devel': }
|
||||
|
||||
if count($php_values['modules']['php']) > 0 {
|
||||
php_mod { $php_values['modules']['php']:; }
|
||||
}
|
||||
if count($php_values['modules']['pear']) > 0 {
|
||||
php_pear_mod { $php_values['modules']['pear']:; }
|
||||
}
|
||||
if count($php_values['modules']['pecl']) > 0 {
|
||||
php_pecl_mod { $php_values['modules']['pecl']:; }
|
||||
}
|
||||
if count($php_values['ini']) > 0 {
|
||||
$php_values['ini'].each { |$key, $value|
|
||||
puphpet::ini { $key:
|
||||
entry => "CUSTOM/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values['ini']['session.save_path'] != undef {
|
||||
exec {"mkdir -p ${php_values['ini']['session.save_path']}":
|
||||
onlyif => "test ! -d ${php_values['ini']['session.save_path']}",
|
||||
}
|
||||
|
||||
file { $php_values['ini']['session.save_path']:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => Exec["mkdir -p ${php_values['ini']['session.save_path']}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puphpet::ini { $key:
|
||||
entry => 'CUSTOM/date.timezone',
|
||||
value => $php_values['timezone'],
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service
|
||||
}
|
||||
|
||||
define php_mod {
|
||||
php::module { $name: }
|
||||
}
|
||||
define php_pear_mod {
|
||||
php::pear::module { $name: use_package => false }
|
||||
}
|
||||
define php_pecl_mod {
|
||||
php::pecl::module { $name: use_package => false }
|
||||
}
|
||||
|
||||
if $php_values['composer'] == 1 {
|
||||
class { 'composer':
|
||||
target_dir => '/usr/local/bin',
|
||||
composer_file => 'composer',
|
||||
download_method => 'curl',
|
||||
logoutput => false,
|
||||
tmp_path => '/tmp',
|
||||
php_package => "${php::params::module_prefix}cli",
|
||||
curl_package => 'curl',
|
||||
suhosin_enabled => false,
|
||||
}
|
||||
}
|
||||
|
||||
if $xdebug_values == undef {
|
||||
$xdebug_values = hiera('xdebug', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$xdebug_webserver_service = 'httpd'
|
||||
} elsif is_hash($nginx_values) {
|
||||
$xdebug_webserver_service = 'nginx'
|
||||
} else {
|
||||
$xdebug_webserver_service = undef
|
||||
}
|
||||
|
||||
if $xdebug_values['install'] != undef and $xdebug_values['install'] == 1 {
|
||||
class { 'puphpet::xdebug':
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
|
||||
if is_hash($xdebug_values['settings']) and count($xdebug_values['settings']) > 0 {
|
||||
$xdebug_values['settings'].each { |$key, $value|
|
||||
puphpet::ini { $key:
|
||||
entry => "XDEBUG/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Xhprof manifest
|
||||
|
||||
if $xhprof_values == undef {
|
||||
$xhprof_values = hiera('xhprof', false)
|
||||
}
|
||||
|
||||
if is_hash($xhprof_values) and $xhprof_values['install'] == 1 {
|
||||
$xhprofPath = $xhprof_values['location']
|
||||
|
||||
php::pecl::module { 'xhprof':
|
||||
use_package => false,
|
||||
preferred_state => 'beta',
|
||||
}
|
||||
|
||||
exec { 'delete-xhprof-path-if-not-git-repo':
|
||||
command => "rm -rf ${xhprofPath}",
|
||||
onlyif => "test ! -d ${xhprofPath}/.git"
|
||||
}
|
||||
|
||||
vcsrepo { $xhprofPath:
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/facebook/xhprof.git',
|
||||
require => Exec['delete-xhprof-path-if-not-git-repo']
|
||||
}
|
||||
|
||||
file { "${xhprofPath}/xhprof_html":
|
||||
ensure => directory,
|
||||
mode => 0775,
|
||||
require => Vcsrepo[$xhprofPath]
|
||||
}
|
||||
|
||||
composer::exec { 'xhprof-composer-run':
|
||||
cmd => 'install',
|
||||
cwd => $xhprofPath,
|
||||
require => [
|
||||
Class['composer'],
|
||||
File["${xhprofPath}/xhprof_html"]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
## Begin MySQL manifest
|
||||
|
||||
if $mysql_values == undef {
|
||||
$mysql_values = hiera('mysql', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if $mysql_values['root_password'] {
|
||||
class { 'mysql::server':
|
||||
root_password => $mysql_values['root_password'],
|
||||
}
|
||||
|
||||
if is_hash($mysql_values['databases']) and count($mysql_values['databases']) > 0 {
|
||||
create_resources(mysql_db, $mysql_values['databases'])
|
||||
}
|
||||
|
||||
if is_hash($php_values) {
|
||||
if $::osfamily == 'redhat' and $php_values['version'] == '53' and ! defined(Php::Module['mysql']) {
|
||||
php::module { 'mysql': }
|
||||
} elsif ! defined(Php::Module['mysqlnd']) {
|
||||
php::module { 'mysqlnd': }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define mysql_db (
|
||||
$user,
|
||||
$password,
|
||||
$host,
|
||||
$grant = [],
|
||||
$sql_file = false
|
||||
) {
|
||||
if $name == '' or $password == '' or $host == '' {
|
||||
fail( 'MySQL DB requires that name, password and host be set. Please check your settings!' )
|
||||
}
|
||||
|
||||
mysql::db { $name:
|
||||
user => $user,
|
||||
password => $password,
|
||||
host => $host,
|
||||
grant => $grant,
|
||||
sql => $sql_file,
|
||||
}
|
||||
}
|
||||
|
||||
if $mysql_values['phpmyadmin'] == 1 and is_hash($php_values) {
|
||||
if $::osfamily == 'debian' {
|
||||
if $::operatingsystem == 'ubuntu' {
|
||||
apt::key { '80E7349A06ED541C': }
|
||||
apt::ppa { 'ppa:nijel/phpmyadmin': require => Apt::Key['80E7349A06ED541C'] }
|
||||
}
|
||||
|
||||
$phpMyAdmin_package = 'phpmyadmin'
|
||||
$phpMyAdmin_folder = 'phpmyadmin'
|
||||
} elsif $::osfamily == 'redhat' {
|
||||
$phpMyAdmin_package = 'phpMyAdmin.noarch'
|
||||
$phpMyAdmin_folder = 'phpMyAdmin'
|
||||
}
|
||||
|
||||
if ! defined(Package[$phpMyAdmin_package]) {
|
||||
package { $phpMyAdmin_package:
|
||||
require => Class['mysql::server']
|
||||
}
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$mysql_webroot_location = $puphpet::params::apache_webroot_location
|
||||
} elsif is_hash($nginx_values) {
|
||||
$mysql_webroot_location = $puphpet::params::nginx_webroot_location
|
||||
|
||||
mysql_nginx_default_conf { 'override_default_conf':
|
||||
webroot => $mysql_webroot_location
|
||||
}
|
||||
}
|
||||
|
||||
file { "${mysql_webroot_location}/phpmyadmin":
|
||||
target => "/usr/share/${phpMyAdmin_folder}",
|
||||
ensure => link,
|
||||
replace => 'no',
|
||||
require => [
|
||||
Package[$phpMyAdmin_package],
|
||||
File[$mysql_webroot_location]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
define mysql_nginx_default_conf (
|
||||
$webroot
|
||||
) {
|
||||
if $php5_fpm_sock == undef {
|
||||
$php5_fpm_sock = '/var/run/php5-fpm.sock'
|
||||
}
|
||||
|
||||
if $fastcgi_pass == undef {
|
||||
$fastcgi_pass = $php_values['version'] ? {
|
||||
undef => null,
|
||||
'53' => '127.0.0.1:9000',
|
||||
default => "unix:${php5_fpm_sock}"
|
||||
}
|
||||
}
|
||||
|
||||
class { 'puphpet::nginx':
|
||||
fastcgi_pass => $fastcgi_pass,
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
}
|
||||
|
||||
36
dev/vagrant/dolibarrdev/shell/initial-setup.sh
Normal file
36
dev/vagrant/dolibarrdev/shell/initial-setup.sh
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
if [[ ! -d /.puphpet-stuff ]]; then
|
||||
cat /vagrant/shell/self-promotion.txt
|
||||
mkdir /.puphpet-stuff
|
||||
echo "Created directory /.puphpet-stuff"
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
echo "Running initial-setup apt-get update"
|
||||
apt-get update >/dev/null
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
echo "Finished running initial-setup apt-get update"
|
||||
elif [[ "$OS" == 'centos' ]]; then
|
||||
echo "Running initial-setup yum update"
|
||||
yum update -y >/dev/null
|
||||
echo "Finished running initial-setup yum update"
|
||||
|
||||
echo "Installing basic development tools (CentOS)"
|
||||
yum -y groupinstall "Development Tools" >/dev/null
|
||||
echo "Finished installing basic development tools (CentOS)"
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$OS" == 'ubuntu' && ("$CODENAME" == 'lucid' || "$CODENAME" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
|
||||
echo 'Installing basic curl packages (Ubuntu only)'
|
||||
apt-get install -y libcurl3 libcurl4-gnutls-dev >/dev/null
|
||||
echo 'Finished installing basic curl packages (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/ubuntu-required-libraries
|
||||
fi
|
||||
82
dev/vagrant/dolibarrdev/shell/librarian-puppet-vagrant.sh
Normal file
82
dev/vagrant/dolibarrdev/shell/librarian-puppet-vagrant.sh
Normal file
@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
# Directory in which librarian-puppet should manage its modules directory
|
||||
PUPPET_DIR=/etc/puppet/
|
||||
|
||||
$(which git > /dev/null 2>&1)
|
||||
FOUND_GIT=$?
|
||||
|
||||
if [ "$FOUND_GIT" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed ]; then
|
||||
$(which apt-get > /dev/null 2>&1)
|
||||
FOUND_APT=$?
|
||||
$(which yum > /dev/null 2>&1)
|
||||
FOUND_YUM=$?
|
||||
|
||||
echo 'Installing git'
|
||||
|
||||
if [ "${FOUND_YUM}" -eq '0' ]; then
|
||||
yum -q -y makecache
|
||||
yum -q -y install git
|
||||
else
|
||||
apt-get -q -y install git-core >/dev/null
|
||||
fi
|
||||
|
||||
echo 'Finished installing git'
|
||||
fi
|
||||
|
||||
if [[ ! -d "$PUPPET_DIR" ]]; then
|
||||
mkdir -p "$PUPPET_DIR"
|
||||
echo "Created directory $PUPPET_DIR"
|
||||
fi
|
||||
|
||||
cp "/vagrant/puppet/Puppetfile" "$PUPPET_DIR"
|
||||
echo "Copied Puppetfile"
|
||||
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-base-packages ]]; then
|
||||
echo 'Installing base packages for librarian'
|
||||
apt-get install -y build-essential ruby-dev >/dev/null
|
||||
echo 'Finished installing base packages for librarian'
|
||||
|
||||
touch /.puphpet-stuff/librarian-base-packages
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OS" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-libgemplugin-ruby ]]; then
|
||||
echo 'Updating libgemplugin-ruby (Ubuntu only)'
|
||||
apt-get install -y libgemplugin-ruby >/dev/null
|
||||
echo 'Finished updating libgemplugin-ruby (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-libgemplugin-ruby
|
||||
fi
|
||||
|
||||
if [ "$CODENAME" == 'lucid' ] && [ ! -f /.puphpet-stuff/librarian-rubygems-update ]; then
|
||||
echo 'Updating rubygems (Ubuntu Lucid only)'
|
||||
echo 'Ignore all "conflicting chdir" errors!'
|
||||
gem install rubygems-update >/dev/null
|
||||
/var/lib/gems/1.8/bin/update_rubygems >/dev/null
|
||||
echo 'Finished updating rubygems (Ubuntu Lucid only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-rubygems-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/librarian-puppet-installed ]]; then
|
||||
echo 'Installing librarian-puppet'
|
||||
gem install librarian-puppet >/dev/null
|
||||
echo 'Finished installing librarian-puppet'
|
||||
|
||||
echo 'Running initial librarian-puppet'
|
||||
cd "$PUPPET_DIR" && librarian-puppet install --clean >/dev/null
|
||||
echo 'Finished running initial librarian-puppet'
|
||||
|
||||
touch /.puphpet-stuff/librarian-puppet-installed
|
||||
else
|
||||
echo 'Running update librarian-puppet'
|
||||
cd "$PUPPET_DIR" && librarian-puppet update >/dev/null
|
||||
echo 'Finished running update librarian-puppet'
|
||||
fi
|
||||
49
dev/vagrant/dolibarrdev/shell/os-detect.sh
Normal file
49
dev/vagrant/dolibarrdev/shell/os-detect.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Try and get debian operating system
|
||||
# id, codename, and release
|
||||
|
||||
TYPE=$(echo "$1" | tr '[A-Z]' '[a-z]')
|
||||
OS=$(uname)
|
||||
ID="unknown"
|
||||
CODENAME="unknown"
|
||||
RELEASE="unknown"
|
||||
|
||||
if [ "$OS" == "Linux" ]; then
|
||||
# detect centos
|
||||
grep "centos" /etc/issue -i -q
|
||||
if [ $? = '0' ]; then
|
||||
ID="centos"
|
||||
RELEASE=$(cat /etc/redhat-release | grep -o 'release [0-9]' | cut -d " " -f2)
|
||||
# could be debian or ubuntu
|
||||
elif [ $(which lsb_release) ]; then
|
||||
ID=$(lsb_release -i | cut -f2)
|
||||
CODENAME=$(lsb_release -c | cut -f2)
|
||||
RELEASE=$(lsb_release -r | cut -f2)
|
||||
elif [ -f "/etc/lsb-release" ]; then
|
||||
ID=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -d "=" -f2)
|
||||
CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d "=" -f2)
|
||||
RELEASE=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2)
|
||||
elif [ -f "/etc/issue" ]; then
|
||||
ID=$(head -1 /etc/issue | cut -d " " -f1)
|
||||
if [ -f "/etc/debian_version" ]; then
|
||||
RELEASE=$(</etc/debian_version)
|
||||
else
|
||||
RELEASE=$(head -1 /etc/issue | cut -d " " -f2)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
declare -A info
|
||||
|
||||
info[id]=$(echo "$ID" | tr '[A-Z]' '[a-z]')
|
||||
info[codename]=$(echo "$CODENAME" | tr '[A-Z]' '[a-z]')
|
||||
info[release]=$(echo "$RELEASE" | tr '[A-Z]' '[a-z]')
|
||||
|
||||
if [ "$TYPE" ] ; then
|
||||
echo "${info[$TYPE]}"
|
||||
else
|
||||
echo -e "ID\t${info[id]}"
|
||||
echo -e "CODENAME\t${info[codename]}"
|
||||
echo -e "RELEASE\t${info[release]}"
|
||||
fi
|
||||
7
dev/vagrant/dolibarrdev/shell/self-promotion.txt
Normal file
7
dev/vagrant/dolibarrdev/shell/self-promotion.txt
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
____ ____ _ _ ____ _ generated using
|
||||
| _ \ _ _| _ \| | | | _ \ ___| |_ ___ ___ _ __ ___
|
||||
| |_) | | | | |_) | |_| | |_) / _ \ __| / __/ _ \| '_ ` _ \
|
||||
| __/| |_| | __/| _ | __/ __/ |_ | (_| (_) | | | | | |
|
||||
|_| \__,_|_| |_| |_|_| \___|\__(_)___\___/|_| |_| |_|
|
||||
|
||||
43
dev/vagrant/dolibarrdev/shell/update-puppet.sh
Normal file
43
dev/vagrant/dolibarrdev/shell/update-puppet.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
RELEASE=$(/bin/bash /vagrant/shell/os-detect.sh RELEASE)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
wget --quiet --tries=5 --timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
|
||||
dpkg -i "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" >/dev/null
|
||||
|
||||
echo "Running update-puppet apt-get update"
|
||||
apt-get update >/dev/null
|
||||
echo "Finished running update-puppet apt-get update"
|
||||
|
||||
echo "Updating Puppet to latest version"
|
||||
apt-get -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished updating puppet to latest version: $PUPPET_VERSION"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
elif [ "$OS" == 'centos' ]; then
|
||||
echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm" >/dev/null
|
||||
echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
|
||||
echo "Running update-puppet yum update"
|
||||
yum -y update >/dev/null
|
||||
echo "Finished running update-puppet yum update"
|
||||
|
||||
echo "Installing/Updating Puppet to latest version"
|
||||
yum -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished installing/updating puppet to latest version: $PUPPET_VERSION"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
fi
|
||||
fi
|
||||
16
htdocs/.gitignore
vendored
16
htdocs/.gitignore
vendored
@ -1,11 +1,11 @@
|
||||
/test.php
|
||||
/custom*
|
||||
/bootstrap
|
||||
/extensions
|
||||
/google
|
||||
/multicompany
|
||||
/numberingpack
|
||||
/ovh
|
||||
/extensions*
|
||||
/nltechno*
|
||||
/bootstrap*
|
||||
/google*
|
||||
/multicompany*
|
||||
/numberingpack*
|
||||
/ovh*
|
||||
/pos
|
||||
/skincoloreditor
|
||||
/ultimatepdf
|
||||
/ultimatepdf*
|
||||
|
||||
@ -285,7 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
$object->phone_perso = trim($_POST["phone_perso"]);
|
||||
$object->phone_mobile= trim($_POST["phone_mobile"]);
|
||||
$object->email = trim($_POST["email"]);
|
||||
$object->skype = trim($_POST["skype"]);
|
||||
$object->skype = trim($_POST["skype"]);
|
||||
$object->birth = $birthdate;
|
||||
|
||||
$object->typeid = $_POST["typeid"];
|
||||
@ -428,7 +428,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$phone=$_POST["phone"];
|
||||
$phone_perso=$_POST["phone_perso"];
|
||||
$phone_mobile=$_POST["phone_mobile"];
|
||||
$skype=$_POST["member_skype"];
|
||||
$skype=$_POST["member_skype"];
|
||||
$email=$_POST["member_email"];
|
||||
$login=$_POST["member_login"];
|
||||
$pass=$_POST["password"];
|
||||
@ -453,7 +453,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$object->phone = $phone;
|
||||
$object->phone_perso = $phone_perso;
|
||||
$object->phone_mobile= $phone_mobile;
|
||||
$object->skype = $skype;
|
||||
$object->skype = $skype;
|
||||
$object->email = $email;
|
||||
$object->login = $login;
|
||||
$object->pass = $pass;
|
||||
@ -861,11 +861,11 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled) && $user->rights->skype->view)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype','alpha')?GETPOST('member_skype','alpha'):$object->skype).'"></td></tr>';
|
||||
}
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype','alpha')?GETPOST('member_skype','alpha'):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
@ -1103,11 +1103,11 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled) && $user->rights->skype->view)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
|
||||
}
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
@ -1328,7 +1328,7 @@ else
|
||||
|
||||
/*
|
||||
* Confirm add in spip
|
||||
*/
|
||||
*/
|
||||
if ($action == 'add_spip')
|
||||
{
|
||||
print $form->formconfirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
|
||||
@ -1336,7 +1336,7 @@ else
|
||||
|
||||
/*
|
||||
* Confirm removed from spip
|
||||
*/
|
||||
*/
|
||||
if ($action == 'del_spip')
|
||||
{
|
||||
print $form->formconfirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
|
||||
@ -1345,6 +1345,7 @@ else
|
||||
$rowspan=17;
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
|
||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||
if (! empty($conf->skype->enabled)) $rowspan++;
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@ -1427,12 +1428,12 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled) && $user->rights->skype->view)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
|
||||
}
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/agenda.php
|
||||
* \file htdocs/admin/agenda_other.php
|
||||
* \ingroup agenda
|
||||
* \brief Autocreate actions for agenda module setup page
|
||||
*/
|
||||
|
||||
@ -177,13 +177,13 @@ while ($i < $nbofbank)
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print img_picto($langs->trans("Activated"),'on');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&value='.$i.'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print img_picto($langs->trans("Disabled"),'off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
|
||||
@ -292,14 +292,14 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
// Country
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td class="maxwidthonsmartphone">';
|
||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
||||
print $form->select_country($mysoc->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
@ -42,9 +42,6 @@ $consts=GETPOST('const');
|
||||
$constname=GETPOST('constname','alpha');
|
||||
$constvalue=GETPOST('constvalue');
|
||||
$constnote=GETPOST('constnote','alpha');
|
||||
$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine');
|
||||
|
||||
$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
|
||||
|
||||
|
||||
|
||||
@ -52,7 +49,7 @@ $typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add')
|
||||
if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
@ -69,9 +66,13 @@ if ($action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (dolibarr_set_const($db, $constname, $constvalue, $typeconst[$consttype], 1, $constnote, $entity) >= 0)
|
||||
if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("RecordSaved"));
|
||||
$action="";
|
||||
$constname="";
|
||||
$constvalue="";
|
||||
$constnote="";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -176,6 +177,10 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup');
|
||||
print $langs->trans("ConstDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -189,15 +194,12 @@ print "</tr>\n";
|
||||
// Line to add new record
|
||||
$var=false;
|
||||
print "\n";
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<tr '.$bc[$var].'><td><input type="text" class="flat" size="24" name="constname" value=""></td>'."\n";
|
||||
print '<tr '.$bc[$var].'><td><input type="text" class="flat" size="24" name="constname" value="'.$constname.'"></td>'."\n";
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="30" name="constvalue" value="">';
|
||||
print '<input type="text" class="flat" size="30" name="constvalue" value="'.$constvalue.'">';
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat" size="40" name="constnote" value="">';
|
||||
print '<input type="text" class="flat" size="40" name="constnote" value="'.$constnote.'">';
|
||||
print '</td>';
|
||||
// Limit to superadmin
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
@ -205,22 +207,17 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="Button">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '</form>';
|
||||
print "\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
|
||||
// Show constants
|
||||
$sql = "SELECT";
|
||||
@ -250,21 +247,20 @@ if ($result)
|
||||
$var=!$var;
|
||||
|
||||
print "\n";
|
||||
print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->name.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][type]" value="'.$obj->type.'">';
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td>'."\n";
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.htmlspecialchars($obj->value).'"';
|
||||
print '>';
|
||||
print '</td><td>';
|
||||
print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->name.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][type]" value="'.$obj->type.'">';
|
||||
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.htmlspecialchars($obj->value).'">';
|
||||
print '</td>';
|
||||
|
||||
// Note
|
||||
print '<input type="text" id="note_'.$i.'"class="flat inputforupdate" size="40" name="const['.$i.'][note]" value="'.htmlspecialchars($obj->note,1).'"';
|
||||
print '>';
|
||||
print '<td>';
|
||||
print '<input type="text" id="note_'.$i.'"class="flat inputforupdate" size="40" name="const['.$i.'][note]" value="'.htmlspecialchars($obj->note,1).'">';
|
||||
print '</td>';
|
||||
|
||||
// Entity limit to superadmin
|
||||
@ -273,13 +269,14 @@ if ($result)
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">';
|
||||
|
||||
@ -446,7 +446,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
// Other checks
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
|
||||
$ok=0;
|
||||
$ok=0;
|
||||
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
|
||||
}
|
||||
if (isset($_POST["code"]))
|
||||
@ -456,8 +456,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$ok=0;
|
||||
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
|
||||
}
|
||||
// FIXME regresion if code with not in numeric base
|
||||
/*if (!is_numeric($_POST['code']))
|
||||
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
||||
{
|
||||
$ok = 0;
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
@ -1100,7 +1099,7 @@ if ($id)
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0;
|
||||
else if ($obj->code == 'RECEP') $iserasable = 0;
|
||||
else if ($obj->code == 'EF0') $iserasable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
|
||||
|
||||
@ -1316,9 +1315,9 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
$size='';
|
||||
if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
||||
if ($fieldlist[$field]=='tracking') $size='size="92" ';
|
||||
if ($fieldlist[$field]=='accountancy_code') $size='size="15" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';
|
||||
if ($fieldlist[$field]=='accountancy_code') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" ';
|
||||
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -136,44 +136,57 @@ foreach ($modulesdir as $dir)
|
||||
try
|
||||
{
|
||||
$res=include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
$modNameLoaded[$modName]=$dir;
|
||||
if (class_exists($modName))
|
||||
{
|
||||
try {
|
||||
$objMod = new $modName($db);
|
||||
$modNameLoaded[$modName]=$dir;
|
||||
|
||||
if ($objMod->numero > 0)
|
||||
{
|
||||
$j = $objMod->numero;
|
||||
}
|
||||
else
|
||||
{
|
||||
$j = 1000 + $i;
|
||||
}
|
||||
if ($objMod->numero > 0)
|
||||
{
|
||||
$j = $objMod->numero;
|
||||
}
|
||||
else
|
||||
{
|
||||
$j = 1000 + $i;
|
||||
}
|
||||
|
||||
$modulequalified=1;
|
||||
$modulequalified=1;
|
||||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
||||
// We discard modules according to property disabled
|
||||
if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false;
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
||||
// We discard modules according to property disabled
|
||||
if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false;
|
||||
|
||||
// Define array $categ with categ with at least one qualified module
|
||||
if ($modulequalified)
|
||||
{
|
||||
$modules[$i] = $objMod;
|
||||
$filename[$i]= $modName;
|
||||
$orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number
|
||||
$dirmod[$i] = $dir;
|
||||
// Set categ[$i]
|
||||
$special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown';
|
||||
if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev';
|
||||
if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories
|
||||
else $categ[$special]=1;
|
||||
$j++;
|
||||
$i++;
|
||||
}
|
||||
else dol_syslog("Module ".get_class($objMod)." not qualified");
|
||||
}
|
||||
// Define array $categ with categ with at least one qualified module
|
||||
if ($modulequalified)
|
||||
{
|
||||
$modules[$i] = $objMod;
|
||||
$filename[$i]= $modName;
|
||||
$orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number
|
||||
$dirmod[$i] = $dir;
|
||||
// Set categ[$i]
|
||||
$special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown';
|
||||
if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev';
|
||||
if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories
|
||||
else $categ[$special]=1;
|
||||
$j++;
|
||||
$i++;
|
||||
}
|
||||
else dol_syslog("Module ".get_class($objMod)." not qualified");
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
||||
|
||||
@ -77,10 +77,12 @@ if ($action == "set")
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -458,10 +458,10 @@ print "</tr>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_FREE_TEXT">';
|
||||
print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
|
||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
||||
print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>';
|
||||
print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>';
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 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
|
||||
@ -49,7 +50,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='commande_fournisseur'; //Must be the $table_element of the class that manage extrafield
|
||||
$elementtype='facture_fourn'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
@ -74,15 +74,27 @@ foreach($modulesdir as $dir)
|
||||
else
|
||||
{
|
||||
// File to load
|
||||
include_once $dir.$file;
|
||||
|
||||
$objMod = new $modName($db);
|
||||
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
$modules_files[$objMod->numero]=$file;
|
||||
$modules_fullpath[$file]=$dir.$file;
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
$res=include_once $dir.$file;
|
||||
if (class_exists($modName))
|
||||
{
|
||||
try {
|
||||
$objMod = new $modName($db);
|
||||
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
$modules_files[$objMod->numero]=$file;
|
||||
$modules_fullpath[$file]=$dir.$file;
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2013 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
|
||||
@ -68,7 +68,12 @@ foreach ($triggers as $trigger)
|
||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||
print '<td valign="top">'.$form->textwithpicto('', $trigger['info']).'</td>';
|
||||
print '<td valign="top">';
|
||||
$text=$trigger['info'];
|
||||
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
||||
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
||||
print $form->textwithpicto('', $text);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
200
htdocs/barcode/printsheet.php
Normal file
200
htdocs/barcode/printsheet.php
Normal file
@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/barcode/printsheet.php
|
||||
* \ingroup member
|
||||
* \brief Page to print sheets with barcodes using the document templates into core/modules/printsheets
|
||||
*/
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
|
||||
// Choix de l'annee d'impression ou annee courante.
|
||||
$now = dol_now();
|
||||
$year=dol_print_date($now,'%Y');
|
||||
$month=dol_print_date($now,'%m');
|
||||
$day=dol_print_date($now,'%d');
|
||||
$forbarcode=GETPOST('forbarcode');
|
||||
$forbartype=GETPOST('forbartype');
|
||||
$mode=GETPOST('mode');
|
||||
$model=GETPOST("model"); // Doc template to use for business cards
|
||||
$modellabel=GETPOST("modellabel"); // Doc template to use for address sheet
|
||||
$mesg='';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'builddoc' && empty($forbarcode))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Barcode"));
|
||||
}
|
||||
if ($action == 'builddoc' && empty($forbartype))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("BarcodeType"));
|
||||
}
|
||||
|
||||
if ((! empty($forbarcode) || ! empty($forbartype) || ! empty($mode)) && ! $mesg)
|
||||
{
|
||||
// List of values to scan for a replacement
|
||||
$substitutionarray = array (
|
||||
'%LOGIN%'=>$user->login,
|
||||
'%COMPANY%'=>$mysoc->name,
|
||||
'%ADDRESS%'=>$mysoc->address,
|
||||
'%ZIP%'=>$mysoc->zip,
|
||||
'%TOWN%'=>$mysoc->town,
|
||||
'%COUNTRY%'=>$mysoc->country,
|
||||
'%COUNTRY_CODE%'=>$mysoc->country_code,
|
||||
'%EMAIL%'=>$mysoc->email,
|
||||
'%YEAR%'=>$year,
|
||||
'%MONTH%'=>$month,
|
||||
'%DAY%'=>$day,
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
// For business cards
|
||||
if (empty($mode) || $mode=='card' || $mode=='cardlogin')
|
||||
{
|
||||
$textleft=make_substitutions($conf->global->ADHERENT_CARD_TEXT, $substitutionarray);
|
||||
$textheader=make_substitutions($conf->global->ADHERENT_CARD_HEADER_TEXT, $substitutionarray);
|
||||
$textfooter=make_substitutions($conf->global->ADHERENT_CARD_FOOTER_TEXT, $substitutionarray);
|
||||
$textright=make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
|
||||
|
||||
if (is_numeric($forbarcode) || $forbartype)
|
||||
{
|
||||
for($j=0;$j<100;$j++)
|
||||
{
|
||||
$arrayofmembers[]=array(
|
||||
'textleft'=>$textleft,
|
||||
'textheader'=>$textheader,
|
||||
'textfooter'=>$textfooter,
|
||||
'textright'=>$textright,
|
||||
'id'=>$objp->rowid,
|
||||
'photo'=>$objp->photo
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$arrayofmembers[]=array(
|
||||
'textleft'=>$textleft,
|
||||
'textheader'=>$textheader,
|
||||
'textfooter'=>$textfooter,
|
||||
'textright'=>$textright,
|
||||
'id'=>$objp->rowid,
|
||||
'photo'=>$objp->photo
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// For labels
|
||||
if ($mode == 'label')
|
||||
{
|
||||
if (empty($conf->global->ADHERENT_ETIQUETTE_TEXT)) $conf->global->ADHERENT_ETIQUETTE_TEXT="%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%";
|
||||
$textleft=make_substitutions($conf->global->ADHERENT_ETIQUETTE_TEXT, $substitutionarray);
|
||||
$textheader='';
|
||||
$textfooter='';
|
||||
$textright='';
|
||||
|
||||
$arrayofmembers[]=array('textleft'=>$textleft,
|
||||
'textheader'=>$textheader,
|
||||
'textfooter'=>$textfooter,
|
||||
'textright'=>$textright,
|
||||
'id'=>$objp->rowid,
|
||||
'photo'=>$objp->photo);
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
// Build and output PDF
|
||||
if ($mode == 'label')
|
||||
{
|
||||
if (! count($arrayofmembers))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
if (empty($modellabel) || $modellabel == '-1')
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_ETIQUETTE_TYPE"));
|
||||
}
|
||||
if (! $mesg) $result=members_label_pdf_create($db, $arrayofmembers, $modellabel, $outputlangs);
|
||||
}
|
||||
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error('',$result);
|
||||
}
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("BarCodePrintsheet"));
|
||||
|
||||
print_fiche_titre($langs->trans("BarCodePrintsheet"));
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("PageToGenerateBarCodeSheets").'<br>';
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
print img_picto('','puce').' '.$langs->trans("BarCodePrintsheet").' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="mode" value="label">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' ';
|
||||
// List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
|
||||
$arrayoflabels=array();
|
||||
foreach(array_keys($_Avery_Labels) as $codecards)
|
||||
{
|
||||
$arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name'];
|
||||
}
|
||||
print $form->selectarray('modellabel',$arrayoflabels,(GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE),1,0,0);
|
||||
print '<br>'.$langs->trans("Barcode").': <input size="10" type="text" name="forbarcode" value="'.GETPOST('forbarcode').'">';
|
||||
print '<br>'.$langs->trans("Bartype").': <input size="10" type="text" name="forbartype" value="'.GETPOST('forbartype').'">';
|
||||
|
||||
$barcodestickersmask=GETPOST('barcodestickersmask');
|
||||
print '<br>'.$langs->trans("BarcodeStickersMask").': <textarea cols="40" type="text" name="barcodestickersmask" value="'.GETPOST('barcodestickersmask').'">'.$barcodestickersmask.'</textarea>';
|
||||
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -67,6 +67,7 @@ function printBookmarksList($aDb, $aLangs)
|
||||
{
|
||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||
$sql.= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY position";
|
||||
if ($resql = $db->query($sql) )
|
||||
{
|
||||
|
||||
@ -57,10 +57,13 @@ class Bookmark
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, fk_user, dateb as datec, url, target,";
|
||||
$sql.= " title, position, favicon";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
dol_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@ -96,6 +99,8 @@ class Bookmark
|
||||
*/
|
||||
function create()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Clean parameters
|
||||
$this->url=trim($this->url);
|
||||
$this->title=trim($this->title);
|
||||
@ -106,13 +111,15 @@ class Bookmark
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_user,dateb,url,target";
|
||||
$sql.= " ,title,favicon,position";
|
||||
$sql.= ",title,favicon,position";
|
||||
$sql.= ",entity";
|
||||
if ($this->fk_soc) $sql.=",fk_soc";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= ($this->fk_user > 0?"'".$this->fk_user."'":"0").",";
|
||||
$sql.= " ".$this->db->idate($now).",";
|
||||
$sql.= " '".$this->url."', '".$this->target."',";
|
||||
$sql.= " '".$this->db->escape($this->title)."', '".$this->favicon."', '".$this->position."'";
|
||||
$sql.= ", '".$conf->entity."'";
|
||||
if ($this->fk_soc) $sql.=",".$this->fk_soc;
|
||||
$sql.= ")";
|
||||
|
||||
|
||||
@ -26,8 +26,14 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||
|
||||
$langs->load("bookmarks");
|
||||
$langs->load("other");
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->bookmark->lire) {
|
||||
restrictedArea($user, 'bookmarks');
|
||||
}
|
||||
|
||||
$id=GETPOST("id");
|
||||
$action=GETPOST("action","alpha");
|
||||
$title=GETPOST("title","alpha");
|
||||
|
||||
@ -24,6 +24,12 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||
|
||||
$langs->load("bookmarks");
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->bookmark->lire) {
|
||||
restrictedArea($user, 'bookmarks');
|
||||
}
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@ -73,6 +79,7 @@ $sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.t
|
||||
$sql.= " u.login, u.lastname, u.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
||||
$sql.= " WHERE 1=1";
|
||||
$sql.= " AND b.entity = ".$conf->entity;
|
||||
if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)";
|
||||
$sql.= $db->order($sortfield.", position",$sortorder);
|
||||
$sql.= $db->plimit($limit, $offset);
|
||||
|
||||
@ -15,6 +15,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/deconnexion.php
|
||||
* \ingroup cashdesk
|
||||
* \brief Manage deconnexion for point of sale module
|
||||
*/
|
||||
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Uncomment creates pb to relogon after a disconnect
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Adolfo Segura <adolfo.segura@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
|
||||
@ -37,7 +39,20 @@ if ( GETPOST('filtre') ) {
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||
$sql.= " AND (p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '%".$db->escape(GETPOST('filtre'))."%')";
|
||||
if (! empty($conf->barcode->enabled)) {
|
||||
|
||||
$filtre = GETPOST('filtre');
|
||||
|
||||
//If the barcode looks like an EAN13 format and the last digit is included in it,
|
||||
//then whe look for the 12-digit too
|
||||
//As the twelve-digit string will also hit the 13-digit code, we only look for this one
|
||||
if (strlen($filtre) == 13) {
|
||||
$crit_12digit = substr($filtre, 0, 12);
|
||||
$sql .= " OR p.barcode LIKE '%".$db->escape($crit_12digit)."%')";
|
||||
} else {
|
||||
$sql.= " OR p.barcode LIKE '%".$db->escape($filtre)."%')";
|
||||
}
|
||||
}
|
||||
else $sql.= ")";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
|
||||
@ -17,8 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* This page is called each time we press a key in the code
|
||||
* search form to show product combo list.
|
||||
* \file htdocs/cashdesk/facturation_dhtml.php
|
||||
* \ingroup cashdesk
|
||||
* \brief This page is called each time we press a key in the code search form to show product combo list.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -16,6 +16,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/facturation_verif.php
|
||||
* \ingroup cashdesk
|
||||
* \brief facturation_verif.php
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
||||
|
||||
@ -20,6 +20,12 @@
|
||||
* We set here login choices into session.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/index_verif.php
|
||||
* \ingroup cashdesk
|
||||
* \brief index_verif.php
|
||||
*/
|
||||
|
||||
include '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php';
|
||||
|
||||
@ -140,9 +140,9 @@ print $object->ref;
|
||||
|
||||
<table class="totaux">
|
||||
<?php
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalHT").'</th><td class="nowrap">'.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalVAT").'</th><td class="nowrap">'.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalHT").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
@ -15,6 +15,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/validation.php
|
||||
* \ingroup cashdesk
|
||||
* \brief validation.php
|
||||
*/
|
||||
|
||||
// Affichage des templates
|
||||
require ('tpl/validation1.tpl.php');
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 J<EFBFBD>r<EFBFBD>mie Ollivier <jeremie.o@laposte.net>
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.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
|
||||
@ -15,7 +15,13 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Affichage des templates
|
||||
require ('tpl/validation2.tpl.php');
|
||||
/**
|
||||
* \file htdocs/cashdesk/validation_ok.php
|
||||
* \ingroup cashdesk
|
||||
* \brief validation_ok.php
|
||||
*/
|
||||
|
||||
// Affichage des templates
|
||||
require ('tpl/validation2.tpl.php');
|
||||
|
||||
?>
|
||||
|
||||
@ -15,6 +15,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/validation_ticket.php
|
||||
* \ingroup cashdesk
|
||||
* \brief validation_ticket.php
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
||||
|
||||
@ -17,6 +17,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/cashdesk/validation_verif.php
|
||||
* \ingroup cashdesk
|
||||
* \brief validation_verif.php
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
||||
@ -212,7 +218,7 @@ switch ($action)
|
||||
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user,$obj_facturation->numInvoice());
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -379,7 +379,7 @@ else if ($id || $ref)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
formCategory($db,$product,0,($user->rights->produit->creer || $user->rights->service->creer));
|
||||
formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer));
|
||||
}
|
||||
|
||||
if ($type == 3)
|
||||
@ -604,7 +604,7 @@ else if ($id || $ref)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
formCategory($db,$object,4,$user->rights->societe->creer);
|
||||
formCategory($db,$object,4,$socid, $user->rights->societe->creer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ if ($action == 'add_action')
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
|
||||
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
|
||||
60;
|
||||
|
||||
$usertodo=new User($db);
|
||||
@ -193,7 +193,7 @@ if ($action == 'add_action')
|
||||
}
|
||||
|
||||
// Special for module webcal and phenix
|
||||
// FIXME external modules
|
||||
// TODO external modules
|
||||
if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $actioncomm->use_webcal=1;
|
||||
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;
|
||||
|
||||
@ -484,7 +484,7 @@ if ($action == 'create')
|
||||
|
||||
// Full day
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
|
||||
|
||||
|
||||
// Date start
|
||||
$datep=$actioncomm->datep;
|
||||
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
|
||||
@ -565,7 +565,7 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$events=array();
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
//For external user force the company to user company
|
||||
@ -581,7 +581,7 @@ if ($action == 'create')
|
||||
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
@ -623,7 +623,7 @@ if ($action == 'create')
|
||||
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/societe/admin/societe_extrafields.php
|
||||
* \ingroup societe
|
||||
* \file htdocs/comm/admin/propal_extrafields.php
|
||||
* \ingroup propal
|
||||
* \brief Page to setup extra fields of third party
|
||||
*/
|
||||
|
||||
|
||||
@ -1,149 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/bookmark.php
|
||||
* \brief Page affichage des bookmarks
|
||||
*/
|
||||
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="bid";
|
||||
$limit = $conf->liste_limit;
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'add')
|
||||
{
|
||||
$bookmark=new Bookmark($db);
|
||||
$bookmark->fk_user=$user->id;
|
||||
$bookmark->url=$user->id;
|
||||
$bookmark->target=$user->id;
|
||||
$bookmark->title='xxx';
|
||||
$bookmark->favicon='xxx';
|
||||
|
||||
$res=$bookmark->create();
|
||||
if ($res > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$bookmark->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$bookmark=new Bookmark($db);
|
||||
$bookmark->id=$_GET["bid"];
|
||||
$bookmark->url=$user->id;
|
||||
$bookmark->target=$user->id;
|
||||
$bookmark->title='xxx';
|
||||
$bookmark->favicon='xxx';
|
||||
|
||||
$res=$bookmark->remove();
|
||||
if ($res > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$bookmark->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("Bookmarks"));
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, u.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE b.fk_soc = s.rowid AND b.fk_user=u.rowid";
|
||||
if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($sortorder == "DESC") $sortorder="ASC";
|
||||
else $sortorder="DESC";
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
//print "<td> </td>";
|
||||
print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"],"bid","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.lastname","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Url"),$_SERVER["PHP_SELF"],"b.url","","",'',$sortfield,$sortorder);
|
||||
print "<td>".$langs->trans("Target")."</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
//print "<td>" . ($i + 1 + ($limit * $page)) . "</td>";
|
||||
print "<td align=\"center\"><b>".$obj->bid."</b></td>";
|
||||
print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->lastname." ".$obj->firstname."</a></td>\n";
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateb))."</td>";
|
||||
print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->name."</a></td>\n";
|
||||
print '<td align="center">'.$obj->url."</td>";
|
||||
print '<td align="center">'.$obj->target."</td>";
|
||||
print "<td><a href=\"bookmark.php?action=delete&bid=".$obj->bid."\">".img_delete()."</a></td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -42,6 +42,7 @@ $search_lastname=GETPOST('search_nom')?GETPOST('search_nom'):GETPOST('search_las
|
||||
$search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility
|
||||
$search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility
|
||||
$contactname=GETPOST('contactname');
|
||||
$begin=GETPOST('begin','alpha');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -87,13 +88,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
|
||||
if (dol_strlen($stcomm))
|
||||
{
|
||||
$sql.= " AND s.fk_stcomm=$stcomm";
|
||||
}
|
||||
|
||||
// FIXME $begin not exist
|
||||
if (dol_strlen($begin)) // filtre sur la premiere lettre du nom
|
||||
{
|
||||
$sql.= " AND upper(p.name) LIKE '".$begin."%'";
|
||||
$sql.= " AND s.fk_stcomm=".$db->escape($stcomm);
|
||||
}
|
||||
|
||||
if (! empty($search_lastname))
|
||||
@ -113,7 +108,7 @@ if (! empty($search_company))
|
||||
|
||||
if (! empty($contactname)) // acces a partir du module de recherche
|
||||
{
|
||||
$sql.= " AND (p.name LIKE '%".$db->escape(strtolower($contactname))."%' OR lower(p.firstname) LIKE '%".$db->escape(strtolower($contactname))."%') ";
|
||||
$sql.= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
|
||||
$sortfield = "p.name";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
@ -124,55 +119,57 @@ $sql.= $db->plimit($limit+1, $offset);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
|
||||
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], "&type=$type",$sortfield,$sortorder,"",$num);
|
||||
$param="&type=".$type;
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin,"&type=$type","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin,"&type=$type","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin,"&type=$type","",$sortfield,$sortorder);
|
||||
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
|
||||
print "</tr>\n";
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
|
||||
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num);
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
|
||||
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$i = 0;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
$var=!$var;
|
||||
$var=True;
|
||||
$i = 0;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
|
||||
print '</a> <a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
|
||||
print "<td>$obj->firstname</TD>";
|
||||
$var=!$var;
|
||||
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a> ';
|
||||
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
|
||||
print '</a> <a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
|
||||
print "<td>$obj->firstname</TD>";
|
||||
|
||||
print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a> ';
|
||||
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";
|
||||
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').' </td>';
|
||||
print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table></p>";
|
||||
$db->free($resql);
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').' </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table></p>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -182,5 +179,4 @@ else
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
?>
|
||||
?>
|
||||
@ -267,11 +267,11 @@ if ($id > 0)
|
||||
// Fax
|
||||
print '<td>'.$langs->trans('Fax').'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled) && $user->rights->skype->view)
|
||||
{
|
||||
print '<td>'.$langs->trans('Skype').'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
|
||||
}
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<td>'.$langs->trans('Skype').'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
|
||||
}
|
||||
|
||||
// Assujeti a TVA ou pas
|
||||
print '<tr>';
|
||||
|
||||
@ -53,26 +53,6 @@ $now=dol_now();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add_bookmark' && ! empty($socid))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$db->escape($socid)." AND fk_user=".$user->id;
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$db->escape($socid).", ".$db->idate($now).",".$user->id.");";
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'del_bookmark' && ! empty($bid))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$db->escape($bid);
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -60,6 +60,8 @@ if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
$search_sale = GETPOST("search_sale");
|
||||
$search_categ = GETPOST("search_categ",'int');
|
||||
$catid = GETPOST("catid",'int');
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('customerlist'));
|
||||
@ -104,17 +106,15 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql.= " s.datec, s.datea, s.canvas";
|
||||
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale || !$user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fk_stcomm = st.id";
|
||||
$sql.= " AND s.client IN (1, 3)";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
||||
if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
@ -149,8 +149,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||
|
||||
dol_syslog('comm:list.php: sql='.$sql,LOG_DEBUG);
|
||||
|
||||
dol_syslog('comm/list.php: sql='.$sql,LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
||||
@ -700,6 +700,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$price_min=0;
|
||||
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $txtva par celui du produit
|
||||
@ -858,6 +860,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
@ -898,6 +902,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
@ -981,6 +987,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result = $object->updateline(
|
||||
GETPOST('lineid'),
|
||||
$pu_ht,
|
||||
@ -1006,6 +1014,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
@ -1035,6 +1045,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
@ -1968,8 +1980,8 @@ else
|
||||
|
||||
// Amount HT
|
||||
print '<tr><td height="10" width="25%">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($object->total_ht,'',$langs,0,-1,-1,$conf->currency).'</b></td>';
|
||||
print '<td></td>';
|
||||
|
||||
// Margin Infos
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
@ -1981,28 +1993,28 @@ else
|
||||
|
||||
// Amount VAT
|
||||
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_tva,'',$langs,0,-1,-1,$conf->currency).'</td>';
|
||||
print '<td></td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->localtax1_assuj=="1") //Localtax1
|
||||
{
|
||||
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_localtax1,'',$langs,0,-1,-1,$conf->currency).'</td>';
|
||||
print '<td></td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2
|
||||
{
|
||||
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_localtax2,'',$langs,0,-1,-1,$conf->currency).'</td>';
|
||||
print '<td></td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Amount TTC
|
||||
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<td align="right" class="nowrap">'.price($object->total_ttc,'',$langs,0,-1,-1,$conf->currency).'</td>';
|
||||
print '<td></td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="2">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
@ -2056,7 +2056,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
// We remove directory
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if ($conf->propal->dir_output)
|
||||
if ($conf->propal->dir_output && !empty($this->ref))
|
||||
{
|
||||
$dir = $conf->propal->dir_output . "/" . $ref ;
|
||||
$file = $dir . "/" . $ref . ".pdf";
|
||||
@ -3038,7 +3038,8 @@ class PropaleLigne extends CommonObject
|
||||
if (empty($this->localtax2_type)) $this->localtax2_type=0;
|
||||
if (empty($this->marque_tx)) $this->marque_tx=0;
|
||||
if (empty($this->marge_tx)) $this->marge_tx=0;
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->price)) $this->price=0; // TODO A virer
|
||||
if (empty($this->remise)) $this->remise=0; // TODO A virer
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/document.php
|
||||
* \ingroup propale
|
||||
* \ingroup propal
|
||||
* \brief Management page of documents attached to a business proposal
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/info.php
|
||||
* \ingroup propale
|
||||
* \ingroup propal
|
||||
* \brief Page d'affichage des infos d'une proposition commerciale
|
||||
*/
|
||||
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal.php
|
||||
* \ingroup propale
|
||||
* \file htdocs/comm/propal/list.php
|
||||
* \ingroup propal
|
||||
* \brief Page of commercial proposals card and list
|
||||
*/
|
||||
|
||||
@ -182,11 +182,7 @@ if ($search_montant_ht)
|
||||
$sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'";
|
||||
}
|
||||
if ($sall) {
|
||||
/*$scrit = explode(' ', $sall);
|
||||
foreach ($scrit as $crit) {
|
||||
$sql.= " AND (s.nom LIKE '%".$db->escape($crit)."%' OR p.note LIKE '%".$db->escape($crit)."%' OR pd.description LIKE '%".$db->escape($crit)."%')";
|
||||
}*/
|
||||
$sql .= natural_search(array('s.nom', 'p.note_private', 'pd.description'), $sall);
|
||||
$sql .= natural_search(array('s.nom', 'p.note_private', 'p.note_public', 'pd.description'), $sall);
|
||||
}
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($viewstatut <> '')
|
||||
@ -426,14 +422,14 @@ if ($result)
|
||||
{
|
||||
if($num<$limit){
|
||||
$var=!$var;
|
||||
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total HT").'</td>';
|
||||
print '<tr class="liste_total"><td align="left">'.$langs->trans("TotalHT").'</td>';
|
||||
print '<td colspan="6" align="right"">'.price($total).'<td colspan="3"</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total HT for this page").'</td>';
|
||||
print '<tr class="liste_total"><td align="left">'.$langs->trans("TotalHTforthispage").'</td>';
|
||||
print '<td colspan="6" align="right"">'.price($total).'<td colspan="3"</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/note.php
|
||||
* \ingroup propale
|
||||
* \ingroup propal
|
||||
* \brief Fiche d'information sur une proposition commerciale
|
||||
*/
|
||||
|
||||
|
||||
@ -267,14 +267,14 @@ foreach ($data as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||
|
||||
@ -14,7 +14,12 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
|
||||
* \ingroup propal
|
||||
* \brief Template to show objects linked to proposals
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ else dol_print_error($db);
|
||||
// Load sale and categ filters
|
||||
$search_sale = GETPOST('search_sale');
|
||||
$search_categ = GETPOST('search_categ');
|
||||
// If the user must only see his prospect, force searching by him
|
||||
// If the internal user must only see his prospect, force searching by him
|
||||
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
|
||||
|
||||
// List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
|
||||
@ -180,18 +180,17 @@ $form=new Form($db);
|
||||
$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status, s.code_client, s.client,";
|
||||
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
|
||||
$sql.= " d.nom as departement";
|
||||
// Updated by Matelli
|
||||
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||
if ($search_sale || !$user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
|
||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
$sql.= " WHERE s.fk_stcomm = st.id";
|
||||
$sql.= " AND s.client IN (2, 3)";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = " .$user->societe_id;
|
||||
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND s.rowid = " .$socid;
|
||||
if (isset($stcomm) && $stcomm != '') $sql.= " AND s.fk_stcomm=".$stcomm;
|
||||
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
@ -224,7 +223,6 @@ if ($socname) {
|
||||
$sortfield = "s.nom";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -232,9 +230,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
dol_syslog('comm/prospect/list.php sql='.$sql,LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -655,7 +655,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null");
|
||||
$sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:'NULL');
|
||||
$sql.= ", ".($this->remise_absolue>0?$this->remise_absolue:'NULL');
|
||||
$sql.= ", '".$this->remise_percent."'";
|
||||
$sql.= ", ".($this->remise_percent>0?$this->remise_percent:0);
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
@ -2457,7 +2457,7 @@ class Commande extends CommonOrder
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$comref = dol_sanitizeFileName($this->ref);
|
||||
if ($conf->commande->dir_output)
|
||||
if ($conf->commande->dir_output && !empty($this->ref))
|
||||
{
|
||||
$dir = $conf->commande->dir_output . "/" . $comref ;
|
||||
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";
|
||||
@ -3085,6 +3085,7 @@ class OrderLine extends CommonOrderLine
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->product_type = $objp->product_type;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_localtax1 = $objp->total_localtax1;
|
||||
|
||||
@ -325,7 +325,8 @@ if ($resql)
|
||||
print '</td>';
|
||||
|
||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||
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))
|
||||
print img_picto($langs->trans("Late"),"warning");
|
||||
if(!empty($objp->note_private))
|
||||
{
|
||||
print ' <span class="note">';
|
||||
|
||||
@ -288,7 +288,7 @@ foreach ($data as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right">0</td>';
|
||||
@ -297,7 +297,7 @@ foreach ($data as $val)
|
||||
}
|
||||
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||
|
||||
@ -131,7 +131,7 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -171,38 +171,71 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
$img=picto_from_langcode($account->country_code);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($account->getCountryCode(),0,$db);
|
||||
print getCountry($account->getCountryCode(), 0, $db);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ibankey="IBANNumber";
|
||||
@ -310,38 +343,77 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
|
||||
if ($account->type == 0 || $account->type == 1)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
$img=picto_from_langcode($account->country_code);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($account->getCountryCode(), 0, $db);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// If bank account
|
||||
print '<tr><td valign="top">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// BBAN
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ibankey="IBANNumber";
|
||||
@ -361,10 +433,6 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
print getCountry($account->getCountryCode());
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$account->proprio.'">';
|
||||
print '</td></tr>';
|
||||
@ -376,11 +444,15 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
|
||||
}
|
||||
|
||||
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Save").'" type="submit" class="button">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div align="center">';
|
||||
print '<input value="'.$langs->trans("Save").'" type="submit" class="button">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -234,7 +234,6 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
|
||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print "<br>";
|
||||
|
||||
|
||||
/*
|
||||
@ -242,7 +241,7 @@ print "<br>";
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">'."\n";
|
||||
if ($user->rights->banque->configurer)
|
||||
if ($user->rights->banque->configurer)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>';
|
||||
}
|
||||
|
||||
@ -903,7 +903,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$numlines=count($lines);
|
||||
for ($i=0; $i<$numlines; $i++)
|
||||
{
|
||||
$totalamount += $lines[$i]->subprice;
|
||||
$totalamount += $lines[$i]->total_ht;
|
||||
}
|
||||
|
||||
if ($totalamount!=0)
|
||||
@ -1422,7 +1422,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save'))
|
||||
elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel'))
|
||||
{
|
||||
if (! $object->fetch($id) > 0) dol_print_error($db);
|
||||
$object->fetch_thirdparty();
|
||||
@ -1479,7 +1479,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sav
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):'');
|
||||
|
||||
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if (($object->type == 0 || $object->type == 1) && $price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||
{
|
||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
|
||||
$error++;
|
||||
@ -3873,7 +3874,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$modelmail='facture_relance';
|
||||
$action='relance';
|
||||
}
|
||||
else $action='send';
|
||||
else $action='send';
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@ -1323,7 +1323,7 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if ($conf->facture->dir_output)
|
||||
if ($conf->facture->dir_output && !empty($this->ref))
|
||||
{
|
||||
$dir = $conf->facture->dir_output . "/" . $ref;
|
||||
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
|
||||
@ -2908,19 +2908,21 @@ class Facture extends CommonInvoice
|
||||
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
|
||||
$sql .= ' VALUES ('.$this->id;
|
||||
$sql .= ",'".price2num($resteapayer)."'";
|
||||
$sql .= ",'".$this->db->idate($now)."',";
|
||||
$sql .= ",'".$this->db->idate($now)."'";
|
||||
$sql .= ",".$user->id;
|
||||
$sql .= ",'".$bac->code_banque."'";
|
||||
$sql .= ",'".$bac->code_guichet."'";
|
||||
$sql .= ",'".$bac->number."'";
|
||||
$sql .= ",'".$bac->cle_rib."')";
|
||||
if ( $this->db->query($sql))
|
||||
|
||||
dol_syslog(get_class($this)."::demande_prelevement sql=".$sql);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this).'::demandeprelevement Erreur');
|
||||
return -1;
|
||||
}
|
||||
@ -3394,7 +3396,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,';
|
||||
$sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,';
|
||||
$sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,';
|
||||
$sql.= ' fd.info_bits, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,';
|
||||
$sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,';
|
||||
$sql.= ' fd.fk_code_ventilation,';
|
||||
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd';
|
||||
@ -3423,6 +3425,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
$this->info_bits = $objp->info_bits;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_localtax1 = $objp->total_localtax1;
|
||||
|
||||
@ -49,7 +49,7 @@ $result = restrictedArea($user,'facture',$id,'');
|
||||
* Action
|
||||
*/
|
||||
|
||||
if ($action == "builddoc" && $user->rights->facture->lire)
|
||||
if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search'))
|
||||
{
|
||||
if (is_array($_POST['toGenerate']))
|
||||
{
|
||||
@ -149,14 +149,14 @@ if ($action == 'remove_file')
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
$title=$langs->trans("BillsCustomersUnpaid");
|
||||
if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
|
||||
|
||||
llxHeader('',$title);
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@ -170,12 +170,6 @@ $(document).ready(function() {
|
||||
</script>
|
||||
<?php
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Mode Liste *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$search_ref = GETPOST("search_ref");
|
||||
@ -222,10 +216,10 @@ if (GETPOST('filtre'))
|
||||
$sql .= " AND " . $filt[0] . " = " . $filt[1];
|
||||
}
|
||||
}
|
||||
if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$search_ref."%'";
|
||||
if ($search_societe) $sql .= " AND s.nom LIKE '%".$search_societe."%'";
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$search_montant_ht."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'";
|
||||
if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$db->escape($search_ref)."%'";
|
||||
if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'";
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.rowid, f.fk_statut, f.type ";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
@ -271,10 +265,13 @@ if ($resql)
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<form id="form_generate_pdf" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if ($late) print '<input type="hidden" name="late" value="'.dol_escape_htmltag($late).'">';
|
||||
|
||||
$i = 0;
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
|
||||
@ -289,17 +286,16 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<tr class="liste_titre">';
|
||||
// Ref
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="10" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
@ -309,7 +305,6 @@ if ($resql)
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
@ -321,9 +316,6 @@ if ($resql)
|
||||
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
print '<form id="form_generate_pdf" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
@ -426,17 +418,13 @@ if ($resql)
|
||||
* Show list of available documents
|
||||
*/
|
||||
$filedir=$diroutputpdf;
|
||||
if ($search_ref) print '<input type="hidden" name="search_ref" value="'.$search_ref.'">';
|
||||
if ($search_societe) print '<input type="hidden" name="search_societe" value="'.$search_societe.'">';
|
||||
if ($search_montant_ht) print '<input type="hidden" name="search_montant_ht" value="'.$search_montant_ht.'">';
|
||||
if ($search_montant_ttc) print '<input type="hidden" name="search_montant_ttc" value="'.$search_montant_ttc.'">';
|
||||
if ($late) print '<input type="hidden" name="late" value="'.$late.'">';
|
||||
$genallowed=$user->rights->facture->lire;
|
||||
$delallowed=$user->rights->facture->lire;
|
||||
|
||||
print '<br>';
|
||||
print '<input type="hidden" name="option" value="'.$option.'">';
|
||||
$formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,0,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge"));
|
||||
// We disable multilang because we concat already existing pdf.
|
||||
$formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,1,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge"));
|
||||
print '</form>';
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
@ -211,7 +211,6 @@ if ($object->id > 0)
|
||||
}
|
||||
print ')';
|
||||
}
|
||||
// FIXME $facidnext not defined
|
||||
/*
|
||||
if ($facidnext > 0)
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 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
|
||||
@ -266,14 +267,14 @@ foreach ($data as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -62,30 +62,6 @@ if ($user->societe_id > 0)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add_bookmark')
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socid." AND fk_user=".$user->id;
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate($now).",".$user->id.");";
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'del_bookmark' && ! empty($bid))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$db->escape($bid);
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -216,7 +192,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
|
||||
$i = 0;
|
||||
$tot_ttc = 0;
|
||||
while ($i < $num && $i < 20)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr '.$bc[$var].'><td class="nowrap">';
|
||||
@ -285,7 +261,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
|
||||
$i = 0;
|
||||
$tot_ttc = 0;
|
||||
while ($i < $num && $i < 20)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr '.$bc[$var].'><td class="nowrap">';
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 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
|
||||
@ -29,6 +30,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load('bills');
|
||||
@ -173,19 +175,9 @@ if ($result <= 0)
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$h=0;
|
||||
$head = payment_prepare_head($object);
|
||||
|
||||
$head[$h][0] = $_SERVER['PHP_SELF'].'?id='.$id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$h++;
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
|
||||
dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 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
|
||||
@ -25,6 +26,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
@ -40,20 +42,9 @@ $paiement = new Paiement($db);
|
||||
$paiement->fetch($_GET["id"], $user);
|
||||
$paiement->info($_GET["id"]);
|
||||
|
||||
$head = payment_prepare_head($paiement);
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$_GET["id"];
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$_GET["id"];
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
|
||||
dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
@ -795,7 +795,6 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
||||
$soc = new Societe($this->db);
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
|
||||
// Check RIB
|
||||
$i = 0;
|
||||
@ -810,6 +809,7 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
if ($soc->fetch($fact->socid) >= 0)
|
||||
{
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
$bac->fetch(0,$soc->id);
|
||||
if ($bac->verif() >= 1)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -31,7 +31,7 @@ $langs->load("compta");
|
||||
$langs->load("banks");
|
||||
$langs->load("bills");
|
||||
|
||||
$id=GETPOST("id");
|
||||
$id=GETPOST("id",'int');
|
||||
$action=GETPOST('action');
|
||||
|
||||
// Security check
|
||||
@ -87,7 +87,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$result=$tva->fetch($_GET['id']);
|
||||
$result=$tva->fetch($id);
|
||||
|
||||
if ($tva->rappro == 0)
|
||||
{
|
||||
@ -100,10 +100,10 @@ if ($action == 'delete')
|
||||
{
|
||||
$accountline=new AccountLine($db);
|
||||
$result=$accountline->fetch($tva->fk_bank);
|
||||
$result=$accountline->delete($user);
|
||||
if ($result > 0) $result=$accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
if ($result >= 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/tva/reglement.php');
|
||||
@ -289,4 +289,4 @@ if ($id)
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user