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

This commit is contained in:
Laurent Destailleur 2013-04-30 22:39:17 +02:00
commit 786bf9d035
385 changed files with 4729 additions and 3350 deletions

View File

@ -4,6 +4,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.4 compared to 3.3.2 ***** ***** ChangeLog for 3.4 compared to 3.3.2 *****
For users: For users:
- New: Can use ODS templates as document templates.
- New: Add link to autofill/reset with quantity to ship when creating a - New: Add link to autofill/reset with quantity to ship when creating a
delivery receipt. delivery receipt.
- New: Event into calendar use different colors for different users. - New: Event into calendar use different colors for different users.
@ -11,46 +12,48 @@ For users:
- New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Add a tab "consumption" on thirdparties to list products bought/sells.
- New: Some performance enhancements. - New: Some performance enhancements.
- New: Can attach files onto trip and expenses modules. - New: Can attach files onto trip and expenses modules.
- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR. - New: Add hidden option MAIN_PDF_TITLE_BACKGROUND_COLOR.
- New: Merge tab customer and prospect. - New: Merge tab customer and prospect.
- New: Add ES formated address country rule. - New: Add ES formated address country rule.
- New: Can define a hierarchical responsible on user. - New: Can define a hierarchical responsible on user and add a tree view to
- New: Add a hierarchical view for users. see hierarchy of users.
- New: Can expand/collapse menus, categories and users list. - New: Can expand/collapse menus, categories and users list.
- New: extra parameters are supported into ODT templates. - New: extra parameters are supported into ODT/ODS templates.
- New: total per vat rate are available as tags for ODT templates. - New: total per vat rate are available as tags for ODT/ODS templates.
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices).
- New: Some part of interface use more CSS3 (ie: agenda) - New: Some part of interface use more CSS3 (ie: agenda)
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice. - New: [ task #707 ] Create option "ProfIdx is mandatory to validate a invoice".
- New: Can define if we want to use VAT or not for subscriptions (foundation module). - New: Can define if we want to use VAT or not for subscriptions (foundation module).
- New: Can define a default choice for choice "More action when recording - New: Can define a default choice for "More action when recording a
a subscription" (foundation module). subscription" (foundation module).
- New: Add link to check professional id for india. - New: Add link to check professional id for India.
- New: [ task #731 ] Uniformize ref generation - New: [ task #731 ] Uniformize ref generation
- New: [ task #748 ] Add a link "Dolibarr" into left menu - New: [ task #748 ] Add a link "Dolibarr" into left menu
- New: Script email_unpaid_invoices_to_representative accepts now a parameter test - New: Script email_unpaid_invoices_to_representative accepts now a parameter "test"
and a delay. and a "late delay".
- New: Can define a different clicktodial setup per user. - New: Can define different clicktodial setups for each user.
- New: Add option INVOICE_CAN_NEVER_BE_REMOVED. - New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED.
- New: Enhance agenda module to reach RFC2445 (add busy information). - New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add
"busy" information).
- New: Add module Opensurvey. - New: Add module Opensurvey.
- New: Default aprrover for holidays i sby default hierchical parent. - New: Default approver for holidays is set by default to hierchical parent.
- First change to prepare feature "click to print" (IPP) for PDF. - First change to prepare feature "click to print" (IPP) for PDF.
- New: [ task #350 ] Merge tab customer and prospect - New: [ task #350 ] Merge tab customer and prospect.
- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid) - New: [ task #710 ] Add substitution into mailing send (and HTML is now valid).
- New: [ task #711 ] Add combobox for contact as done for product/thirdparty - New: [ task #711 ] Add combobox for contact, as done for product/thirdparty.
- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECIEPT - New: [ task #714 ] In Emailing module admin autogenerate security key of READRECEIPT.
- New: [ task #743 ] GED : Add aministration option to disabled autotree to display - New: [ task #743 ] GED : Add aministration option to disable autotree display.
- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address - New: [ task #767 ] Customer Address fallback when a contact doesn't have an address.
- New: [ task #768 ] WYSIWYG for all mail - New: [ task #768 ] WYSIWYG for all mails.
- New: [ task #773 ] Add Project document in GED(ECM) modules - New: [ task #773 ] Add Project document in GED(ECM) modules.
- New: [ task #783 ] Add checkbox and radio into extrafield feature - New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox,
- New: [ task #798 ] Add range limit date on product/services as it is done on order and invoice prices, radio).
- New: [ task #814 ] Add extrafield feature into Project/project tasks module - New: [ task #798 ] Add range limit date on product/services as it is done on order
- New: [ task #770 ] Add ODT document generation for Projects module and invoice.
- New: [ task #741 ] Add intervention box - New: [ task #814 ] Add extrafield feature for projects ands tasks.
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated - New: [ task #770 ] Add ODT document generation for Projects module.
- New: [ task #823 ] Shipping_validate email notification - New: [ task #741 ] Add intervention box.
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated.
- New: [ task #823 ] Shipping_validate email notification.
For translators: For translators:
- Update language files. - Update language files.
@ -60,8 +63,8 @@ For developers:
- An external module can force its theme. - An external module can force its theme.
- Add function dol_set_focus('#xxx'). - Add function dol_set_focus('#xxx').
- A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file. - A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file.
- Removed not used libraries. - Removed some not used libraries.
- More web services. - More web services.
- Renamed some database fields, code variables and parameters from french to english. - Renamed some database fields, code variables and parameters from french to english.
- First change to manage margins on contracts. - First change to manage margins on contracts.
- Add hook getFormMail. - Add hook getFormMail.
@ -89,24 +92,25 @@ WARNING: If you used external modules, some of them may need to be upgraded due
***** ChangeLog for 3.3.2 compared to 3.3.1 ***** ***** ChangeLog for 3.3.2 compared to 3.3.1 *****
- Fix: Dutch (nl_NL) translation - Fix: Dutch (nl_NL) translation
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Generalize fix: file with a specific mask not found, again - Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
- Fix: Can't reset payment due date - Fix: Can't reset payment due date
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect - Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #789 ] VAT not being calculated in POS - Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list - Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: [ bug #810 ] Cannot update ODT template path - Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres) - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
- Fix: [ bug #855 ] Holiday approval email in French
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
***** ChangeLog for 3.3.1 compared to 3.3 ***** ***** ChangeLog for 3.3.1 compared to 3.3 *****

View File

@ -13,7 +13,7 @@ with format .DEB (for Debian, Ubuntu, ...).
# This is standard command to work on Debian packaging: # This is standard command to work on Debian packaging:
# #
# gpg --gen-key Generate a GPG key # gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg)
# #
# debconf-updatepo To run into po dir to regenate templates.pot # debconf-updatepo To run into po dir to regenate templates.pot
# podebconf-report-po --from email@email.com To send email to ask translations # podebconf-report-po --from email@email.com To send email to ask translations
@ -43,10 +43,11 @@ To submit a package to Debian:
See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents. See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents.
- Wait until you received bug number. - Wait until you received bug number.
For first ITP submission of Dolibarr, bug id was 634783. For first ITP submission of Dolibarr, bug id was 634783.
- Check bug is into database by searching with id on http://www.debian.org/Bugs/ - Check bug is into database by searching with id on
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634783
- Add a line for upstream into file changelog with bug number - Add a line for upstream into file changelog with bug number
- Call for a mentor on ML debian-mentors to upload packages - Call for a mentor on ML debian-mentors to upload packages

View File

@ -4,6 +4,6 @@ dolibarr (3.4.0+nmu1) unstable; urgency=low
* New upstream release. * New upstream release.
closes: bug#634783 closes: bug#634783
-- Dolibarr team <contact@dolibarr.org> Sat, 2 Mar 2013 12:00:00 +0100 -- Dolibarr team <contact@dolibarr.org> Mon, 22 Apr 2013 12:00:00 +0100
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz

View File

@ -14,8 +14,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 1.0\n" "Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n"
"POT-Creation-Date: 2011-08-01 18:17+0200\n" "POT-Creation-Date: 2013-04-23 12:16+0200\n"
"PO-Revision-Date: 2011-07-29 22:45+0100\n" "PO-Revision-Date: 2011-07-29 22:45+0100\n"
"Last-Translator: Laurent Destailleur <eldy@users.sourceforge.net>\n" "Last-Translator: Laurent Destailleur <eldy@users.sourceforge.net>\n"
"Language-Team: Laurent Destailleur <eldy@users.sourceforge.net>\n" "Language-Team: Laurent Destailleur <eldy@users.sourceforge.net>\n"
@ -27,13 +27,13 @@ msgstr ""
#. Type: multiselect #. Type: multiselect
#. Description #. Description
#: ../templates:1001 #: ../dolibarr.templates:1001
msgid "Web server to reconfigure automatically:" msgid "Web server to reconfigure automatically:"
msgstr "Seveur web à reconfigurer automatiquement:" msgstr "Seveur web à reconfigurer automatiquement:"
#. Type: multiselect #. Type: multiselect
#. Description #. Description
#: ../templates:1001 #: ../dolibarr.templates:1001
msgid "" msgid ""
"Please choose the web server that should be automatically configured to run " "Please choose the web server that should be automatically configured to run "
"dolibarr." "dolibarr."
@ -44,14 +44,14 @@ msgstr ""
# #
#. Type: boolean #. Type: boolean
#. Description #. Description
#: ../templates:2001 #: ../dolibarr.templates:2001
msgid "Delete database and uploaded files ?" msgid "Delete database and uploaded files ?"
msgstr "Effacer la base de donnée et les fichiers uploadés ?" msgstr "Effacer la base de donnée et les fichiers uploadés ?"
# #
#. Type: boolean #. Type: boolean
#. Description #. Description
#: ../templates:2001 #: ../dolibarr.templates:2001
msgid "" msgid ""
"Answer if you want to removed the Dolibarr MySQL database and all other " "Answer if you want to removed the Dolibarr MySQL database and all other "
"datas (datas related to this question are the Dolibarr DBMS account, all " "datas (datas related to this question are the Dolibarr DBMS account, all "

15
build/debian/po/templates.pot Executable file → Normal file
View File

@ -3,11 +3,12 @@
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: dolibarr\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n"
"POT-Creation-Date: 2011-08-01 18:17+0200\n" "POT-Creation-Date: 2013-04-23 12:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,13 +19,13 @@ msgstr ""
#. Type: multiselect #. Type: multiselect
#. Description #. Description
#: ../templates:1001 #: ../dolibarr.templates:1001
msgid "Web server to reconfigure automatically:" msgid "Web server to reconfigure automatically:"
msgstr "" msgstr ""
#. Type: multiselect #. Type: multiselect
#. Description #. Description
#: ../templates:1001 #: ../dolibarr.templates:1001
msgid "" msgid ""
"Please choose the web server that should be automatically configured to run " "Please choose the web server that should be automatically configured to run "
"dolibarr." "dolibarr."
@ -32,13 +33,13 @@ msgstr ""
#. Type: boolean #. Type: boolean
#. Description #. Description
#: ../templates:2001 #: ../dolibarr.templates:2001
msgid "Delete database and uploaded files ?" msgid "Delete database and uploaded files ?"
msgstr "" msgstr ""
#. Type: boolean #. Type: boolean
#. Description #. Description
#: ../templates:2001 #: ../dolibarr.templates:2001
msgid "" msgid ""
"Answer if you want to removed the Dolibarr MySQL database and all other " "Answer if you want to removed the Dolibarr MySQL database and all other "
"datas (datas related to this question are the Dolibarr DBMS account, all " "datas (datas related to this question are the Dolibarr DBMS account, all "

View File

@ -111,6 +111,9 @@ clean:
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
rm -fr htdocs/includes/tcpdf/fonts/utils rm -fr htdocs/includes/tcpdf/fonts/utils
# clean from files to avoid warning of missing dependencies
rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py
# Licence files are included into copyright file. # Licence files are included into copyright file.
rm -fr htdocs/includes/phpexcel/license.txt rm -fr htdocs/includes/phpexcel/license.txt
rm -f htdocs/includes/tcpdf/LICENSE.TXT rm -f htdocs/includes/tcpdf/LICENSE.TXT
@ -118,4 +121,4 @@ clean:
dh $@ dh $@
binary-arch: binary-arch:

View File

@ -28,6 +28,8 @@ a package onto LaunchPad
- Edit file ~/.bashrc to add - Edit file ~/.bashrc to add
DEBFULLNAME="<Your name>" DEBFULLNAME="<Your name>"
DEBEMAIL="<Your email address>" DEBEMAIL="<Your email address>"
- Create a Bazaar directory
mkdir bzr
If you want to build/test package locally: If you want to build/test package locally:
- Create a file ~/.pbuilderrc with content - Create a file ~/.pbuilderrc with content
@ -36,29 +38,42 @@ If you want to build/test package locally:
sudo pbuilder create [--distribution sid|squeeze] sudo pbuilder create [--distribution sid|squeeze]
# Push/declare sources to Launchpad # Push/declare Dolibarr sources to Launchpad
#---------------------------------- #----------------------------------
- From Launchpad project (https://launchpad.net/dolibarr), register a series:
- Create a series (https://launchpad.net/dolibarr/) Call it 'trunk' or 'beta' or 'stable'
Call it 'dev', 'stable' or 'beta' Use branch (dev):
For dev: Configure Series branch - Link to series ~eldy/dolibarr/develop
For stable: Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz ~eldy/dolibarr/beta
For beta: Add file with *: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_3.2.*.tar.gz ~eldy/dolibarr/stable
mkdir bzr or
Use URL pattern (beta or stable):
For stable: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
For beta: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
- For Dev, you can also add link serie to GIT HEAD.
- For beta and stable, you can init from command line
cd bzr/dolibarr-[beta|stable]
bzr init bzr init
bzr add bzr add
bzr commit -m "Init" bzr commit -m "Init"
bzr push lp:~yourlogin/dolibarr/[beta|stable]
List of series created: - List of series are visible here: https://launchpad.net/dolibarr/+series
https://launchpad.net/dolibarr/trunk
https://launchpad.net/dolibarr/beta
https://launchpad.net/dolibarr/stable
# Init repository of sources into launchpad (when repository for sources does not exist) # To update Dolibarr into launchpad (when repository for sources already exists)
#---------------------------------- #----------------------------------
cd bzr
bzr branch lp:~yourlogin/dolibarr/[dev|beta|stable]
cd dolibarr-[dev|beta|stable]
bzr status
-- Update files here --
bzr commit -m "Description of change"
bzr push
- Create debian directory and upload it onto bzr branch ~yourlogin/+junk/debian-[dev|stable] # Init debian dir repository into launchpad (when repository for sources does not exist)
mkdir bzr #----------------------------------
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
cd bzr cd bzr
mkdir debian mkdir debian
cd debian cd debian
@ -67,27 +82,28 @@ https://launchpad.net/dolibarr/stable
bzr add bzr add
bzr commit -m "Init control files" bzr commit -m "Init control files"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name) bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name)
or download it from launchpad bazaar: - or download it from launchpad bazaar:
cd bzr cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
For sources, same with
bzr push lp:~yourlogin/dolibarr/[dev|beta|stable]
- To update this debian directory, edit files into the bzr dir and run # Get debian dir repository from launchpad (when repository for sources already exists)
bzr status
bzr commit -m "Description of change"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable]
# Get repository of sources from launchpad (when repository for sources already exists)
#---------------------------------- #----------------------------------
cd bzr cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|stable] bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
# To update debian dir into launchpad (when repository for sources already exists)
#----------------------------------
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
cd debian-[dev|beta|stable]
bzr status
-- Update files here --
bzr commit -m "Description of change"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable]
# Define a recipe into launchpad (a rule to build packages into a PPA) # Define a recipe into launchpad (a rule to build packages into a PPA)
#---------------------------------- #----------------------------------
- Create a file dolibarr.recipe with content - Create a file dolibarr.recipe with content
cd bzr cd bzr
vi dolibarr.recipe vi dolibarr.recipe
@ -119,11 +135,11 @@ https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
# To get/download package from PPA: # To get/download package from PPA:
#---------------------------------- #----------------------------------
Add signing key of the Launchpad repository: - Add signing key of the Launchpad repository:
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD > gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
> sudo apt-key add ~/.gnupg/pubring.gpg > sudo apt-key add ~/.gnupg/pubring.gpg
Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list - Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list
For the development snapshot version: For the development snapshot version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
@ -134,12 +150,10 @@ For the stable version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
Update your package cache: - Update your package cache:
> apt-get update > apt-get update
Install Dolibarr: - Install Dolibarr:
> apt-get install dolibarr > apt-get install dolibarr

View File

@ -658,6 +658,8 @@ if ($nboftargetok) {
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
$ret=`$cmd`; $ret=`$cmd`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
$ret=`$cmd`;
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";

View File

@ -32,7 +32,7 @@ This files describe steps made by Dolibarr packaging team to make a
complete release of Dolibarr, step by step. complete release of Dolibarr, step by step.
- Check all files are commited. - Check all files are commited.
- Update version/info in /ChangeLog and /filefunc.inc.php - Update version/info in ChangeLog
- Update version number with x.x.x in htdocs/filefunc.inc.php - Update version number with x.x.x in htdocs/filefunc.inc.php
- Update version number with x.x.x in build/makepack-dolibarr.pl - Update version number with x.x.x in build/makepack-dolibarr.pl
- Update version number with x.x.x in build/debian/changelog - Update version number with x.x.x in build/debian/changelog

View File

@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions() # script_dolibarr_versions()
sub script_dolibarr_versions sub script_dolibarr_versions
{ {
return ( "3.4.0", "3.3.0", "3.2.1", "3.1.1" ); return ( "3.4.0", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
} }
sub script_dolibarr_category sub script_dolibarr_category

View File

@ -26,8 +26,9 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...).
# restorecon -R -v /file Restore values into files (cancel chcon, validate semanage) # restorecon -R -v /file Restore values into files (cancel chcon, validate semanage)
# #
# On OpenSuse # On OpenSuse
# yast --install dolibarr-...rpm To install package and dependencies # zypper install dolibarr-...rpm To install package and dependencies
# yast --remove dolibarr To remove package # zypper remove dolibarr To remove package
# zypper search xxx To search a package
# #
# On Mageia (after su - root) # On Mageia (after su - root)
# urpmi dolibarr-...rpm To install package and dependencies # urpmi dolibarr-...rpm To install package and dependencies

View File

@ -165,7 +165,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/comm
%_datadir/dolibarr/htdocs/commande %_datadir/dolibarr/htdocs/commande
%_datadir/dolibarr/htdocs/commissions
%_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/compta
%_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/conf
%_datadir/dolibarr/htdocs/contact %_datadir/dolibarr/htdocs/contact
@ -187,8 +186,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal %_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public %_datadir/dolibarr/htdocs/public

View File

@ -241,7 +241,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/comm
%_datadir/dolibarr/htdocs/commande %_datadir/dolibarr/htdocs/commande
%_datadir/dolibarr/htdocs/commissions
%_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/compta
%_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/conf
%_datadir/dolibarr/htdocs/contact %_datadir/dolibarr/htdocs/contact
@ -263,8 +262,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal %_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public %_datadir/dolibarr/htdocs/public

View File

@ -162,7 +162,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/comm
%_datadir/dolibarr/htdocs/commande %_datadir/dolibarr/htdocs/commande
%_datadir/dolibarr/htdocs/commissions
%_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/compta
%_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/conf
%_datadir/dolibarr/htdocs/contact %_datadir/dolibarr/htdocs/contact
@ -184,8 +183,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal %_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public %_datadir/dolibarr/htdocs/public

View File

@ -173,7 +173,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/comm
%_datadir/dolibarr/htdocs/commande %_datadir/dolibarr/htdocs/commande
%_datadir/dolibarr/htdocs/commissions
%_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/compta
%_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/conf
%_datadir/dolibarr/htdocs/contact %_datadir/dolibarr/htdocs/contact
@ -195,8 +194,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal %_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public %_datadir/dolibarr/htdocs/public

View File

@ -18,4 +18,6 @@ $force_install_dolibarrlogin='admin';
$force_install_nophpinfo='1'; $force_install_nophpinfo='1';
$force_install_lockinstall='444'; $force_install_lockinstall='444';
// Value to overwrite path to use shared libraries/fonts instead of embedded one
// We don't force any external lib with generic package
?> ?>

View File

@ -19,10 +19,10 @@ $force_install_nophpinfo='1';
$force_install_lockinstall='444'; $force_install_lockinstall='444';
// Value to overwrite path to use shared libraries/fonts instead of embedded one // Value to overwrite path to use shared libraries/fonts instead of embedded one
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
//$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_GEOIP_PATH='';
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
$force_dolibarr_lib_PHPEXCEL_PATH=''; $force_dolibarr_lib_PHPEXCEL_PATH='';
$force_dolibarr_lib_TCPDF_PATH=''; $force_dolibarr_lib_TCPDF_PATH='';

View File

@ -133,7 +133,7 @@ class modMyModule extends DolibarrModules
$this->tabs = array(); $this->tabs = array();
// Dictionnaries // Dictionnaries
if (! isset($conf->mymodule->enabled)) if (! isset($conf->mymodule->enabled))
{ {
$conf->mymodule=new stdClass(); $conf->mymodule=new stdClass();
$conf->mymodule->enabled=0; $conf->mymodule->enabled=0;
@ -158,14 +158,8 @@ class modMyModule extends DolibarrModules
// Boxes // Boxes
// Add here list of php file(s) stored in core/boxes that contains class to show a box. // Add here list of php file(s) stored in core/boxes that contains class to show a box.
$this->boxes = array(); // List of boxes $this->boxes = array(); // List of boxes
$r=0;
// Example: // Example:
/* //$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>'')););
$this->boxes[$r][1] = "myboxa.php";
$r++;
$this->boxes[$r][1] = "myboxb.php";
$r++;
*/
// Permissions // Permissions
$this->rights = array(); // Permission array used by this module $this->rights = array(); // Permission array used by this module

View File

@ -33,14 +33,14 @@
<!-- Login --> <!-- Login -->
<tr> <tr>
<td valign="bottom"> &nbsp; <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r &nbsp; </td> <td valign="bottom"> &nbsp; <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r &nbsp; </td>
<td valign="bottom" nowrap="nowrap"> <td valign="bottom" class="nowrap">
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="" tabindex="1" /> <input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="" tabindex="1" />
</td> </td>
</tr> </tr>
<!-- Password --> <!-- Password -->
<tr><td valign="top" nowrap="nowrap"> &nbsp; <strong><label for="password">Mot de passe</label></strong> &nbsp; </td> <tr><td valign="top" class="nowrap"> &nbsp; <strong><label for="password">Mot de passe</label></strong> &nbsp; </td>
<td valign="top" nowrap="nowrap"> <td valign="top" class="nowrap">
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" /> <input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
</td></tr> </td></tr>

View File

@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='member'; $elementtype='adherent'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='adherent_type'; $elementtype='adherent_type'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -479,8 +479,6 @@ if ($rowid)
{ {
$res=$object->fetch($rowid); $res=$object->fetch($rowid);
if ($res < 0) { dol_print_error($db,$object->error); exit; } if ($res < 0) { dol_print_error($db,$object->error); exit; }
//$res=$object->fetch_optionals($object->id,$extralabels);
//if ($res < 0) { dol_print_error($db); exit; }
$adht->fetch($object->typeid); $adht->fetch($object->typeid);

View File

@ -1095,6 +1095,15 @@ class Adherent extends CommonObject
$this->user_id = $obj->user_id; $this->user_id = $obj->user_id;
$this->user_login = $obj->user_login; $this->user_login = $obj->user_login;
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (count($extralabels)>0) {
$this->fetch_optionals($this->id,$extralabels);
}
// Load other properties // Load other properties
$result=$this->fetch_subscriptions(); $result=$this->fetch_subscriptions();
@ -1619,11 +1628,11 @@ class Adherent extends CommonObject
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1) if ($statut >= 1)
{ {
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActive").' </span>'.img_picto($langs->trans('MemberStatusActive'),'statut1');
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLate").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaid").' </span>'.img_picto($langs->trans('MemberStatusPaid'),'statut4');
} }
if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
} }
} }

View File

@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class AdherentType extends CommonObject class AdherentType extends CommonObject
{ {
public $table_element = 'adherent_type'; public $table_element = 'adherent_type';
public $element = 'adherent_type';
var $id; var $id;
var $libelle; var $libelle;

View File

@ -65,7 +65,7 @@ $object = new Adherent($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('member'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr) // Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($rowid); $object->getCanvas($rowid);
@ -1403,7 +1403,7 @@ else
print '</td></tr>'; print '</td></tr>';
// Zip / Town // Zip / Town
print '<tr><td nowrap="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td></tr>'; print '<tr><td class="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td></tr>';
// Country // Country
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'; print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">';

View File

@ -304,7 +304,7 @@ if ($resql)
// Type // Type
$membertypestatic->id=$objp->type_id; $membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type; $membertypestatic->libelle=$objp->type;
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print $membertypestatic->getNomUrl(1,32); print $membertypestatic->getNomUrl(1,32);
print '</td>'; print '</td>';
@ -315,21 +315,21 @@ if ($resql)
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n"; print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
// Statut // Statut
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>"; print "</td>";
// End of subscription date // End of subscription date
if ($datefin) if ($datefin)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print dol_print_date($datefin,'day'); print dol_print_date($datefin,'day');
if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate")); if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
print '</td>'; print '</td>';
} }
else else
{ {
print '<td align="left" nowrap="nowrap">'; print '<td align="left" class="nowrap">';
if ($objp->cotisation == 'yes') if ($objp->cotisation == 'yes')
{ {
print $langs->trans("SubscriptionNotReceived"); print $langs->trans("SubscriptionNotReceived");

View File

@ -540,7 +540,7 @@ if ($rowid > 0)
print "<td>".$objp->login."</td>\n"; print "<td>".$objp->login."</td>\n";
// Type // Type
/*print '<td nowrap="nowrap">'; /*print '<td class="nowrap">';
$membertypestatic->id=$objp->type_id; $membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type; $membertypestatic->libelle=$objp->type;
print $membertypestatic->getNomUrl(1,12); print $membertypestatic->getNomUrl(1,12);
@ -554,14 +554,14 @@ if ($rowid > 0)
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n"; print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
// Statut // Statut
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>"; print "</td>";
// Date fin cotisation // Date fin cotisation
if ($datefin) if ($datefin)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
if ($datefin < time() && $objp->statut > 0) if ($datefin < time() && $objp->statut > 0)
{ {
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
@ -574,7 +574,7 @@ if ($rowid > 0)
} }
else else
{ {
print '<td align="left" nowrap="nowrap">'; print '<td align="left" class="nowrap">';
if ($objp->cotisation == 'yes') if ($objp->cotisation == 'yes')
{ {
print $langs->trans("SubscriptionNotReceived"); print $langs->trans("SubscriptionNotReceived");

View File

@ -47,7 +47,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='actioncomm'; $elementtype='actioncomm'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -199,13 +199,13 @@ while ($i <= $MAXAGENDA)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
// Nb // Nb
print '<td width="180" nowrap="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>"; print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name // Name
print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>'; print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>';
// URL // URL
print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>'; print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>';
// Color (Possible colors are limited by Google) // Color (Possible colors are limited by Google)
print '<td nowrap="nowrap" align="right">'; print '<td class="nowrap" align="right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset');
print '</td>'; print '</td>';

View File

@ -165,7 +165,7 @@ while ($i < $nbofbank)
print '<td>'.$bankorder[$i][0]."</td><td>\n"; print '<td>'.$bankorder[$i][0]."</td><td>\n";
print $bankorder[$i][1]; print $bankorder[$i][1];
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmparray=explode(' ',$bankorder[$i][2]); $tmparray=explode(' ',$bankorder[$i][2]);
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)
{ {

View File

@ -36,9 +36,8 @@ $rowid = GETPOST('rowid','int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$errmesg=''; $errmesg='';
// Definition des positions possibles pour les boites // Define possible position of boxes
$pos_array = array(0); // Positions possibles pour une boite (0,1,2,...) $pos_name = getStaticMember('InfoBox','listOfPages');
$pos_name = array(0=>$langs->trans("Home")); // Nom des positions 0=Homepage, 1=...
$boxes = array(); $boxes = array();
@ -347,7 +346,9 @@ foreach($boxtoadd as $box)
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).'</td>'; print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
print '</td>';
print '<td>'; print '<td>';
if ($box->note == '(WarningUsingThisBoxSlowDown)') if ($box->note == '(WarningUsingThisBoxSlowDown)')
{ {
@ -360,7 +361,7 @@ foreach($boxtoadd as $box)
// Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position // Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position
print '<td>'; print '<td>';
print $form->selectarray("pos",$pos_name); print $form->selectarray("pos",$pos_name,0,0,0,0,'',1);
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="boxid" value="'.$box->box_id.'">'; print '<input type="hidden" name="boxid" value="'.$box->box_id.'">';
print ' <input type="submit" class="button" name="button" value="'.$langs->trans("Activate").'">'; print ' <input type="submit" class="button" name="button" value="'.$langs->trans("Activate").'">';
@ -406,7 +407,9 @@ foreach($boxactivated as $key => $box)
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n"; print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).'</td>'; print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
print '</td>';
print '<td>'; print '<td>';
if ($box->note == '(WarningUsingThisBoxSlowDown)') if ($box->note == '(WarningUsingThisBoxSlowDown)')
{ {
@ -415,7 +418,7 @@ foreach($boxactivated as $key => $box)
} }
else print ($box->note?$box->note:'&nbsp;'); else print ($box->note?$box->note:'&nbsp;');
print '</td>'; print '</td>';
print '<td align="center">' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . '</td>'; print '<td align="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>';
$hasnext=($key < (count($boxactivated)-1)); $hasnext=($key < (count($boxactivated)-1));
$hasprevious=($key != 0); $hasprevious=($key != 0);
print '<td align="center">'.($key+1).'</td>'; print '<td align="center">'.($key+1).'</td>';

View File

@ -234,7 +234,7 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td nowrap="nowrap">'.$langs->trans("Example").'</td>'; print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("Infos").'</td>'; print '<td align="center" width="16">'.$langs->trans("Infos").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering model // Show example of numbering model
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -146,7 +146,7 @@ if (is_resource($handle))
print '</td>'; print '</td>';
// Show example of numbering model // Show example of numbering model
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -456,11 +456,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=0; $ok=0;
$msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>'; $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>';
} }
if (!is_numeric($_POST['code'])) // FIXME regresion if code with not in numeric base
/*if (!is_numeric($_POST['code']))
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
} }*/
} }
if (isset($_POST["country"]) && $_POST["country"]=='0') { if (isset($_POST["country"]) && $_POST["country"]=='0') {
$ok=0; $ok=0;
@ -1110,7 +1111,7 @@ if ($id)
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
// Active // Active
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>'; if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else else
{ {

View File

@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
@ -361,7 +361,7 @@ print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'; print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
print '<td align="center" width="80" nowrap="nowrap">'.$langs->trans("Infos").'</td>'; print '<td align="center" width="80" class="nowrap">'.$langs->trans("Infos").'</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();

View File

@ -319,7 +319,7 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td nowrap="nowrap">'.$langs->trans("Example").'</td>'; print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("Infos").'</td>'; print '<td align="center" width="16">'.$langs->trans("Infos").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering model // Show example of numbering model
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -253,7 +253,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';

View File

@ -305,7 +305,7 @@ if ($action == 'create')
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>'; print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
//User //User
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('MenuForUsers').'</td>'; print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
print '<td><select class="flat" name="user">'; print '<td><select class="flat" name="user">';
print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>'; print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>';
print '<option value="0">'.$langs->trans('Internal').'</option>'; print '<option value="0">'.$langs->trans('Internal').'</option>';
@ -406,7 +406,7 @@ elseif ($action == 'edit')
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td><td>'.$handler.'</td><td>'.$langs->trans('DetailMenuHandler').'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td><td>'.$handler.'</td><td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
// User // User
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('MenuForUsers').'</td><td><select class="flat" name="user">'; print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td><td><select class="flat" name="user">';
print '<option value="2"'.($menu->user==2?' selected="true"':'').'>'.$langs->trans("AllMenus").'</option>'; print '<option value="2"'.($menu->user==2?' selected="true"':'').'>'.$langs->trans("AllMenus").'</option>';
print '<option value="0"'.($menu->user==0?' selected="true"':'').'>'.$langs->trans('Internal').'</option>'; print '<option value="0"'.($menu->user==0?' selected="true"':'').'>'.$langs->trans('Internal').'</option>';
print '<option value="1"'.($menu->user==1?' selected="true"':'').'>'.$langs->trans('External').'</option>'; print '<option value="1"'.($menu->user==1?' selected="true"':'').'>'.$langs->trans('External').'</option>';
@ -444,10 +444,14 @@ elseif ($action == 'edit')
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>'; print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
// Enabled // Enabled
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.$menu->enabled.'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>'; print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')';
print '</td></tr>';
// Perms // Perms
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.$menu->perms.'"></td><td>'.$langs->trans('DetailRight').'</td></tr>'; print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')';
print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -48,7 +48,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='commande'; $elementtype='commande'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -51,18 +51,17 @@ if ($action == 'update')
{ {
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity);
// if ($conf->global->MAIN_FEATURES_LEVEL > 1) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity);
// { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
// }
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;
@ -223,27 +222,31 @@ if ($action == 'edit') // Edit
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
print '</td></tr>'; print '</td></tr>';
// Hide Tva Intra on adress
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print '</td></tr>';
// if ($conf->global->MAIN_FEATURES_LEVEL > 1) //Desc
// { $var=!$var;
//Desc print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
$var=!$var; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>'; print '</td></tr>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
print '</td></tr>';
//Ref //Ref
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1); print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
print '</td></tr>'; print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
// }
print '</table>'; print '</table>';
@ -418,26 +421,30 @@ else // Show
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
// if ($conf->global->MAIN_FEATURES_LEVEL > 1) // Hide Tva Intra on adress
// { $var=!$var;
//Desc print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
$var=!$var; print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">'; print '</td></tr>';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
print '</td></tr>'; //Desc
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
print '</td></tr>';
//Ref //Ref
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">'; print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
print '</td></tr>'; print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '</td></tr>';
//Details
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print '</td></tr>';
// }
print '</table>'; print '</table>';

View File

@ -302,7 +302,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -132,7 +132,7 @@ $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("ConnectionTimeout").'</td><td align="right">'; print '<td>'.$langs->trans("ConnectionTimeout").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(isset($_POST["MAIN_USE_CONNECT_TIMEOUT"])?GETPOST("MAIN_USE_CONNECT_TIMEOUT"):$conf->global->MAIN_USE_CONNECT_TIMEOUT).'">'; print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(isset($_POST["MAIN_USE_CONNECT_TIMEOUT"])?GETPOST("MAIN_USE_CONNECT_TIMEOUT"):$conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
print ' '.strtolower($langs->trans("Seconds")); print ' '.strtolower($langs->trans("Seconds"));
print '</td>'; print '</td>';
@ -142,7 +142,7 @@ $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("ResponseTimeout").'</td><td align="right">'; print '<td>'.$langs->trans("ResponseTimeout").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_USE_RESPONSE_TIMEOUT" type="text" size="4" value="'.$conf->global->MAIN_USE_RESPONSE_TIMEOUT.'">'; print '<input class="flat" name="MAIN_USE_RESPONSE_TIMEOUT" type="text" size="4" value="'.$conf->global->MAIN_USE_RESPONSE_TIMEOUT.'">';
print ' '.strtolower($langs->trans("Seconds")); print ' '.strtolower($langs->trans("Seconds"));
print '</td>'; print '</td>';
@ -152,7 +152,7 @@ $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td align="right">'; print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -161,7 +161,7 @@ $var=!$var;
print '<tr '.$bcdd[$var].'>'; print '<tr '.$bcdd[$var].'>';
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td align="right">'; print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.$conf->global->MAIN_PROXY_HOST.'">'; print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.$conf->global->MAIN_PROXY_HOST.'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -170,7 +170,7 @@ $var=!$var;
print '<tr '.$bcdd[$var].'>'; print '<tr '.$bcdd[$var].'>';
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td align="right">'; print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.$conf->global->MAIN_PROXY_PORT.'">'; print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.$conf->global->MAIN_PROXY_PORT.'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -179,7 +179,7 @@ $var=!$var;
print '<tr '.$bcdd[$var].'>'; print '<tr '.$bcdd[$var].'>';
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td align="right">'; print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.$conf->global->MAIN_PROXY_USER.'">'; print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.$conf->global->MAIN_PROXY_USER.'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -188,7 +188,7 @@ $var=!$var;
print '<tr '.$bcdd[$var].'>'; print '<tr '.$bcdd[$var].'>';
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td align="right">'; print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td align="right">';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.$conf->global->MAIN_PROXY_PASS.'">'; print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.$conf->global->MAIN_PROXY_PASS.'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -247,7 +247,7 @@ foreach ($arrayhandler as $key => $module)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
elseif ($tmp=='NotConfigured') print $langs->trans($tmp); elseif ($tmp=='NotConfigured') print $langs->trans($tmp);

View File

@ -154,7 +154,7 @@ print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">'; print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds")); print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
@ -250,7 +250,7 @@ $max=@ini_get('upload_max_filesize');
if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.';
else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.'; else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb"); print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
@ -265,7 +265,7 @@ print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("UMask").'</td><td align="right">'; print '<td>'.$langs->trans("UMask").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print $form->textwithpicto('',$langs->trans("UMaskExplanation"));
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">'; print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">';
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';

View File

@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering model // Show example of numbering model
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';

View File

@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Show example of numbering module // Show example of numbering module
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$tmp=$module->getExample(); $tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';

View File

@ -49,7 +49,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='commande_fournisseur'; $elementtype='commande_fournisseur'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -48,7 +48,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='commande_fournisseur'; $elementtype='commande_fournisseur'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -192,7 +192,7 @@ foreach ($syslogModules as $moduleName)
print $module->getName(); print $module->getName();
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$setuparray=$module->configure(); $setuparray=$module->configure();
if ($setuparray) if ($setuparray)
{ {

View File

@ -165,11 +165,11 @@ function create_script_table($list)
foreach($list as $script) { ?> foreach($list as $script) { ?>
<tr <?php $var = ! $var; print $bc[$var]; ?>> <tr <?php $var = ! $var; print $bc[$var]; ?>>
<td><?php print dol_trunc($script['file'],80,'left'); ?></td> <td><?php print dol_trunc($script['file'],80,'left'); ?></td>
<td align="center" nowrap="nowrap"><?php print dol_print_date($script['mtime'],'dayhour'); ?></td> <td align="center" class="nowrap"><?php print dol_print_date($script['mtime'],'dayhour'); ?></td>
<td align="right" nowrap="nowrap"><?php print number_format($script['size'] / 1024, 2); ?> <td align="right" class="nowrap"><?php print number_format($script['size'] / 1024, 2); ?>
KB</td> KB</td>
<td align="right" nowrap="nowrap"><?php print $script['reloads']; ?> (<?php print $script['usecount']; ?>)</td> <td align="right" class="nowrap"><?php print $script['reloads']; ?> (<?php print $script['usecount']; ?>)</td>
<td align="right" nowrap="nowrap"><?php print $script['hits']; ?></td> <td align="right" class="nowrap"><?php print $script['hits']; ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
@ -199,10 +199,10 @@ function create_key_table($list)
?> ?>
<tr <?php $var = ! $var; print $bc[$var]; ?>> <tr <?php $var = ! $var; print $bc[$var]; ?>>
<td><?php print dol_trunc($key['name'],80,'left'); ?></td> <td><?php print dol_trunc($key['name'],80,'left'); ?></td>
<td align="center" nowrap="nowrap"><?php dol_print_date($key['created'],'dayhour'); ?></td> <td align="center" class="nowrap"><?php dol_print_date($key['created'],'dayhour'); ?></td>
<td align="right" nowrap="nowrap"><?php print number_format($key['size']/1024, 3); ?> <td align="right" class="nowrap"><?php print number_format($key['size']/1024, 3); ?>
KB</td> KB</td>
<td align="right" nowrap="nowrap"><?php <td align="right" class="nowrap"><?php
if ($key['ttl'] == -1) { if ($key['ttl'] == -1) {
print 'expired'; print 'expired';
} elseif ($key['ttl'] == 0) { } elseif ($key['ttl'] == 0) {

View File

@ -206,18 +206,18 @@ if ($result)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Date // Date
print '<td align="left" nowrap="nowrap">'.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').'</td>'; print '<td align="left" class="nowrap">'.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').'</td>';
// Code // Code
print '<td>'.$obj->type.'</td>'; print '<td>'.$obj->type.'</td>';
// IP // IP
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print dol_print_ip($obj->ip); print dol_print_ip($obj->ip);
print '</td>'; print '</td>';
// Login // Login
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
if ($obj->fk_user) if ($obj->fk_user)
{ {
$userstatic->id=$obj->fk_user; $userstatic->id=$obj->fk_user;

View File

@ -151,16 +151,16 @@ if ($savehandler == 'files')
print '<td>'.$sessionentry['login'].'</td>'; print '<td>'.$sessionentry['login'].'</td>';
// ID // ID
print '<td align="left" nowrap="nowrap">'; print '<td align="left" class="nowrap">';
if ("$key" == session_id()) print $form->textwithpicto($key,$langs->trans("YourSession")); if ("$key" == session_id()) print $form->textwithpicto($key,$langs->trans("YourSession"));
else print $key; else print $key;
print '</td>'; print '</td>';
// Date creation // Date creation
print '<td align="left" nowrap="nowrap">'.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').'</td>'; print '<td align="left" class="nowrap">'.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').'</td>';
// Date modification // Date modification
print '<td align="left" nowrap="nowrap">'.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').'</td>'; print '<td align="left" class="nowrap">'.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').'</td>';
// Age // Age
print '<td>'.$sessionentry['age'].'</td>'; print '<td>'.$sessionentry['age'].'</td>';

View File

@ -52,7 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
$interfaces = new Interfaces($db); $interfaces = new Interfaces($db);
$triggers = $interfaces->getTriggersList(0,'priority'); $triggers = $interfaces->getTriggersList(0,'priority');
include $template_dir.'triggers.tpl.php'; print '<table class="noborder">
<tr class="liste_titre">
<td colspan="2">'.$langs->trans("File").'</td>
<td align="center">'.$langs->trans("Active").'</td>
<td align="center">&nbsp;</td>
</tr>
';
$var=True;
foreach ($triggers as $trigger)
{
$var=!$var;
print '<tr '.$bc[$var].'>';
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 '</tr>';
}
print '</table>';
llxFooter(); llxFooter();

View File

@ -170,7 +170,7 @@ if ($resql)
print '<td align="right">'.$obj->position."</td>"; print '<td align="right">'.$obj->position."</td>";
// Actions // Actions
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
print "<a href=\"".DOL_URL_ROOT."/bookmarks/fiche.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> "; print "<a href=\"".DOL_URL_ROOT."/bookmarks/fiche.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";

View File

@ -140,9 +140,9 @@ print $object->ref;
<table class="totaux"> <table class="totaux">
<?php <?php
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalHT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."</td></tr>\n"; 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 nowrap="nowrap">'.$langs->trans("TotalVAT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->montantTva(),'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 nowrap="nowrap">'.$langs->trans("TotalTTC").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prixTotalTtc(),'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";
?> ?>
</table> </table>

View File

@ -261,23 +261,23 @@ if ($socid)
print '</td></tr>'; print '</td></tr>';
} }
// EMail
print '<tr><td>'.$langs->trans('EMail').'</td><td colspan="3">';
print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL');
print '</td></tr>';
// Web
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
print dol_print_url($soc->url);
print '</td></tr>';
// Phone // Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>'; print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>'; print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
// EMail
print '<tr><td>'.$langs->trans('EMail').'</td><td>';
print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL');
print '</td>';
// Web
print '<td>'.$langs->trans('Web').'</td><td>';
print dol_print_url($soc->url);
print '</td></tr>';
// Assujeti a TVA ou pas // Assujeti a TVA ou pas
print '<tr>'; print '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">'; print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($soc->tva_assuj); print yn($soc->tva_assuj);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -241,11 +241,8 @@ class Categorie
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; $sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
$sql.= " SET label = '".$this->db->escape($this->label)."'"; $sql.= " SET label = '".$this->db->escape($this->label)."',";
if (! empty($this->description)) $sql.= " description = '".$this->db->escape($this->description)."'";
{
$sql .= ", description = '".$this->db->escape($this->description)."'";
}
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{ {
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');

View File

@ -27,6 +27,7 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$langs->load("categories");
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$ref=GETPOST('ref'); $ref=GETPOST('ref');
@ -62,7 +63,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
$result=$categorie->fetch($id); $result=$categorie->fetch($id);
$categorie->label = $nom; $categorie->label = $nom;
$categorie->description = $description; $categorie->description = dol_htmlcleanlastbr($description);
$categorie->socid = ($socid ? $socid : 'null'); $categorie->socid = ($socid ? $socid : 'null');
$categorie->visible = $visible; $categorie->visible = $visible;

View File

@ -108,7 +108,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
$object = new Categorie($db); $object = new Categorie($db);
$object->label = $label; $object->label = $label;
$object->description = $description; $object->description = dol_htmlcleanlastbr($description);
$object->socid = ($socid ? $socid : 'null'); $object->socid = ($socid ? $socid : 'null');
$object->visible = $visible; $object->visible = $visible;
$object->type = $type; $object->type = $type;
@ -192,7 +192,7 @@ if ($user->rights->categorie->creer)
if ($action == 'create' || $_POST["addcat"] == 'addcat') if ($action == 'create' || $_POST["addcat"] == 'addcat')
{ {
dol_set_focus('#label'); dol_set_focus('#label');
print '<form action="'.$_SERVER['PHP_SELF'].'?type='.$type.'" method="POST">'; print '<form action="'.$_SERVER['PHP_SELF'].'?type='.$type.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="urlfrom" value="'.$urlfrom.'">'; print '<input type="hidden" name="urlfrom" value="'.$urlfrom.'">';

View File

@ -258,7 +258,7 @@ if ($object->type == 0)
{ {
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td nowrap="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $prod->getNomUrl(1,'category'); print $prod->getNomUrl(1,'category');
print "</td>\n"; print "</td>\n";
print '<td valign="top">'.$prod->libelle."</td>\n"; print '<td valign="top">'.$prod->libelle."</td>\n";
@ -309,7 +309,7 @@ if ($object->type == 1)
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td nowrap="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category_supplier'); print $soc->getNomUrl(1,'category_supplier');
print "</td>\n"; print "</td>\n";
// Link to delete from category // Link to delete from category
@ -361,7 +361,7 @@ if($object->type == 2)
$i++; $i++;
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td nowrap="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category'); print $soc->getNomUrl(1,'category');
print "</td>\n"; print "</td>\n";
// Link to delete from category // Link to delete from category
@ -413,7 +413,7 @@ if ($object->type == 3)
{ {
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td nowrap="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
$member->ref=$member->login; $member->ref=$member->login;
print $member->getNomUrl(1,0,'category'); print $member->getNomUrl(1,0,'category');
print "</td>\n"; print "</td>\n";

View File

@ -35,7 +35,7 @@ class ActionComm extends CommonObject
public $element='action'; public $element='action';
public $table_element = 'actioncomm'; public $table_element = 'actioncomm';
public $table_rowid = 'id'; public $table_rowid = 'id';
protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;

View File

@ -266,7 +266,7 @@ if ($id > 0 || ! empty($ref))
// Ligne ajout pour contact interne // Ligne ajout pour contact interne
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print img_object('','user').' '.$langs->trans("Users"); print img_object('','user').' '.$langs->trans("Users");
print '</td>'; print '</td>';
@ -298,7 +298,7 @@ if ($id > 0 || ! empty($ref))
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
print '</td>'; print '</td>';

View File

@ -51,6 +51,21 @@ if ($user->societe_id > 0)
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', '', 'id');
$act = new ActionComm($db);
if ($objectid > 0)
{
$ret = $act->fetch($objectid);
if ($ret > 0) {
$company=new Societe($db);
$company->fetch($act->societe->id);
$act->societe=$company; // For backward compatibility
$act->thirdparty=$company;
}
}
// Get parameters // Get parameters
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
@ -79,7 +94,7 @@ if ($action == 'delete')
{ {
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file); $ret=dol_delete_file($file,0,0,0,$act);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action=''; $action='';
@ -96,184 +111,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url); llxHeader('',$langs->trans("Agenda"),$help_url);
if ($objectid > 0) if ($act->id > 0)
{ {
$act = new ActionComm($db); $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
if ($act->fetch($objectid))
$author=new User($db);
$author->fetch($act->author->id);
$act->author=$author;
if ($act->contact->id) $act->fetch_contact($act->contact->id);
$head=actions_prepare_head($act);
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
$company=new Societe($db); // Title
$company->fetch($act->societe->id); print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
$act->societe=$company;
$author=new User($db); // Full day event
$author->fetch($act->author->id); print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
$act->author=$author;
if ($act->contact->id) $act->fetch_contact($act->contact->id); // Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
else print dol_print_date($act->datep,'day');
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
$head=actions_prepare_head($act); // Date end
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
else print dol_print_date($act->datef,'day');
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Affichage fiche action en mode visu // Status
print '<table class="border" width="100%">'; print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>'; // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type print '</table><br><br><table class="border" width="100%">';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
{ {
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>'; print "<br>".dol_print_phone($act->societe->tel);
} }
}
// Title print '</td>';
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>'; print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
// Full day event if ($act->contact->id > 0)
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>'; {
print $act->contact->getNomUrl(1);
// Date start if ($act->contact->id && $act->type_code == 'AC_TEL')
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
else print dol_print_date($act->datep,'day');
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
else print dol_print_date($act->datef,'day');
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Status
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
}
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
{
if ($act->contact->fetch($act->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
}
}
}
else
{
print $langs->trans("None");
}
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
{
$project=new Project($db);
$project->fetch($act->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{ {
$totalsize+=$file['size']; if ($act->contact->fetch($act->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
}
} }
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create));
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
} }
else else
{ {
dol_print_error($db); print $langs->trans("None");
} }
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
{
$project=new Project($db);
$project->fetch($act->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
$totalsize+=$file['size'];
}
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
} }
else else
{ {

View File

@ -53,7 +53,7 @@ $contactid=GETPOST('contactid','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$id = GETPOST('id','int'); $id = GETPOST('id','int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id'); $result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
$error=GETPOST("error"); $error=GETPOST("error");
$mesg=''; $mesg='';
@ -64,7 +64,7 @@ $contact = new Contact($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm'); $extralabels=$extrafields->fetch_name_optionals_label($actioncomm->table_element);
//var_dump($_POST); //var_dump($_POST);
@ -473,7 +473,7 @@ if ($action == 'create')
// Date start // Date start
$datep=$actioncomm->datep; $datep=$actioncomm->datep;
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
print '<tr><td width="30%" nowrap="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>'; print '<tr><td width="30%" class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend'); if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
@ -514,12 +514,12 @@ if ($action == 'create')
// Assigned to // Assigned to
$var=false; $var=false;
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1); $form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1);
print '</td></tr>'; print '</td></tr>';
// Busy // Busy
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Busy").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">'; print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">';
print '</td></tr>'; print '</td></tr>';
@ -536,7 +536,7 @@ if ($action == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Societe, contact // Societe, contact
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionOnCompany").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionOnCompany").'</td><td>';
if (GETPOST('socid','int') > 0) if (GETPOST('socid','int') > 0)
{ {
$societe = new Societe($db); $societe = new Societe($db);
@ -711,7 +711,7 @@ if ($id > 0)
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1'? $backtopage : $_SERVER["HTTP_REFERER"]).'">'; if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1'? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
@ -732,7 +732,7 @@ if ($id > 0)
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
// Date start // Date start
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">'; print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
if (GETPOST("afaire") == 1) $form->select_date($act->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart'); if (GETPOST("afaire") == 1) $form->select_date($act->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
else if (GETPOST("afaire") == 2) $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else if (GETPOST("afaire") == 2) $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
else $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
@ -745,7 +745,7 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
// Status // Status
print '<tr><td nowrap="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage;
print $htmlactions->form_select_status_action('formaction',$percent,1); print $htmlactions->form_select_status_action('formaction',$percent,1);
print '</td></tr>'; print '</td></tr>';
@ -756,19 +756,19 @@ if ($id > 0)
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
// Assigned to // Assigned to
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1); print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1);
print '</td></tr>'; print '</td></tr>';
// Busy // Busy
print '<tr><td nowrap="nowrap">'.$langs->trans("Busy").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency"'.($act->transparency?' checked="checked"':'').'">'; print '<input id="transparency" type="checkbox" name="transparency"'.($act->transparency?' checked="checked"':'').'">';
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
if ($conf->global->AGENDA_ENABLE_DONEBY) if ($conf->global->AGENDA_ENABLE_DONEBY)
{ {
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -838,7 +838,7 @@ if ($id > 0)
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<center><input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">'; print '<center><input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>'; print '</center>';
@ -848,7 +848,7 @@ if ($id > 0)
else else
{ {
dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu // Affichage fiche action en mode visu
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -916,7 +916,7 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
// Status // Status
print '<tr><td nowrap="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">'; print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4); print $act->getLibStatut(4);
print '</td></tr>'; print '</td></tr>';
@ -926,19 +926,19 @@ if ($id > 0)
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
// Assigned to // Assigned to
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
// Busy // Busy
print '<tr><td nowrap="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">';
print yn(($act->transparency > 0)?1:0); print yn(($act->transparency > 0)?1:0);
print '</td></tr>'; print '</td></tr>';
// Done by // Done by
if ($conf->global->AGENDA_ENABLE_DONEBY) if ($conf->global->AGENDA_ENABLE_DONEBY)
{ {
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -780,7 +780,7 @@ if (empty($action) || $action == 'show_month') // View by month
{ {
$style='cal_other_month cal_past'; $style='cal_other_month cal_past';
if ($iter_day == 6) $style.=' cal_other_month_right'; if ($iter_day == 6) $style.=' cal_other_month_right';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
echo " </td>\n"; echo " </td>\n";
} }
@ -796,7 +796,7 @@ if (empty($action) || $action == 'show_month') // View by month
if ($today) $style='cal_today'; if ($today) $style='cal_today';
if ($curtime < $todaytms) $style.=' cal_past'; if ($curtime < $todaytms) $style.=' cal_past';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
echo " </td>\n"; echo " </td>\n";
} }
@ -805,7 +805,7 @@ if (empty($action) || $action == 'show_month') // View by month
{ {
$style='cal_other_month'; $style='cal_other_month';
if ($iter_day == 6) $style.=' cal_other_month_right'; if ($iter_day == 6) $style.=' cal_other_month_right';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
echo "</td>\n"; echo "</td>\n";
} }
@ -855,7 +855,7 @@ elseif ($action == 'show_week') // View by week
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($today) $style='cal_today'; if ($today) $style='cal_today';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo " </td>\n"; echo " </td>\n";
} }
@ -863,7 +863,7 @@ elseif ($action == 'show_week') // View by week
{ {
$style='cal_current_month'; $style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right'; if ($iter_day == 6) $style.=' cal_other_month_right';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo "</td>\n"; echo "</td>\n";
} }
@ -892,7 +892,7 @@ else // View by day
echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n"; echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo " <tr>\n"; echo " <tr>\n";
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
$maxnbofchar=80; $maxnbofchar=80;
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo "</td>\n"; echo "</td>\n";
@ -947,7 +947,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n"; print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
$curtime = dol_mktime(0, 0, 0, $month, $day, $year); $curtime = dol_mktime(0, 0, 0, $month, $day, $year);
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print '<tr><td align="left" nowrap="nowrap">'; print '<tr><td align="left" class="nowrap">';
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?'; print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?';
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
print $newparam; print $newparam;
@ -956,7 +956,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($showinfo) print dol_print_date($curtime,'daytext'); if ($showinfo) print dol_print_date($curtime,'daytext');
else print dol_print_date($curtime,'%d'); else print dol_print_date($curtime,'%d');
print '</a>'; print '</a>';
print '</td><td align="right" nowrap="nowrap">'; print '</td><td align="right" class="nowrap">';
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
{ {
//$param='month='.$monthshown.'&year='.$year; //$param='month='.$monthshown.'&year='.$year;
@ -966,7 +966,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '</a>'; print '</a>';
} }
print '</td></tr>'; print '</td></tr>';
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" nowrap="nowrap" style="padding-bottom: 2px;">'; print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="nowrap" style="padding-bottom: 2px;">';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year); //$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
@ -1034,7 +1034,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'">'; print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'">';
print '<ul class="cal_event"><li class="cal_event">'; print '<ul class="cal_event"><li class="cal_event">';
print '<table class="cal_event" style="background: #'.$color.'; -moz-border-radius:4px; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).')); " width="100%"><tr>'; print '<table class="cal_event" style="background: #'.$color.'; -moz-border-radius:4px; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).')); " width="100%"><tr>';
print '<td nowrap="nowrap" class="cal_event">'; print '<td class="nowrap cal_event">';
if ($event->type_code == 'BIRTHDAY') // It's a birthday if ($event->type_code == 'BIRTHDAY') // It's a birthday
{ {
print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
@ -1155,7 +1155,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '</td>'; print '</td>';
// Status - Percent // Status - Percent
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr></table>'; print '</td></tr></table>';

View File

@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$langs->load("commercial"); $langs->load("commercial");
$id = GETPOST('id','int');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
@ -38,6 +40,7 @@ if ($user->societe_id > 0)
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
/* /*
@ -48,8 +51,8 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url); llxHeader('',$langs->trans("Agenda"),$help_url);
$act = new ActionComm($db); $act = new ActionComm($db);
$act->fetch($_GET["id"]); $act->fetch($id);
$act->info($_GET["id"]); $act->info($act->id);
$head=actions_prepare_head($act); $head=actions_prepare_head($act);
dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action'); dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action');

View File

@ -276,7 +276,7 @@ if ($resql)
//print dol_trunc($obj->label,12); //print dol_trunc($obj->label,12);
//print '</td>'; //print '</td>';
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->dp),"day"); print dol_print_date($db->jdate($obj->dp),"day");
$late=0; $late=0;
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1; if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1;
@ -286,7 +286,7 @@ if ($resql)
if ($late) print img_warning($langs->trans("Late")).' '; if ($late) print img_warning($langs->trans("Late")).' ';
print '</td>'; print '</td>';
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->dp2),"day"); print dol_print_date($db->jdate($obj->dp2),"day");
print '</td>'; print '</td>';
@ -354,7 +354,7 @@ if ($resql)
print '</td>'; print '</td>';
// Status/Percent // Status/Percent
print '<td align="right" nowrap="nowrap">'.$actionstatic->LibStatut($obj->percent,6).'</td>'; print '<td align="right" class="nowrap">'.$actionstatic->LibStatut($obj->percent,6).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='propal'; $elementtype='propal'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -236,7 +236,7 @@ if ($id > 0)
print "</td></tr>"; print "</td></tr>";
// Zip / Town // Zip / Town
print '<tr><td nowrap="nowrap">'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td>'; print '<tr><td class="nowrap">'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td>';
print '<td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town."</td>"; print '<td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town."</td>";
print '</tr>'; print '</tr>';
@ -247,21 +247,21 @@ if ($id > 0)
else print ($img?$img.' ':'').$object->country; else print ($img?$img.' ':'').$object->country;
print '</td></tr>'; print '</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// 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>';
// EMail // EMail
print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'</td></tr>'; print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'</td></tr>';
// Web // Web
print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url,'_blank').'</td></tr>'; print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url,'_blank').'</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// 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>';
// Assujeti a TVA ou pas // Assujeti a TVA ou pas
print '<tr>'; print '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">'; print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($object->tva_assuj); print yn($object->tva_assuj);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -271,10 +271,10 @@ if ($id > 0)
{ {
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{ {
print '<tr><td nowrap="nowrap">'.$langs->trans('LocalTax1IsUsedES').'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans('LocalTax1IsUsedES').'</td><td colspan="3">';
print yn($object->localtax1_assuj); print yn($object->localtax1_assuj);
print '</td></tr>'; print '</td></tr>';
print '<tr><td nowrap="nowrap">'.$langs->trans('LocalTax2IsUsedES').'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans('LocalTax2IsUsedES').'</td><td colspan="3">';
print yn($object->localtax2_assuj); print yn($object->localtax2_assuj);
print '</td></tr>'; print '</td></tr>';
} }
@ -441,12 +441,12 @@ if ($id > 0)
print "</table>"; print "</table>";
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print "</td>\n"; //print "</td>\n";
//print '<td valign="top" width="50%" class="notopnoleftnoright">'; //print '<td valign="top" width="50%" class="notopnoleftnoright">';
// Nbre max d'elements des petites listes // Nbre max d'elements des petites listes
$MAXLIST=4; $MAXLIST=4;
$tableaushown=1; $tableaushown=1;
@ -469,10 +469,6 @@ if ($id > 0)
{ {
$propal_static = new Propal($db); $propal_static = new Propal($db);
$proposals = $propal_static->liste_array(0, 0, 0, $object->id, $MAXLIST);
//var_dump($proposals);
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
$sql.= " p.datep as dp, p.fin_validite as datelimite"; $sql.= " p.datep as dp, p.fin_validite as datelimite";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
@ -503,14 +499,14 @@ if ($id > 0)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td nowrap="nowrap"><a href="propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a>'."\n"; print '<td class="nowrap"><a href="propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a>'."\n";
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 )
{ {
print " ".img_warning(); print " ".img_warning();
} }
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n"; print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>'; print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
print '<td align="right" style="min-width: 60px" nowrap="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>'; print '<td align="right" style="min-width: 60px" class="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>';
$var=!$var; $var=!$var;
$i++; $i++;
} }
@ -579,10 +575,10 @@ if ($id > 0)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n"; print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>'; print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
print '<td align="right" style="min-width: 60px" nowrap="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>'; print '<td align="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
@ -631,14 +627,14 @@ if ($id > 0)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$contrat->id=$objp->id; $contrat->id=$objp->id;
$contrat->ref=$objp->ref?$objp->ref:$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id;
print $contrat->getNomUrl(1,12); print $contrat->getNomUrl(1,12);
print "</td>\n"; print "</td>\n";
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
$contrat->fetch_lines(); $contrat->fetch_lines();
print $contrat->getLibStatut(4); print $contrat->getLibStatut(4);
print "</td>\n"; print "</td>\n";
@ -692,7 +688,7 @@ if ($id > 0)
$fichinter_static->statut=$objp->fk_statut; $fichinter_static->statut=$objp->fk_statut;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n"; print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n";
//print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n"; //print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
print '<td align="right" width="120">'.convertSecondToTime($objp->duration).'</td>'."\n"; print '<td align="right" width="120">'.convertSecondToTime($objp->duration).'</td>'."\n";
print '<td align="right" width="100">'.$fichinter_static->getLibStatut(5).'</td>'."\n"; print '<td align="right" width="100">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
@ -753,7 +749,7 @@ if ($id > 0)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$objp->facid; $facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber; $facturestatic->ref=$objp->facnumber;
$facturestatic->type=$objp->type; $facturestatic->type=$objp->type;
@ -769,7 +765,7 @@ if ($id > 0)
} }
print '<td align="right" width="120">'.price($objp->total_ttc).'</td>'; print '<td align="right" width="120">'.price($objp->total_ttc).'</td>';
print '<td align="right" nowrap="nowrap" width="100" >'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>'; print '<td align="right" class="nowrap" width="100" >'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -157,19 +157,19 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td nowrap="nowrap">'; print '<tr '.$bc[$var].'><td class="nowrap">';
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->client=$obj->client; $companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1,'customer',16); print $companystatic->getNomUrl(1,'customer',16);
print '</td>'; print '</td>';
print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>'; print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>';
$i++; $i++;
$total += $obj->total_ht; $total += $obj->total_ht;
} }
@ -224,15 +224,15 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td nowrap="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'; print '<tr '.$bc[$var].'><td class="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->client=$obj->client; $companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1,'customer',16); print $companystatic->getNomUrl(1,'customer',16);
print '</td>'; print '</td>';
print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>'; print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
$i++; $i++;
$total += $obj->total_ttc; $total += $obj->total_ttc;
} }
@ -295,7 +295,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
$companystatic->client=$objp->client; $companystatic->client=$objp->client;
$companystatic->canvas=$objp->canvas; $companystatic->canvas=$objp->canvas;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>'; print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
print '<td align="right" nowrap>'; print '<td align="right" nowrap>';
print $companystatic->getLibCustProspStatut(); print $companystatic->getLibCustProspStatut();
print "</td>"; print "</td>";
@ -351,7 +351,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$companystatic->name=$objp->name; $companystatic->name=$objp->name;
$companystatic->canvas=$objp->canvas; $companystatic->canvas=$objp->canvas;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'supplier',44).'</td>'; print '<td class="nowrap">'.$companystatic->getNomUrl(1,'supplier',44).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
print '</tr>'; print '</tr>';
$var=!$var; $var=!$var;
@ -481,16 +481,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Ref // Ref
print '<td nowrap="nowrap" width="140">'; print '<td class="nowrap" width="140">';
$propalstatic->id=$obj->propalid; $propalstatic->id=$obj->propalid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="18" class="nobordernopadding" nowrap="nowrap">'; print '<td width="18" class="nobordernopadding nowrap">';
if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td width="16" align="center" class="nobordernopadding">'; print '<td width="16" align="center" class="nobordernopadding">';

View File

@ -137,6 +137,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit +1, $offset); $sql.= $db->plimit($conf->liste_limit +1, $offset);
dol_syslog('comm:list.php: sql='.$sql,LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {

View File

@ -483,7 +483,7 @@ if ($object->fetch($id) >= 0)
if ($obj->statut == 0) if ($obj->statut == 0)
{ {
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print '<td align="right" nowrap="nowrap">'.$langs->trans("MailingStatusNotSent"); print '<td align="right" class="nowrap">'.$langs->trans("MailingStatusNotSent");
if ($user->rights->mailing->creer) { if ($user->rights->mailing->creer) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")); print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient"));
} }
@ -492,7 +492,7 @@ if ($object->fetch($id) >= 0)
else else
{ {
print '<td align="center">'.$obj->date_envoi.'</td>'; print '<td align="center">'.$obj->date_envoi.'</td>';
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error(); if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error();
if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4');
if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');

View File

@ -49,7 +49,7 @@ $result=$object->fetch($id);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('mailing'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('mailingcard')); $hookmanager->initHooks(array('mailingcard'));

View File

@ -176,7 +176,7 @@ if ($result)
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>'; print '<td class="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre,38).'</td>'; print '<td>'.dol_trunc($obj->titre,38).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>';
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>'; print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';

View File

@ -161,10 +161,10 @@ if ($result)
print '</td>'; print '</td>';
} }
// Last send // Last send
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($obj->date_envoi),'day').'</td>'; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->date_envoi),'day').'</td>';
print '</td>'; print '</td>';
// Status // Status
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
if ($filteremail) if ($filteremail)
{ {
if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error(); if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error();

View File

@ -83,7 +83,7 @@ $object = new Propal($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('propal'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
@ -1116,7 +1116,7 @@ else if ($action == 'down' && $user->rights->propal->creer)
else if ($action == 'update_extras') else if ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from update form // Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label('propal'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
@ -1290,7 +1290,7 @@ if ($action == 'create')
print '<tr><td class="fieldrequired">'.$langs->trans("ValidityDuration").'</td><td colspan="2"><input name="duree_validite" size="5" value="'.$conf->global->PROPALE_VALIDITY_DURATION.'"> '.$langs->trans("days").'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("ValidityDuration").'</td><td colspan="2"><input name="duree_validite" size="5" value="'.$conf->global->PROPALE_VALIDITY_DURATION.'"> '.$langs->trans("days").'</td></tr>';
// Terms of payment // Terms of payment
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">'; print '<tr><td class="nowrap fieldrequired">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id');
print '</td></tr>'; print '</td></tr>';
@ -1561,7 +1561,7 @@ else
// Ref client // Ref client
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">'; print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print $langs->trans('RefCustomer').'</td><td align="left">'; print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>'; print '</td>';
if ($action != 'refclient' && ! empty($object->brouillon)) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>'; if ($action != 'refclient' && ! empty($object->brouillon)) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
@ -1837,65 +1837,37 @@ else
if ($action == 'edit_extras') if ($action == 'edit_extras')
{ {
print '</table>';
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">'; print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">'; print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<table class="border" width="100%">';
} }
// TODO : use showOptionals($extrafields) function print $object->showOptionals($extrafields,'edit');
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
{
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
// Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
{
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key];
}
if ($action == 'edit_extras' && $user->rights->propal->creer)
{
print $extrafields->showInputField($key,$value);
}
else
{
print $extrafields->showOutputField($key,$value);
}
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) { if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->propal->creer) if ($action == 'edit_extras' && $user->rights->propal->creer)
{ {
print '<tr><td></td><td>'; print '<tr><td width="25%"></td><td>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>'; print '</td></tr>';
print '</table></form>';
print '<table class="border" width="100%">';
} }
else { else {
if ($object->statut == 0 && $user->rights->propal->creer) if ($object->statut == 0 && $user->rights->propal->creer)
{ {
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>'; print '<tr><td width="25%"></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
} }
} }
} }
} }
// Amount HT // Amount HT
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>'; print '<tr><td height="10" width="25%">'.$langs->trans('AmountHT').'</td>';
print '<td align="right" nowrap><b>'.price($object->total_ht).'</b></td>'; print '<td align="right" nowrap><b>'.price($object->total_ht).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td>';

View File

@ -307,13 +307,13 @@ class Propal extends CommonObject
* @param int $fk_fournprice Id supplier price * @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax * @param int $pa_ht Buying price without tax
* @param string $label ??? * @param string $label ???
* @param timestamp $date_start Start date of the line * @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line * @param timestamp $date_end End date of the line
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
* *
* @see add_product * @see add_product
*/ */
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$date_start='', $date_end='') function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='')
{ {
global $conf; global $conf;
@ -403,7 +403,7 @@ class Propal extends CommonObject
$this->line->product_type=$type; $this->line->product_type=$type;
$this->line->special_code=$special_code; $this->line->special_code=$special_code;
$this->line->fk_parent_line=$fk_parent_line; $this->line->fk_parent_line=$fk_parent_line;
$this->line->date_start=$date_start; $this->line->date_start=$date_start;
$this->line->date_end=$date_end; $this->line->date_end=$date_end;
@ -470,11 +470,11 @@ class Propal extends CommonObject
* @param int $pa_ht Price (without tax) of product when it was bought * @param int $pa_ht Price (without tax) of product when it was bought
* @param string $label ??? * @param string $label ???
* @param int $type 0/1=Product/service * @param int $type 0/1=Product/service
* @param timestamp $date_start Start date of the line * @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line * @param timestamp $date_end End date of the line
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='') function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='')
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -552,7 +552,7 @@ class Propal extends CommonObject
// infos marge // infos marge
$this->line->fk_fournprice = $fk_fournprice; $this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht; $this->line->pa_ht = $pa_ht;
$this->line->date_start=$date_start; $this->line->date_start=$date_start;
$this->line->date_end=$date_end; $this->line->date_end=$date_end;
@ -830,7 +830,7 @@ class Propal extends CommonObject
} }
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;
if (! $notrigger) if (! $notrigger)
{ {
// Appel des triggers // Appel des triggers
@ -1099,6 +1099,16 @@ class Propal extends CommonObject
$this->brouillon = 1; $this->brouillon = 1;
} }
// Retreive all extrafield for invoice
// fetch optionals attributes and labels
if(!class_exists('Extrafields'))
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (count($extralabels)>0) {
$this->fetch_optionals($this->id,$extralabels);
}
$this->db->free($resql); $this->db->free($resql);
$this->lines = array(); $this->lines = array();
@ -1164,7 +1174,7 @@ class Propal extends CommonObject
$line->product_label = $objp->product_label; $line->product_label = $objp->product_label;
$line->product_desc = $objp->product_desc; // Description produit $line->product_desc = $objp->product_desc; // Description produit
$line->fk_product_type = $objp->fk_product_type; $line->fk_product_type = $objp->fk_product_type;
$line->date_start = $objp->date_start; $line->date_start = $objp->date_start;
$line->date_end = $objp->date_end; $line->date_end = $objp->date_end;
@ -1187,15 +1197,10 @@ class Propal extends CommonObject
if(!class_exists('Extrafields')) if(!class_exists('Extrafields'))
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db); $extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label('propal',true); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
//$this->fetch_optionals($this->id,$extralabels);
if (count($extralabels)>0) { if (count($extralabels)>0) {
$this->array_options = array(); $this->fetch_optionals($this->id,$extralabels);
} }
foreach($extrafields->attribute_label as $key=>$label)
{
$this->array_options['options_'.$key]=$label;
}
return 1; return 1;
} }
@ -1209,7 +1214,7 @@ class Propal extends CommonObject
return -1; return -1;
} }
} }
/** /**
* Update value of extrafields on the proposal * Update value of extrafields on the proposal
* *
@ -1235,7 +1240,7 @@ class Propal extends CommonObject
} }
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;
if (!$error) if (!$error)
{ {
return 1; return 1;
@ -1244,7 +1249,7 @@ class Propal extends CommonObject
{ {
return -1; return -1;
} }
} }
/** /**
@ -1262,16 +1267,16 @@ class Propal extends CommonObject
$now=dol_now(); $now=dol_now();
if ($user->rights->propale->valider) if ($user->rights->propale->valider)
{ {
$this->db->begin(); $this->db->begin();
// Numbering module definition // Numbering module definition
$soc = new Societe($this->db); $soc = new Societe($this->db);
$soc->fetch($this->socid); $soc->fetch($this->socid);
// Class of company linked to propal // Class of company linked to propal
$result=$soc->set_as_client(); $result=$soc->set_as_client();
// Define new ref // Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
{ {
@ -1648,7 +1653,7 @@ class Propal extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -1674,7 +1679,7 @@ class Propal extends CommonObject
} }
else else
{ {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -1688,7 +1693,7 @@ class Propal extends CommonObject
//$ret=$object->fetch($id); // Reload to get new records //$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
// Appel des triggers // Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db); $interface=new Interfaces($this->db);
@ -1769,9 +1774,9 @@ class Propal extends CommonObject
/** /**
* Return list of proposal (eventually filtered on user) into an array * Return list of proposal (eventually filtered on user) into an array
* *
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref) * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
* @param int $draft 0=not draft, 1=draft * @param int $draft 0=not draft, 1=draft
* @param int $notcurrentuser 0=current user, 1=not current user * @param int $notcurrentuser 0=all user, 1=not current user
* @param int $socid Id third pary * @param int $socid Id third pary
* @param int $limit For pagination * @param int $limit For pagination
* @param int $offset For pagination * @param int $offset For pagination
@ -1785,15 +1790,22 @@ class Propal extends CommonObject
$ga = array(); $ga = array();
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; $sql = "SELECT s.rowid, s.nom as name, s.client,";
$sql.= " p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
$sql.= " p.datep as dp, p.fin_validite as datelimite"; $sql.= " p.datep as dp, p.fin_validite as datelimite";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.fk_soc = s.rowid";
$sql.= " AND p.fk_statut = c.id"; $sql.= " AND p.fk_statut = c.id";
if (! $user->rights->societe->client->voir && ! $socid) //restriction
{
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($draft) $sql.= " AND p.fk_statut = 0"; if ($draft) $sql.= " AND p.fk_statut = 0";
if ($notcurrentuser) $sql.= " AND p.fk_user_author <> ".$user->id; if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id;
$sql.= $this->db->order($sortfield,$sortorder); $sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit,$offset); $sql.= $this->db->plimit($limit,$offset);
@ -1808,14 +1820,19 @@ class Propal extends CommonObject
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
if ($shortlist) if ($shortlist == 1)
{ {
$ga[$obj->propalid] = $obj->ref; $ga[$obj->propalid] = $obj->ref;
} }
else else if ($shortlist == 2)
{ {
$ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')';
}
else
{
$ga[$i]['id'] = $obj->propalid; $ga[$i]['id'] = $obj->propalid;
$ga[$i]['ref'] = $obj->ref; $ga[$i]['ref'] = $obj->ref;
$ga[$i]['name'] = $obj->name;
} }
$i++; $i++;
@ -2000,6 +2017,21 @@ class Propal extends CommonObject
} }
} }
// Removed extrafields
if (! $error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->deleteExtraFields();
if ($result < 0)
{
$error++;
$errorflag=-4;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}
}
if (! $error) if (! $error)
{ {
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
@ -2223,11 +2255,11 @@ class Propal extends CommonObject
} }
if ($mode == 5) if ($mode == 5)
{ {
if ($statut==0) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusDraftShort'),'statut0'); if ($statut==0) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($langs->trans('PropalStatusDraftShort'),'statut0');
if ($statut==1) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusOpenedShort'),'statut1'); if ($statut==1) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($langs->trans('PropalStatusOpenedShort'),'statut1');
if ($statut==2) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusSignedShort'),'statut3'); if ($statut==2) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($langs->trans('PropalStatusSignedShort'),'statut3');
if ($statut==3) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusNotSignedShort'),'statut5'); if ($statut==3) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($langs->trans('PropalStatusNotSignedShort'),'statut5');
if ($statut==4) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusBilledShort'),'statut6'); if ($statut==4) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($langs->trans('PropalStatusBilledShort'),'statut6');
} }
} }
@ -2640,7 +2672,7 @@ class PropaleLigne
var $localtax2_tx; var $localtax2_tx;
var $total_localtax1; var $total_localtax1;
var $total_localtax2; var $total_localtax2;
var $date_start; var $date_start;
var $date_end; var $date_end;
@ -2713,7 +2745,7 @@ class PropaleLigne
$this->libelle = $objp->product_label; // deprecated $this->libelle = $objp->product_label; // deprecated
$this->product_label = $objp->product_label; $this->product_label = $objp->product_label;
$this->product_desc = $objp->product_desc; $this->product_desc = $objp->product_desc;
$this->date_start = $this->db->jdate($objp->date_start); $this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end); $this->date_end = $this->db->jdate($objp->date_end);
@ -2751,6 +2783,7 @@ class PropaleLigne
if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;
@ -2767,7 +2800,8 @@ class PropaleLigne
// Insert line into database // Insert line into database
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'propaldet'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'propaldet';
$sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type, fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,'; $sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type,';
$sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,';
$sql.= ' subprice, remise_percent, '; $sql.= ' subprice, remise_percent, ';
$sql.= ' info_bits, '; $sql.= ' info_bits, ';
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang,'; $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang,';
@ -2785,13 +2819,13 @@ class PropaleLigne
$sql.= " ".price2num($this->localtax2_tx).","; $sql.= " ".price2num($this->localtax2_tx).",";
$sql.= " ".($this->subprice?price2num($this->subprice):'null').","; $sql.= " ".($this->subprice?price2num($this->subprice):'null').",";
$sql.= " ".price2num($this->remise_percent).","; $sql.= " ".price2num($this->remise_percent).",";
$sql.= " '".$this->info_bits."',"; $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
$sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_ht).",";
$sql.= " ".price2num($this->total_tva).","; $sql.= " ".price2num($this->total_tva).",";
$sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax1).",";
$sql.= " ".price2num($this->total_localtax2).","; $sql.= " ".price2num($this->total_localtax2).",";
$sql.= " ".price2num($this->total_ttc).","; $sql.= " ".price2num($this->total_ttc).",";
$sql.= " ".(isset($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").",";
$sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").","; $sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").",";
$sql.= ' '.$this->special_code.','; $sql.= ' '.$this->special_code.',';
$sql.= ' '.$this->rang.','; $sql.= ' '.$this->rang.',';
@ -2891,6 +2925,7 @@ class PropaleLigne
if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_parent_line)) $this->fk_fournprice=0;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;
@ -2923,8 +2958,8 @@ class PropaleLigne
$sql.= " , total_localtax1=".price2num($this->total_localtax1).""; $sql.= " , total_localtax1=".price2num($this->total_localtax1)."";
$sql.= " , total_localtax2=".price2num($this->total_localtax2).""; $sql.= " , total_localtax2=".price2num($this->total_localtax2)."";
} }
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null");
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; $sql.= " , buy_price_ht=".price2num($this->pa_ht);
if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code; if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code;
$sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); $sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
if (! empty($this->rang)) $sql.= ", rang=".$this->rang; if (! empty($this->rang)) $sql.= ", rang=".$this->rang;

View File

@ -184,7 +184,7 @@ if (! empty($conf->propal->enabled))
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<td nowrap="nowrap">'.$propalstatic->getNomUrl(1).'</td>'; print '<td class="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->socname; $companystatic->name=$obj->socname;
@ -242,17 +242,17 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td width="20%" nowrap="nowrap">'; print '<td width="20%" class="nowrap">';
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
@ -321,16 +321,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Ref // Ref
print '<td nowrap="nowrap" width="140">'; print '<td class="nowrap" width="140">';
$propalstatic->id=$obj->propalid; $propalstatic->id=$obj->propalid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="18" class="nobordernopadding" nowrap="nowrap">'; print '<td width="18" class="nobordernopadding nowrap">';
if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td width="16" align="center" class="nobordernopadding">'; print '<td width="16" align="center" class="nobordernopadding">';
@ -403,17 +403,17 @@ if (! empty($conf->propal->enabled))
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
@ -475,17 +475,17 @@ if (! empty($conf->propal->enabled))
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td width="20%" nowrap="nowrap">'; print '<td width="20%" class="nowrap">';
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';

View File

@ -131,7 +131,7 @@ if (! $sortfield) $sortfield='p.datep';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$sql = 'SELECT s.nom, s.rowid, s.client, '; $sql = 'SELECT s.rowid, s.nom, s.client, ';
$sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; $sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login'; $sql.= ' u.login';
@ -301,17 +301,17 @@ if ($result)
$now = dol_now(); $now = dol_now();
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$objectstatic->id=$objp->propalid; $objectstatic->id=$objp->propalid;
$objectstatic->ref=$objp->ref; $objectstatic->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $objectstatic->getNomUrl(1); print $objectstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; print '<td width="20" class="nobordernopadding nowrap">';
if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
@ -333,7 +333,7 @@ if ($result)
print '</td>'; print '</td>';
// Customer ref // Customer ref
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print $objp->ref_client; print $objp->ref_client;
print '</td>'; print '</td>';

View File

@ -402,12 +402,12 @@ if ($resql)
print $prospectstatic->getLibProspLevel(); print $prospectstatic->getLibProspLevel();
print "</td>"; print "</td>";
// Statut // Statut
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print $prospectstatic->LibProspStatut($obj->fk_stcomm,2); print $prospectstatic->LibProspStatut($obj->fk_stcomm,2);
print "</td>"; print "</td>";
//$sts = array(-1,0,1,2,3); //$sts = array(-1,0,1,2,3);
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
foreach ($sts as $key => $value) foreach ($sts as $key => $value)
{ {
if ($value <> $obj->fk_stcomm) if ($value <> $obj->fk_stcomm)

View File

@ -323,7 +323,7 @@ if ($socid > 0)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="120" align="left">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM print '<td width="120" align="left">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>'; print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>';
print '<td width="150" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>'; print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
@ -342,7 +342,7 @@ if ($socid > 0)
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if ($obj->description == '(CREDIT_NOTE)') if ($obj->description == '(CREDIT_NOTE)')
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
@ -351,7 +351,7 @@ if ($socid > 0)
} }
elseif ($obj->description == '(DEPOSIT)') elseif ($obj->description == '(DEPOSIT)')
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
@ -364,7 +364,7 @@ if ($socid > 0)
print $obj->description; print $obj->description;
print '</td>'; print '</td>';
} }
print '<td nowrap="nowrap">'.$langs->trans("NotConsumed").'</td>'; print '<td class="nowrap">'.$langs->trans("NotConsumed").'</td>';
print '<td align="right">'.price($obj->amount_ht).'</td>'; print '<td align="right">'.price($obj->amount_ht).'</td>';
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>'; print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
print '<td align="right">'.price($obj->amount_ttc).'</td>'; print '<td align="right">'.price($obj->amount_ttc).'</td>';
@ -373,7 +373,7 @@ if ($socid > 0)
print '</td>'; print '</td>';
if ($user->rights->societe->creer || $user->rights->facture->creer) if ($user->rights->societe->creer || $user->rights->facture->creer)
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&amp;action=split&amp;remid='.$obj->rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&amp;action=split&amp;remid='.$obj->rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').'</a>';
print ' &nbsp; '; print ' &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&amp;action=remove&amp;remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&amp;action=remove&amp;remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
@ -459,7 +459,7 @@ if ($socid > 0)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="120" align="left">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM print '<td width="120" align="left">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>'; print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>';
print '<td width="150" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>'; print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
@ -499,7 +499,7 @@ if ($socid > 0)
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if ($obj->description == '(CREDIT_NOTE)') if ($obj->description == '(CREDIT_NOTE)')
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
@ -508,7 +508,7 @@ if ($socid > 0)
} }
elseif ($obj->description == '(DEPOSIT)') elseif ($obj->description == '(DEPOSIT)')
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
@ -521,7 +521,7 @@ if ($socid > 0)
print $obj->description; print $obj->description;
print '</td>'; print '</td>';
} }
print '<td align="left" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>'; print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>';
print '<td align="right">'.price($obj->amount_ht).'</td>'; print '<td align="right">'.price($obj->amount_ht).'</td>';
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>'; print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
print '<td align="right">'.price($obj->amount_ttc).'</td>'; print '<td align="right">'.price($obj->amount_ttc).'</td>';

View File

@ -761,7 +761,7 @@ class Commande extends CommonOrder
} }
} }
} }
if (! $error) if (! $error)
{ {
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
@ -933,7 +933,7 @@ class Commande extends CommonOrder
$line->rang = $object->lines[$i]->rang; $line->rang = $object->lines[$i]->rang;
$line->special_code = $object->lines[$i]->special_code; $line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line; $line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->date_start = $object->lines[$i]->date_start; $line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end; $line->date_end = $object->lines[$i]->date_end;
@ -1339,6 +1339,16 @@ class Commande extends CommonOrder
$this->lines = array(); $this->lines = array();
if ($this->statut == 0) $this->brouillon = 1; if ($this->statut == 0) $this->brouillon = 1;
// Retreive all extrafield for invoice
// fetch optionals attributes and labels
if(!class_exists('Extrafields'))
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (count($extralabels)>0) {
$this->fetch_optionals($this->id,$extralabels);
}
$this->db->free(); $this->db->free();
@ -1972,23 +1982,38 @@ class Commande extends CommonOrder
/** /**
* Return list of orders (eventuelly filtered on a user) into an array * Return list of orders (eventuelly filtered on a user) into an array
* *
* @param int $brouillon 0=non brouillon, 1=brouillon * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
* @param User $user Objet user de filtre * @param int $draft 0=not draft, 1=draft
* @param User $excluser Objet user to exclude
* @param int $socid Id third pary
* @param int $limit For pagination
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK * @return int -1 if KO, array with result if OK
*/ */
function liste_array($brouillon=0, $user='') function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC')
{ {
global $conf; global $conf,$user;
$ga = array(); $ga = array();
$sql = "SELECT s.nom, s.rowid, c.rowid, c.ref"; $sql = "SELECT s.rowid, s.nom as name, s.client,";
$sql.= " c.rowid as cid, c.ref";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.entity = ".$conf->entity; $sql.= " WHERE c.entity = ".$conf->entity;
$sql.= " AND c.fk_soc = s.rowid"; $sql.= " AND c.fk_soc = s.rowid";
if ($brouillon) $sql.= " AND c.fk_statut = 0"; if (! $user->rights->societe->client->voir && ! $socid) //restriction
if ($user) $sql.= " AND c.fk_user_author <> ".$user->id; {
$sql .= " ORDER BY c.date_commande DESC"; $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($draft) $sql.= " AND c.fk_statut = 0";
if (is_object($excluser)) $sql.= " AND c.fk_user_author <> ".$excluser->id;
$sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit,$offset);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
@ -2001,7 +2026,20 @@ class Commande extends CommonOrder
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->ref; if ($shortlist == 1)
{
$ga[$obj->cid] = $obj->ref;
}
else if ($shortlist == 2)
{
$ga[$obj->cid] = $obj->ref.' ('.$obj->name.')';
}
else
{
$ga[$i]['id'] = $obj->cid;
$ga[$i]['ref'] = $obj->ref;
$ga[$i]['name'] = $obj->name;
}
$i++; $i++;
} }
} }
@ -2382,6 +2420,17 @@ class Commande extends CommonOrder
// Delete linked contacts // Delete linked contacts
$res = $this->delete_linked_contact(); $res = $this->delete_linked_contact();
if ($res < 0) $error++; if ($res < 0) $error++;
// Remove extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
{
$result=$this->deleteExtraFields();
if ($result < 0)
{
$error++;
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
}
}
// On efface le repertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref); $comref = dol_sanitizeFileName($this->ref);
@ -2409,6 +2458,8 @@ class Commande extends CommonOrder
} }
} }
} }
} }
if (! $error) if (! $error)
@ -2557,12 +2608,12 @@ class Commande extends CommonOrder
} }
elseif ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5'); if ($statut==-1) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderCanceledShort').' </span>'.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0'); if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraftShort').' </span>'.img_picto($langs->trans('StatusOrderDraft'),'statut0');
if ($statut==1) return $langs->trans('StatusOrderValidatedShort').' '.img_picto($langs->trans('StatusOrderValidated'),'statut1'); if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidatedShort').' </span>'.img_picto($langs->trans('StatusOrderValidated'),'statut1');
if ($statut==2) return $langs->trans('StatusOrderSentShort').' '.img_picto($langs->trans('StatusOrderSent'),'statut3'); if ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSentShort').' </span>'.img_picto($langs->trans('StatusOrderSent'),'statut3');
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort').' '.img_picto($langs->trans('StatusOrderToBill'),'statut7'); if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBillShort').' </span>'.img_picto($langs->trans('StatusOrderToBill'),'statut7');
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6'); if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessedShort').' </span>'.img_picto($langs->trans('StatusOrderProcessed'),'statut6');
} }
} }
@ -2781,7 +2832,7 @@ class Commande extends CommonOrder
return -1; return -1;
} }
} }
/** /**
* Update value of extrafields on the proposal * Update value of extrafields on the proposal
* *
@ -2807,7 +2858,7 @@ class Commande extends CommonOrder
} }
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;
if (!$error) if (!$error)
{ {
return 1; return 1;
@ -2816,7 +2867,7 @@ class Commande extends CommonOrder
{ {
return -1; return -1;
} }
} }
/** /**

View File

@ -1,34 +1,34 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* \file htdocs/commande/fiche.php * \file htdocs/commande/fiche.php
* \ingroup commande * \ingroup commande
* \brief Page to show customer order * \brief Page to show customer order
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
@ -82,7 +82,7 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('commande'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
@ -1127,7 +1127,7 @@ else if ($action == 'print_file' AND $user->rights->printipp->use)
else if ($action == 'update_extras') else if ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from update form // Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label('commande'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
@ -1565,7 +1565,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print "</td></tr>"; print "</td></tr>";
// Conditions de reglement // Conditions de reglement
print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">'; print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$form->select_conditions_paiements($cond_reglement_id,'cond_reglement_id',-1,1); $form->select_conditions_paiements($cond_reglement_id,'cond_reglement_id',-1,1);
print '</td></tr>'; print '</td></tr>';
@ -1907,7 +1907,7 @@ else
// Ref commande client // Ref commande client
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">'; print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print $langs->trans('RefCustomer').'</td><td align="left">'; print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>'; print '</td>';
if ($action != 'refcustomer' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refcustomer&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>'; if ($action != 'refcustomer' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refcustomer&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';

View File

@ -195,7 +195,7 @@ if (! empty($conf->commande->enabled))
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>"; print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$i++; $i++;
@ -247,21 +247,21 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td width="20%" nowrap="nowrap">'; print '<td width="20%" class="nowrap">';
$commandestatic->id=$obj->rowid; $commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref; $commandestatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1); print $commandestatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
@ -316,21 +316,21 @@ if (! empty($conf->commande->enabled))
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap" width="20%">'; print '<td class="nowrap" width="20%">';
$commandestatic->id=$obj->rowid; $commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref; $commandestatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1); print $commandestatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
@ -387,21 +387,21 @@ if (! empty($conf->commande->enabled))
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td width="20%" nowrap="nowrap">'; print '<td width="20%" class="nowrap">';
$commandestatic->id=$obj->rowid; $commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref; $commandestatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1); print $commandestatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">'; print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;

View File

@ -304,26 +304,27 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$generic_commande->id=$objp->rowid; $generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref; $generic_commande->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut));
print '</td>'; print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; print '<td width="20" 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) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>'; print '</td>';
print '</tr></table>';
print '</td>'; print '</td>';
@ -333,18 +334,16 @@ if ($resql)
$companystatic->client=$objp->client; $companystatic->client=$objp->client;
print '<td>'; print '<td>';
print $companystatic->getNomUrl(1,'customer'); print $companystatic->getNomUrl(1,'customer');
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">';
// If module invoices enabled and user with invoice creation permissions // If module invoices enabled and user with invoice creation permissions
if (! empty($conf->facture->enabled)) if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0))
{ {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">';
print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom,'object_bill').'</a>'; print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmrtphone').'</a>';
} }
} }
} }
@ -375,10 +374,10 @@ if ($resql)
print '</td>'; print '</td>';
// Amount HT // Amount HT
print '<td align="right" nowrap="nowrap">'.price($objp->total_ht).'</td>'; print '<td align="right" class="nowrap">'.price($objp->total_ht).'</td>';
// Statut // Statut
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>'; print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
print '</tr>'; print '</tr>';
@ -391,10 +390,10 @@ if ($resql)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap" colspan="5">'.$langs->trans('TotalHT').'</td>'; print '<td class="nowrap" colspan="5">'.$langs->trans('TotalHT').'</td>';
// Total HT // Total HT
print '<td align="right" nowrap="nowrap">'.price($total).'</td>'; print '<td align="right" class="nowrap">'.price($total).'</td>';
print '<td nowrap="nowrap">&nbsp;</td>'; print '<td class="nowrap">&nbsp;</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -607,21 +607,21 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$generic_commande->id=$objp->rowid; $generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref; $generic_commande->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut); print $generic_commande->getNomUrl(1,$objp->fk_statut);
print '</td>'; print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; print '<td width="20" 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) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
@ -642,7 +642,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
print '</td>'; print '</td>';
// Statut // Statut
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>'; print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
// Checkbox // Checkbox
print '<td align="center">'; print '<td align="center">';

View File

@ -351,10 +351,10 @@ if ($id > 0 || ! empty($ref))
print '</tr>'; print '</tr>';
print '<tr '.$bc[false].'>'; print '<tr '.$bc[false].'>';
print '<td nowrap="nowrap" colspan="2">'; print '<td class="nowrap" colspan="2">';
$form->select_date($dateop,'op',0,0,0,'transaction'); $form->select_date($dateop,'op',0,0,0,'transaction');
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == 2 ? 'LIQ' : '')),'operation','1,2',2,1); $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == 2 ? 'LIQ' : '')),'operation','1,2',2,1);
print '</td><td>'; print '</td><td>';
print '<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST("num_chq").'"></td>'; print '<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST("num_chq").'"></td>';
@ -505,9 +505,9 @@ if ($id > 0 || ! empty($ref))
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n"; print '<td class="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day"); print '<td class="nowrap">'.dol_print_date($db->jdate($objp->dv),"day");
print "</td>\n"; print "</td>\n";
// Payment type // Payment type
@ -636,11 +636,11 @@ if ($id > 0 || ! empty($ref))
// Amount // Amount
if ($objp->amount < 0) if ($objp->amount < 0)
{ {
print '<td align="right" nowrap="nowrap">'.price($objp->amount * -1).'</td><td>&nbsp;</td>'."\n"; print '<td align="right" class="nowrap">'.price($objp->amount * -1).'</td><td>&nbsp;</td>'."\n";
} }
else else
{ {
print '<td>&nbsp;</td><td align="right" nowrap="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n"; print '<td>&nbsp;</td><td align="right" class="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n";
} }
// Balance // Balance

View File

@ -974,7 +974,7 @@ class Account extends CommonObject
$country_code=$this->getCountryCode(); $country_code=$this->getCountryCode();
if (in_array($country_code,array('CH','DE','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon if (in_array($country_code,array('CH','DE','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon
if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','US'))) return 2; // Australia, Great Britain... if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, Great Britain...
return 0; return 0;
} }

View File

@ -238,10 +238,10 @@ if ($resql)
print '<td align="center">'.$langs->trans("DateValueShort").'</td>'; print '<td align="center">'.$langs->trans("DateValueShort").'</td>';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td align="right" width="60" nowrap="nowrap">'.$langs->trans("Debit").'</td>'; print '<td align="right" width="60" class="nowrap">'.$langs->trans("Debit").'</td>';
print '<td align="right" width="60" nowrap="nowrap">'.$langs->trans("Credit").'</td>'; print '<td align="right" width="60" class="nowrap">'.$langs->trans("Credit").'</td>';
print '<td align="center" width="80">'.$langs->trans("Action").'</td>'; print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
print '<td align="center" width="60" nowrap="nowrap">'.$langs->trans("ToConciliate").'</td>'; print '<td align="center" width="60" class="nowrap">'.$langs->trans("ToConciliate").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -258,12 +258,12 @@ if ($resql)
// print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">"; // print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
// Date op // Date op
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day").'</td>'; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->do),"day").'</td>';
// Date value // Date value
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print '<span id="datevalue_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->dv),"day")."</span>"; print '<span id="datevalue_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->dv),"day")."</span>";
print ' <span>&nbsp; '; print ' <span>&nbsp; ';
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">'; print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">';
@ -282,7 +282,7 @@ if ($resql)
// Type + Number // Type + Number
$label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code $label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code
if ($label=='SOLD') $label=''; if ($label=='SOLD') $label='';
print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>'; print '<td class="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
// Description // Description
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">'; print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';
@ -390,7 +390,7 @@ if ($resql)
// If not already reconciliated // If not already reconciliated
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
print '<td align="center" width="30" nowrap="nowrap">'; print '<td align="center" width="30" class="nowrap">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'&amp;orig_account='.$acct->id.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'&amp;orig_account='.$acct->id.'">';
print img_edit(); print img_edit();
@ -418,7 +418,7 @@ if ($resql)
if ($db->jdate($objp->do) <= $now) if ($db->jdate($objp->do) <= $now)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" class="nowrap">';
print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(! empty($_POST['rowid'][$objp->rowid])?' checked="checked"':'').'>'; print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(! empty($_POST['rowid'][$objp->rowid])?' checked="checked"':'').'>';
// print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">'; // print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">';
// print ' &nbsp; '; // print ' &nbsp; ';

View File

@ -281,10 +281,10 @@ else
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Date operation // Date operation
print '<td nowrap="nowrap" align="center">'.dol_print_date($db->jdate($objp->do),"day").'</td>'; print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->do),"day").'</td>';
// Date de valeur // Date de valeur
print '<td align="center" valign="center" nowrap="nowrap">'; print '<td align="center" valign="center" class="nowrap">';
print '<a href="releve.php?action=dvprev&amp;num='.$num.'&amp;account='.$acct->id.'&amp;dvid='.$objp->rowid.'">'; print '<a href="releve.php?action=dvprev&amp;num='.$num.'&amp;account='.$acct->id.'&amp;dvid='.$objp->rowid.'">';
print img_previous().'</a> '; print img_previous().'</a> ';
print dol_print_date($db->jdate($objp->dv),"day") .' '; print dol_print_date($db->jdate($objp->dv),"day") .' ';
@ -293,7 +293,7 @@ else
print "</td>\n"; print "</td>\n";
// Num cheque // Num cheque
print '<td nowrap="nowrap">'.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').'</td>'; print '<td class="nowrap">'.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').'</td>';
// Libelle // Libelle
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">'; print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';

View File

@ -209,15 +209,15 @@ if ($resql)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Ref // Ref
print '<td align="left" nowrap="nowrap">'; print '<td align="left" class="nowrap">';
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> &nbsp; "; print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> &nbsp; ";
print '</td>'; print '</td>';
// Date ope // Date ope
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n"; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
// Date value // Date value
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n"; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
// Payment type // Payment type
print "<td align=\"center\">"; print "<td align=\"center\">";
@ -266,7 +266,7 @@ if ($resql)
} }
// Bank account // Bank account
print '<td align="left" nowrap="nowrap">'; print '<td align="left" class="nowrap">';
$bankaccountstatic->id=$objp->bankid; $bankaccountstatic->id=$objp->bankid;
$bankaccountstatic->label=$objp->bankref; $bankaccountstatic->label=$objp->bankref;
print $bankaccountstatic->getNomUrl(1); print $bankaccountstatic->getNomUrl(1);

View File

@ -205,7 +205,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
$total = 0 ; $total = 0 ;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="120" nowrap="nowrap">'.$langs->trans("PeriodEndDate").'</td>'; print '<td width="120" class="nowrap">'.$langs->trans("PeriodEndDate").'</td>';
print "<td>".$langs->trans("Label")."</td>"; print "<td>".$langs->trans("Label")."</td>";
print '<td align="right" width="10%">'.$langs->trans("ExpectedToPay")."</td>"; print '<td align="right" width="10%">'.$langs->trans("ExpectedToPay")."</td>";
print '<td align="right" width="10%">'.$langs->trans("RefPayment")."</td>"; print '<td align="right" width="10%">'.$langs->trans("RefPayment")."</td>";

View File

@ -175,7 +175,7 @@ if ($resql)
$donation_static->id=$obj->rowid; $donation_static->id=$obj->rowid;
$donation_static->ref=$obj->ref?$obj->ref:$obj->rowid; $donation_static->ref=$obj->ref?$obj->ref:$obj->rowid;
print '<td width="96" class="nobordernopadding" nowrap="nowrap">'; print '<td width="96" class="nobordernopadding nowrap">';
print $donation_static->getNomUrl(1); print $donation_static->getNomUrl(1);
print '</td>'; print '</td>';
@ -185,7 +185,7 @@ if ($resql)
print dolGetFirstLastname($obj->nom,$obj->firstname); print dolGetFirstLastname($obj->nom,$obj->firstname);
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td align="right" class="nobordernopadding">';
print price($obj->amount,1); print price($obj->amount,1);
print '</td>'; print '</td>';

View File

@ -49,6 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->load('bills'); $langs->load('bills');
$langs->load('companies'); $langs->load('companies');
$langs->load('products'); $langs->load('products');
$langs->load('banks');
$langs->load('main'); $langs->load('main');
if (! empty($conf->margin->enabled)) $langs->load('margins'); if (! empty($conf->margin->enabled)) $langs->load('margins');
@ -655,14 +656,10 @@ else if ($action == 'add' && $user->rights->facture->creer)
$error=0; $error=0;
// Get extra fields // Fill array 'array_options' with data from add form
foreach($_POST as $key => $value) $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
{ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if (preg_match("/^options_/",$key))
{
$object->array_options[$key]=GETPOST($key);
}
}
// Replacement invoice // Replacement invoice
if ($_POST['type'] == 1) if ($_POST['type'] == 1)
@ -878,17 +875,17 @@ else if ($action == 'add' && $user->rights->facture->creer)
if ($_POST['type'] == 3) { if ($_POST['type'] == 3) {
$typeamount=GETPOST('typedeposit','alpha'); $typeamount=GETPOST('typedeposit','alpha');
$valuedeposit=GETPOST('valuedeposit','int'); $valuedeposit=GETPOST('valuedeposit','int');
if ($typeamount=='amount') { if ($typeamount=='amount') {
$amountdeposit=$valuedeposit; $amountdeposit=$valuedeposit;
}else { }else {
$amountdeposit=0; $amountdeposit=0;
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
$classname = ucfirst($subelement); $classname = ucfirst($subelement);
$srcobject = new $classname($db); $srcobject = new $classname($db);
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit line"); dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit line");
$result=$srcobject->fetch($object->origin_id); $result=$srcobject->fetch($object->origin_id);
if ($result > 0) if ($result > 0)
@ -900,7 +897,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
{ {
$totalamount=+$lines[$i]->subprice; $totalamount=+$lines[$i]->subprice;
} }
if ($totalamount!=0) { if ($totalamount!=0) {
$amountdeposit=($totalamount*$valuedeposit)/100; $amountdeposit=($totalamount*$valuedeposit)/100;
} }
@ -910,9 +907,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
$mesgs[]=$srcobject->error; $mesgs[]=$srcobject->error;
$error++; $error++;
} }
} }
$result = $object->addline( $result = $object->addline(
$id, $id,
$langs->trans('Deposit'), $langs->trans('Deposit'),
@ -940,7 +937,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
0, 0,
$langs->trans('Deposit') $langs->trans('Deposit')
); );
}else { }else {
@ -1859,7 +1856,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture-
if ($action == 'update_extras') if ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label('facture'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
@ -1896,7 +1893,6 @@ $now=dol_now();
llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
/********************************************************************* /*********************************************************************
* *
* Mode creation * Mode creation
@ -1905,7 +1901,7 @@ llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES
if ($action == 'create') if ($action == 'create')
{ {
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$extralabels=$extrafields->fetch_name_optionals_label('facture'); $extralabels=$extrafields->fetch_name_optionals_label($facturestatic->table_element);
print_fiche_titre($langs->trans('NewBill')); print_fiche_titre($langs->trans('NewBill'));
@ -2117,7 +2113,7 @@ if ($action == 'create')
// Deposit // Deposit
print '<tr height="18"><td width="16px" valign="middle">'; print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="3"'.(GETPOST('type')==3?' checked="checked"':'').'>'; print '<input type="radio" name="type" value="3"'.(GETPOST('type')==3?' checked="checked"':'').'>';
print '</td><td valign="middle" nowrap="nowrap">'; print '</td><td valign="middle" class="nowrap">';
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>'; print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>';
if (($origin=='propal') ) { if (($origin=='propal') ) {
@ -2293,8 +2289,9 @@ if ($action == 'create')
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
$newclassname=$classname; $newclassname=$classname;
if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; if ($newclassname == 'Propal') $newclassname = 'CommercialProposal';
elseif ($newclassname == 'Commande') $newclassname = 'Order'; elseif ($newclassname == 'Commande') $newclassname = 'Order';
elseif ($newclassname == 'Expedition') $newclassname = 'Sending';
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>'; print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
@ -2340,21 +2337,21 @@ if ($action == 'create')
$form->select_produits('','idprod'.$i,'',$conf->product->limit_size); $form->select_produits('','idprod'.$i,'',$conf->product->limit_size);
print '</td>'; print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>'; print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>'; print '<td class="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
// Si le module service est actif, on propose des dates de debut et fin a la ligne // Si le module service est actif, on propose des dates de debut et fin a la ligne
if (! empty($conf->service->enabled)) if (! empty($conf->service->enabled))
{ {
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $langs->trans('From').' '; print $langs->trans('From').' ';
print '</td><td class="nobordernopadding" nowrap="nowrap">'; print '</td><td class="nobordernopadding nowrap">';
print $form->select_date('','date_start'.$i,$usehm,$usehm,1,"add"); print $form->select_date('','date_start'.$i,$usehm,$usehm,1,"add");
print '</td></tr>'; print '</td></tr>';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $langs->trans('to').' '; print $langs->trans('to').' ';
print '</td><td class="nobordernopadding" nowrap="nowrap">'; print '</td><td class="nobordernopadding nowrap">';
print $form->select_date('','date_end'.$i,$usehm,$usehm,1,"add"); print $form->select_date('','date_end'.$i,$usehm,$usehm,1,"add");
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -2399,7 +2396,7 @@ else if ($id > 0 || ! empty($ref))
$result=$object->fetch($id,$ref); $result=$object->fetch($id,$ref);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('facture'); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
if ($result > 0) if ($result > 0)
{ {
@ -2449,7 +2446,6 @@ else if ($id > 0 || ! empty($ref))
$objectidnext=$object->getIdReplacingInvoice(); $objectidnext=$object->getIdReplacingInvoice();
$head = facture_prepare_head($object); $head = facture_prepare_head($object);
dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill');
@ -2691,6 +2687,8 @@ else if ($id > 0 || ! empty($ref))
print $formconfirm; print $formconfirm;
// Invoice content // Invoice content
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -2878,13 +2876,13 @@ else if ($id > 0 || ! empty($ref))
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')<br>'; if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')<br>';
else print '. '; else print '. ';
} }
/*if ($object->statut == 0 && $object->type != 2 && $object->type != 3) //if ($object->statut == 0 && $object->type != 2 && $object->type != 3)
{ // {
if (! $absolute_discount && ! $absolute_creditnote) print '<br>'; //if (! $absolute_discount && ! $absolute_creditnote) print '<br>';
//print ' &nbsp; - &nbsp; '; //print ' &nbsp; - &nbsp; ';
print $addabsolutediscount; //print $addabsolutediscount;
//print ' &nbsp; - &nbsp; '.$addcreditnote; // We disbale link to credit note //print ' &nbsp; - &nbsp; '.$addcreditnote; // We disbale link to credit note
}*/ //}
print '</td></tr>'; print '</td></tr>';
// Date invoice // Date invoice
@ -2914,9 +2912,7 @@ else if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
/* // List of payments
* List of payments
*/
$sign=1; $sign=1;
if ($object->type == 2) $sign=-1; if ($object->type == 2) $sign=-1;
@ -3090,7 +3086,7 @@ else if ($id > 0 || ! empty($ref))
else print $langs->trans('ExcessReceived'); else print $langs->trans('ExcessReceived');
print ' :</td>'; print ' :</td>';
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayeraffiche).'</b></td>'; print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayeraffiche).'</b></td>';
print '<td nowrap="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
} }
else // Credit note else // Credit note
{ {
@ -3108,7 +3104,7 @@ else if ($id > 0 || ! empty($ref))
else print $langs->trans('ExcessPaydBack'); else print $langs->trans('ExcessPaydBack');
print ' :</td>'; print ' :</td>';
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * $resteapayeraffiche).'</b></td>'; print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * $resteapayeraffiche).'</b></td>';
print '<td nowrap="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
// Sold credit note // Sold credit note
//print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>'; //print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
@ -3358,9 +3354,7 @@ else if ($id > 0 || ! empty($ref))
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
} }
/* // Lines
* Lines
*/
$result = $object->getLinesArray(); $result = $object->getLinesArray();
if (! empty($conf->use_javascript_ajax) && $object->statut == 0) if (! empty($conf->use_javascript_ajax) && $object->statut == 0)
@ -3374,9 +3368,7 @@ else if ($id > 0 || ! empty($ref))
if (! empty($object->lines)) if (! empty($object->lines))
$ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1); $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1);
/* // Form to add new line
* Form to add new line
*/
if ($object->statut == 0 && $user->rights->facture->creer && $action <> 'valid' && $action <> 'editline') if ($object->statut == 0 && $user->rights->facture->creer && $action <> 'valid' && $action <> 'editline')
{ {
$var=true; $var=true;
@ -3408,9 +3400,7 @@ else if ($id > 0 || ! empty($ref))
print "</div>\n"; print "</div>\n";
/* // Boutons actions
* Boutons actions
*/
if ($action != 'prerelance' && $action != 'presend') if ($action != 'prerelance' && $action != 'presend')
{ {
@ -3623,12 +3613,9 @@ else if ($id > 0 || ! empty($ref))
if ($action != 'prerelance' && $action != 'presend') if ($action != 'prerelance' && $action != 'presend')
{ {
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">'; print '<a name="builddoc"></a>'; // ancre
//print '<a name="builddoc"></a>'; // ancre
/* // Documents generes
* Documents generes
*/
$filename=dol_sanitizeFileName($object->ref); $filename=dol_sanitizeFileName($object->ref);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id; $urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id;
@ -3638,9 +3625,7 @@ else if ($id > 0 || ! empty($ref))
print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
$somethingshown=$formfile->numoffiles; $somethingshown=$formfile->numoffiles;
/* // Linked object block
* Linked object block
*/
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
// Link for paypal payment // Link for paypal payment
@ -3651,14 +3636,12 @@ else if ($id > 0 || ! empty($ref))
} }
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice',$socid); $somethingshown=$formactions->showactions($object,'invoice',$socid);
//print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
} }
else else

View File

@ -43,7 +43,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha'); $attrname=GETPOST('attrname', 'alpha');
$elementtype='facture'; $elementtype='facture'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();

View File

@ -879,13 +879,9 @@ class Facture extends CommonInvoice
if(!class_exists('Extrafields')) if(!class_exists('Extrafields'))
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db); $extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label('facture',true); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (count($extralabels)>0) { if (count($extralabels)>0) {
$this->array_options = array(); $this->fetch_optionals($this->id,$extralabels);
}
foreach($extrafields->attribute_label as $key=>$label)
{
$this->array_options['options_'.$key]=$label;
} }
/* /*
@ -1302,7 +1298,7 @@ class Facture extends CommonInvoice
{ {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
$num=count($this->lines); $num=count($this->lines);
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
@ -2664,6 +2660,80 @@ class Facture extends CommonInvoice
} }
/**
* Return list of invoices (eventually filtered on a user) into an array
*
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
* @param int $draft 0=not draft, 1=draft
* @param User $excluser Objet user to exclude
* @param int $socid Id third pary
* @param int $limit For pagination
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK
*/
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
{
global $conf,$user;
$ga = array();
$sql = "SELECT s.rowid, s.nom as name, s.client,";
$sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid";
if (! $user->rights->societe->client->voir && ! $socid) //restriction
{
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($draft) $sql.= " AND f.fk_statut = 0";
if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id;
$sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit,$offset);
$result=$this->db->query($sql);
if ($result)
{
$numc = $this->db->num_rows($result);
if ($numc)
{
$i = 0;
while ($i < $numc)
{
$obj = $this->db->fetch_object($result);
if ($shortlist == 1)
{
$ga[$obj->fid] = $obj->ref;
}
else if ($shortlist == 2)
{
$ga[$obj->fid] = $obj->ref.' ('.$obj->name.')';
}
else
{
$ga[$i]['id'] = $obj->fid;
$ga[$i]['ref'] = $obj->ref;
$ga[$i]['name'] = $obj->name;
}
$i++;
}
}
return $ga;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/** /**
* Renvoi liste des factures remplacables * Renvoi liste des factures remplacables
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee

View File

@ -227,7 +227,7 @@ if ($search_societe) $sql .= " AND s.nom LIKE '%".$search_societe."%'";
if ($search_montant_ht) $sql .= " AND f.total = '".$search_montant_ht."'"; 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_montant_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'";
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
$sql.= " GROUP BY f.facnumber,f.increment,f.total,f.total_ttc,f.datef, f.date_lim_reglement,f.paye, f.rowid, f.fk_statut, f.type,s.nom, s.rowid"; $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 "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " ORDER BY "; $sql.= " ORDER BY ";
$listfield=explode(',',$sortfield); $listfield=explode(',',$sortfield);
@ -332,7 +332,7 @@ if ($resql)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
$classname = "impayee"; $classname = "impayee";
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$objp->facid; $facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber; $facturestatic->ref=$objp->facnumber;
@ -341,17 +341,17 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Ref // Ref
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1);
print '</td>'; print '</td>';
// Warning picto // Warning picto
print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; print '<td width="20" class="nobordernopadding nowrap">';
if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
// PDF Picto // PDF Picto
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($objp->facnumber); $filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
@ -380,12 +380,12 @@ if ($resql)
if (! empty($objp->am) && ! empty($cn)) print '+'; if (! empty($objp->am) && ! empty($cn)) print '+';
if (! empty($cn)) print price($cn); if (! empty($cn)) print price($cn);
print '</td>'; print '</td>';
// Remain to receive // Remain to receive
//print '<td align="right">'.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):'&nbsp;').'</td>'; //print '<td align="right">'.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):'&nbsp;').'</td>';
// Status of invoice // Status of invoice
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
print '</td>'; print '</td>';

View File

@ -209,7 +209,7 @@ if ($search_user > 0)
} }
if (! $sall) if (! $sall)
{ {
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,'; $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total,f.tva, f.total_ttc,';
$sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.datef, f.date_lim_reglement,';
$sql.= ' f.paye, f.fk_statut,'; $sql.= ' f.paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid'; $sql.= ' s.nom, s.rowid';
@ -322,7 +322,7 @@ if ($resql)
$datelimit=$db->jdate($objp->datelimite); $datelimit=$db->jdate($objp->datelimite);
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$objp->facid; $facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber; $facturestatic->ref=$objp->facnumber;
@ -332,12 +332,12 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">'; print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1,'',200,0,$notetoshow); print $facturestatic->getNomUrl(1,'',200,0,$notetoshow);
print $objp->increment; print $objp->increment;
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($objp->facnumber); $filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
@ -377,7 +377,7 @@ if ($resql)
print '<td align="right">'.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):'&nbsp;').'</td>'; print '<td align="right">'.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):'&nbsp;').'</td>';
// Affiche statut de la facture // Affiche statut de la facture
print '<td align="right" nowrap="nowrap">'; print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type); print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type);
print "</td>"; print "</td>";
//print "<td>&nbsp;</td>"; //print "<td>&nbsp;</td>";

View File

@ -54,7 +54,8 @@ $endyear=$year;
* View * View
*/ */
$langs->load("bills"); $langs->load("bills");
$langs->load("companies");
$form=new Form($db); $form=new Form($db);

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