diff --git a/ChangeLog b/ChangeLog index c4b8ccf1e55..3f6221ac9c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3.2 ***** For users: +- New: Can use ODS templates as document templates. - New: Add link to autofill/reset with quantity to ship when creating a delivery receipt. - 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: Some performance enhancements. - 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: Add ES formated address country rule. -- New: Can define a hierarchical responsible on user. -- New: Add a hierarchical view for users. +- New: Can define a hierarchical responsible on user and add a tree view to + see hierarchy of users. - New: Can expand/collapse menus, categories and users list. -- New: extra parameters are supported into ODT templates. -- New: total per vat rate are available as tags for ODT templates. -- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices). +- New: extra parameters are supported into ODT/ODS templates. +- New: total per vat rate are available as tags for ODT/ODS templates. - 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 a default choice for choice "More action when recording - a subscription" (foundation module). -- New: Add link to check professional id for india. +- New: Can define a default choice for "More action when recording a + subscription" (foundation module). +- New: Add link to check professional id for India. - New: [ task #731 ] Uniformize ref generation - New: [ task #748 ] Add a link "Dolibarr" into left menu -- New: Script email_unpaid_invoices_to_representative accepts now a parameter test - and a delay. -- New: Can define a different clicktodial setup per user. -- New: Add option INVOICE_CAN_NEVER_BE_REMOVED. -- New: Enhance agenda module to reach RFC2445 (add busy information). +- New: Script email_unpaid_invoices_to_representative accepts now a parameter "test" + and a "late delay". +- New: Can define different clicktodial setups for each user. +- New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED. +- New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add + "busy" information). - 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. -- New: [ task #350 ] Merge tab customer and prospect -- 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 #714 ] In Emailing module admin autogenerate security key of READRECIEPT -- New: [ task #743 ] GED : Add aministration option to disabled autotree to display -- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address -- New: [ task #768 ] WYSIWYG for all mail -- New: [ task #773 ] Add Project document in GED(ECM) modules -- New: [ task #783 ] Add checkbox and radio into extrafield feature -- New: [ task #798 ] Add range limit date on product/services as it is done on order and invoice -- New: [ task #814 ] Add extrafield feature into Project/project tasks module -- New: [ task #770 ] Add ODT document generation for Projects module -- 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 +- New: [ task #350 ] Merge tab customer and prospect. +- 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 #714 ] In Emailing module admin autogenerate security key of READRECEIPT. +- 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 #768 ] WYSIWYG for all mails. +- New: [ task #773 ] Add Project document in GED(ECM) modules. +- New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox, + prices, radio). +- New: [ task #798 ] Add range limit date on product/services as it is done on order + and invoice. +- New: [ task #814 ] Add extrafield feature for projects ands tasks. +- New: [ task #770 ] Add ODT document generation for Projects module. +- 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: - Update language files. @@ -60,8 +63,8 @@ For developers: - An external module can force its theme. - Add function dol_set_focus('#xxx'). - A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file. -- Removed not used libraries. -- More web services. +- Removed some not used libraries. +- More web services. - Renamed some database fields, code variables and parameters from french to english. - First change to manage margins on contracts. - 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 ***** - 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 - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger - 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: 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 #787 ] Invoice supplier box incorrect tooltip when delay on payment - 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 #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 #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 ***** diff --git a/build/debian/README.howto b/build/debian/README.howto index 9c3dbc9ad07..797e653bc27 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -13,7 +13,7 @@ with format .DEB (for Debian, Ubuntu, ...). # 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 # 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. - 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 - Call for a mentor on ML debian-mentors to upload packages diff --git a/build/debian/changelog b/build/debian/changelog index 8a995f9f778..17a361e4ae0 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -4,6 +4,6 @@ dolibarr (3.4.0+nmu1) unstable; urgency=low * New upstream release. closes: bug#634783 - -- Dolibarr team Sat, 2 Mar 2013 12:00:00 +0100 + -- Dolibarr team Mon, 22 Apr 2013 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz diff --git a/build/debian/po/fr.po b/build/debian/po/fr.po index a96cd360299..d23da598297 100755 --- a/build/debian/po/fr.po +++ b/build/debian/po/fr.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: 2011-07-29 22:45+0100\n" "Last-Translator: Laurent Destailleur \n" "Language-Team: Laurent Destailleur \n" @@ -27,13 +27,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "Seveur web à reconfigurer automatiquement:" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -44,14 +44,14 @@ msgstr "" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "Effacer la base de donnée et les fichiers uploadés ?" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "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 " diff --git a/build/debian/po/templates.pot b/build/debian/po/templates.pot old mode 100755 new mode 100644 index 8813bd2d45b..90b57278e04 --- a/build/debian/po/templates.pot +++ b/build/debian/po/templates.pot @@ -3,11 +3,12 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Project-Id-Version: dolibarr\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,13 +19,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -32,13 +33,13 @@ msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "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 " diff --git a/build/debian/rules b/build/debian/rules index 5a1cfdc8ecb..2ab8af290c1 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -111,6 +111,9 @@ clean: rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 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. rm -fr htdocs/includes/phpexcel/license.txt rm -f htdocs/includes/tcpdf/LICENSE.TXT @@ -118,4 +121,4 @@ clean: dh $@ binary-arch: - \ No newline at end of file + diff --git a/build/launchpad/README b/build/launchpad/README index 2334b01f1d7..0107c7d9537 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -28,6 +28,8 @@ a package onto LaunchPad - Edit file ~/.bashrc to add DEBFULLNAME="" DEBEMAIL="" +- Create a Bazaar directory + mkdir bzr If you want to build/test package locally: - Create a file ~/.pbuilderrc with content @@ -36,29 +38,42 @@ If you want to build/test package locally: sudo pbuilder create [--distribution sid|squeeze] -# Push/declare sources to Launchpad +# Push/declare Dolibarr sources to Launchpad #---------------------------------- - -- Create a series (https://launchpad.net/dolibarr/) - Call it 'dev', 'stable' or 'beta' - For dev: Configure Series branch - Link to series - For stable: Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz - For beta: Add file with *: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_3.2.*.tar.gz - mkdir bzr +- From Launchpad project (https://launchpad.net/dolibarr), register a series: + Call it 'trunk' or 'beta' or 'stable' + Use branch (dev): + ~eldy/dolibarr/develop + ~eldy/dolibarr/beta + ~eldy/dolibarr/stable + 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 add bzr commit -m "Init" + bzr push lp:~yourlogin/dolibarr/[beta|stable] -List of series created: -https://launchpad.net/dolibarr/trunk -https://launchpad.net/dolibarr/beta -https://launchpad.net/dolibarr/stable +- List of series are visible here: https://launchpad.net/dolibarr/+series -# 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] - mkdir bzr +# Init debian dir repository into launchpad (when repository for sources does not exist) +#---------------------------------- +- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] cd bzr mkdir debian cd debian @@ -67,27 +82,28 @@ https://launchpad.net/dolibarr/stable bzr add bzr commit -m "Init control files" 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 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 - 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) +# Get debian dir repository from launchpad (when repository for sources already exists) #---------------------------------- 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) #---------------------------------- - - Create a file dolibarr.recipe with content cd bzr vi dolibarr.recipe @@ -119,11 +135,11 @@ https://code.launchpad.net/~eldy/+recipe/dolibarr-stable # 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 > 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: deb 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-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main -Update your package cache: +- Update your package cache: > apt-get update -Install Dolibarr: +- Install Dolibarr: > apt-get install dolibarr - - - + diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 23d806bb72d..09952889c6f 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -658,6 +658,8 @@ if ($nboftargetok) { $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 {} \\; "; $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"; diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index fad028cfbf6..4847b0102ef 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -32,7 +32,7 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - 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 build/makepack-dolibarr.pl - Update version number with x.x.x in build/debian/changelog diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index e0197d82678..23cd2f19209 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # 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 diff --git a/build/rpm/README b/build/rpm/README index 6f2e6634f4b..ffdb6d24a53 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -26,8 +26,9 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...). # restorecon -R -v /file Restore values into files (cancel chcon, validate semanage) # # On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package +# zypper install dolibarr-...rpm To install package and dependencies +# zypper remove dolibarr To remove package +# zypper search xxx To search a package # # On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 95b3fc0f179..f805e7cf470 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -165,7 +165,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -187,8 +186,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index cee4ab9f6ec..1961ebbf161 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -241,7 +241,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -263,8 +262,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 62758af82b4..9c36baf79d9 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -162,7 +162,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -184,8 +183,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index eb2bbc859f4..99f7c94a986 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -173,7 +173,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -195,8 +194,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/install.forced.php.generic b/build/rpm/install.forced.php.generic index 0d8b1214ad1..718eade3696 100755 --- a/build/rpm/install.forced.php.generic +++ b/build/rpm/install.forced.php.generic @@ -18,4 +18,6 @@ $force_install_dolibarrlogin='admin'; $force_install_nophpinfo='1'; $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 ?> \ No newline at end of file diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse index 90c4d6ab182..06a0074b04d 100755 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -19,10 +19,10 @@ $force_install_nophpinfo='1'; $force_install_lockinstall='444'; // 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_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_PHPEXCEL_PATH=''; $force_dolibarr_lib_TCPDF_PATH=''; diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 5711b61c4ac..4bb936ba339 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -133,7 +133,7 @@ class modMyModule extends DolibarrModules $this->tabs = array(); // Dictionnaries - if (! isset($conf->mymodule->enabled)) + if (! isset($conf->mymodule->enabled)) { $conf->mymodule=new stdClass(); $conf->mymodule->enabled=0; @@ -158,14 +158,8 @@ class modMyModule extends DolibarrModules // Boxes // Add here list of php file(s) stored in core/boxes that contains class to show a box. $this->boxes = array(); // List of boxes - $r=0; // Example: - /* - $this->boxes[$r][1] = "myboxa.php"; - $r++; - $this->boxes[$r][1] = "myboxb.php"; - $r++; - */ + //$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>''));); // Permissions $this->rights = array(); // Permission array used by this module diff --git a/dev/test/testdiv.php b/dev/test/testdiv.php index 78917a8d940..8700be5b2ab 100644 --- a/dev/test/testdiv.php +++ b/dev/test/testdiv.php @@ -33,14 +33,14 @@   fds fs df sdf gdsfgsdf r   - + -     - +     + diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index ef986dacbbb..34420ee0121 100755 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='member'; +$elementtype='adherent'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 7873573ff34..ce2787752a7 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', '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(); diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 17a39148eba..cf5ed660a32 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -479,8 +479,6 @@ if ($rowid) { $res=$object->fetch($rowid); 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); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 13a6bdea810..b98b34ded05 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1095,6 +1095,15 @@ class Adherent extends CommonObject $this->user_id = $obj->user_id; $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 $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) { - if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); - elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); - else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); + if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); + elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); + else return ''.$langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); } - if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); } } diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index d829c5a84f9..69515671080 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class AdherentType extends CommonObject { public $table_element = 'adherent_type'; + public $element = 'adherent_type'; var $id; var $libelle; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 76b2b2d23f5..52f2c3fb13e 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -65,7 +65,7 @@ $object = new Adherent($db); $extrafields = new ExtraFields($db); // 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) $object->getCanvas($rowid); @@ -1403,7 +1403,7 @@ else print ''; // Zip / Town - print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.''; + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.''; // Country print ''.$langs->trans("Country").''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 27ddd052225..d4beb3ecdd9 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -304,7 +304,7 @@ if ($resql) // Type $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; - print ''; + print ''; print $membertypestatic->getNomUrl(1,32); print ''; @@ -315,21 +315,21 @@ if ($resql) print "".dol_print_email($objp->email,0,0,1)."\n"; // Statut - print ''; + print ''; print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print ""; // End of subscription date if ($datefin) { - print ''; + print ''; print dol_print_date($datefin,'day'); if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate")); print ''; } else { - print ''; + print ''; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 2120d2d2a83..d221619acf4 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -540,7 +540,7 @@ if ($rowid > 0) print "".$objp->login."\n"; // Type - /*print ''; + /*print ''; $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print $membertypestatic->getNomUrl(1,12); @@ -554,14 +554,14 @@ if ($rowid > 0) print "".dol_print_email($objp->email,0,0,1)."\n"; // Statut - print ''; + print ''; print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print ""; // Date fin cotisation if ($datefin) { - print ''; + print ''; if ($datefin < time() && $objp->statut > 0) { print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); @@ -574,7 +574,7 @@ if ($rowid > 0) } else { - print ''; + print ''; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index ac66f3cb44f..a7763893bb5 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -47,7 +47,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='actioncomm'; +$elementtype='actioncomm'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index d23d7c510ea..3e917ce03fc 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -199,13 +199,13 @@ while ($i <= $MAXAGENDA) $var=!$var; print ""; // Nb - print ''.$langs->trans("AgendaExtNb",$key).""; + print ''.$langs->trans("AgendaExtNb",$key).""; // Name print ''; // URL print ''; // Color (Possible colors are limited by Google) - print ''; + print ''; //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 ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 6ba81a5cbee..9fc80d8b3f7 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -165,7 +165,7 @@ while ($i < $nbofbank) print ''.$bankorder[$i][0]."\n"; print $bankorder[$i][1]; print ''; - print ''; + print ''; $tmparray=explode(' ',$bankorder[$i][2]); foreach($tmparray as $key => $val) { diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6fb5e458945..d5bdedc01d5 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -36,9 +36,8 @@ $rowid = GETPOST('rowid','int'); $action = GETPOST('action','alpha'); $errmesg=''; -// Definition des positions possibles pour les boites -$pos_array = array(0); // Positions possibles pour une boite (0,1,2,...) -$pos_name = array(0=>$langs->trans("Home")); // Nom des positions 0=Homepage, 1=... +// Define possible position of boxes +$pos_name = getStaticMember('InfoBox','listOfPages'); $boxes = array(); @@ -347,7 +346,9 @@ foreach($boxtoadd as $box) print '
'; print ''; print ''; - print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).''; + print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''; print ''; 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 print ''; - print $form->selectarray("pos",$pos_name); + print $form->selectarray("pos",$pos_name,0,0,0,0,'',1); print ''; print ''; print ' '; @@ -406,7 +407,9 @@ foreach($boxactivated as $key => $box) print "\n".''."\n"; print ''; - print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).''; + print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') { @@ -415,7 +418,7 @@ foreach($boxactivated as $key => $box) } else print ($box->note?$box->note:' '); print ''; - print '' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . ''; + print '' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . ''; $hasnext=($key < (count($boxactivated)-1)); $hasprevious=($key != 0); print ''.($key+1).''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 861a15bfebc..898d20648ec 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -234,7 +234,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''."\n"; @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering model - print ''; // Show example of numbering model - print ''; // Show example of numbering module - print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 35768104e39..ac2d89c1169 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -319,7 +319,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").'
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 5e32dd097d0..24a4ba180c2 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -146,7 +146,7 @@ if (is_resource($handle)) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 41178e36012..d82169b7be3 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -456,11 +456,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; } - if (!is_numeric($_POST['code'])) + // FIXME regresion if code with not in numeric base + /*if (!is_numeric($_POST['code'])) { $ok = 0; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; - } + }*/ } if (isset($_POST["country"]) && $_POST["country"]=='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:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&'; // Active - print '
'; + print ''; if ($iserasable) print ''.$actl[$obj->active].''; else { diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 28e5b912de2..1ac15bed9ed 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir) print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; @@ -361,7 +361,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Infos").''.$langs->trans("Infos").'
'; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''."\n"; @@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering module - print ''; // Show example of numbering model - print ''; // Show example of numbering module - print ''; //User - print ''; + print ''; print ''; // User - print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").'
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 023593ea2a7..95b2bffffb5 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 677e2b3773b..9bee4befa03 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -253,7 +253,7 @@ foreach ($dirmodels as $reldir) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index f7bd7ad95d7..bf382be58ed 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -305,7 +305,7 @@ if ($action == 'create') print '
'.$langs->trans('DetailMenuHandler').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuHandler').''.$handler.''.$langs->trans('DetailMenuHandler').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuForUsers').''.$langs->trans('DetailTarget').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); + if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')'; + print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); + if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')'; + print '
'; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index cb57c0d2e45..7e748cdbc4a 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -48,7 +48,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='commande'; +$elementtype='commande'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index afa67c434e8..085d33f3df0 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -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_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_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_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_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_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); -// } + 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_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); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -223,27 +222,31 @@ if ($action == 'edit') // Edit print ''.$langs->trans("HideAnyVATInformationOnPDF").''; 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 ''; + + // Hide Tva Intra on adress + $var=!$var; + print ''.$langs->trans("ShowVATIntaInAddress").''; + 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 ''; -// if ($conf->global->MAIN_FEATURES_LEVEL > 1) -// { - //Desc - $var=!$var; - print ''.$langs->trans("HideDescOnPDF").''; - 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 ''; + //Desc + $var=!$var; + print ''.$langs->trans("HideDescOnPDF").''; + 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 ''; - //Ref - $var=!$var; - print ''.$langs->trans("HideRefOnPDF").''; - 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 ''; + //Ref + $var=!$var; + print ''.$langs->trans("HideRefOnPDF").''; + 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 ''; + + //Details + $var=!$var; + print ''.$langs->trans("HideDetailsOnPDF").''; + 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 ''; - //Details - $var=!$var; - print ''.$langs->trans("HideDetailsOnPDF").''; - 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 ''; -// } print ''; @@ -418,26 +421,30 @@ else // Show print ""; print ''; -// if ($conf->global->MAIN_FEATURES_LEVEL > 1) -// { - //Desc - $var=!$var; - print ''.$langs->trans("HideDescOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); - print ''; + // Hide Tva Intra on adress + $var=!$var; + print ''.$langs->trans("ShowVATIntaInAddress").''; + print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1); + print ''; + + //Desc + $var=!$var; + print ''.$langs->trans("HideDescOnPDF").''; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); + print ''; - //Ref - $var=!$var; - print ''.$langs->trans("HideRefOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); - print ''; + //Ref + $var=!$var; + print ''.$langs->trans("HideRefOnPDF").''; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); + print ''; + + //Details + $var=!$var; + print ''.$langs->trans("HideDetailsOnPDF").''; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); + print ''; - //Details - $var=!$var; - print ''.$langs->trans("HideDetailsOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); - print ''; -// } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index d7cfcc0b67f..13f9eb32f46 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -302,7 +302,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering module - print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index ac3c911577b..5fe56bafaea 100755 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -132,7 +132,7 @@ $var=!$var; print ''; print ''.$langs->trans("ConnectionTimeout").''; print ''; -print ''; +print ''; print 'global->MAIN_USE_CONNECT_TIMEOUT).'">'; print ' '.strtolower($langs->trans("Seconds")); print ''; @@ -142,7 +142,7 @@ $var=!$var; print ''; print ''.$langs->trans("ResponseTimeout").''; print ''; -print ''; +print ''; print ''; print ' '.strtolower($langs->trans("Seconds")); print ''; @@ -152,7 +152,7 @@ $var=!$var; print ''; print ''.$langs->trans("MAIN_PROXY_USE").''; print ''; -print ''; +print ''; print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); print ''; print ''; @@ -161,7 +161,7 @@ $var=!$var; print ''; print ''.$langs->trans("MAIN_PROXY_HOST").''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -170,7 +170,7 @@ $var=!$var; print ''; print ''.$langs->trans("MAIN_PROXY_PORT").''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -179,7 +179,7 @@ $var=!$var; print ''; print ''.$langs->trans("MAIN_PROXY_USER").''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -188,7 +188,7 @@ $var=!$var; print ''; print ''.$langs->trans("MAIN_PROXY_PASS").''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9c4bfc67af4..83d2d5f8947 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -247,7 +247,7 @@ foreach ($arrayhandler as $key => $module) print ''; // Show example of numbering module - print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f24a63ba76e..b78a201b9d1 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -154,7 +154,7 @@ print ''; print ''.$langs->trans("SessionTimeOut").''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print ''; -print ''; +print ''; print ' '.strtolower($langs->trans("Seconds")); print ''; print ''; @@ -250,7 +250,7 @@ $max=@ini_get('upload_max_filesize'); if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.'; print ''; -print ''; +print ''; print ' '.$langs->trans("Kb"); print ''; print ''; @@ -265,7 +265,7 @@ print ''; print ''.$langs->trans("UMask").''; print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index d99698473a4..b724774237c 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering model - print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f80e6c3b28b..2b4feda1b8d 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering module - print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index a95a61c98cf..8f9865981f5 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -49,7 +49,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', '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(); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 68747cf417c..9aa7770f820 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -48,7 +48,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', '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(); diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 075f975adb2..f42f846e9d6 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -192,7 +192,7 @@ foreach ($syslogModules as $moduleName) print $module->getName(); print ''; - print ''; + print ''; $setuparray=$module->configure(); if ($setuparray) { diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index fec29ea5fd0..a3f046f4510 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -165,11 +165,11 @@ function create_script_table($list) foreach($list as $script) { ?> > - - + + KB - () - + () + @@ -199,10 +199,10 @@ function create_key_table($list) ?> > - - + + KB - '; // Date - print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; // Code print ''.$obj->type.''; // IP - print ''; + print ''; print dol_print_ip($obj->ip); print ''; // Login - print ''; + print ''; if ($obj->fk_user) { $userstatic->id=$obj->fk_user; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 0193ed9d833..780e4427078 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -151,16 +151,16 @@ if ($savehandler == 'files') print ''.$sessionentry['login'].''; // ID - print ''; + print ''; if ("$key" == session_id()) print $form->textwithpicto($key,$langs->trans("YourSession")); else print $key; print ''; // Date creation - print ''.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').''; // Date modification - print ''.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').''; // Age print ''.$sessionentry['age'].''; diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 7710b8e0490..3d9ebbd1d29 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -52,7 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(0,'priority'); -include $template_dir.'triggers.tpl.php'; +print ' + + + + + +'; + +$var=True; +foreach ($triggers as $trigger) +{ + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("File").''.$langs->trans("Active").' 
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''.$form->textwithpicto('', $trigger['info']).'
'; llxFooter(); diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index 371870047d9..c3634b6c726 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -170,7 +170,7 @@ if ($resql) print ''.$obj->position.""; // Actions - print ''; + print ''; if ($user->rights->bookmark->creer) { print "bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index ddce4bf1e83..cae461fe7fc 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -140,9 +140,9 @@ print $object->ref; \n"; -echo '\n"; -echo '\n"; +echo '\n"; +echo '\n"; +echo '\n"; ?>
'.$langs->trans("TotalHT").''.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."
'.$langs->trans("TotalVAT").''.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."
'.$langs->trans("TotalTTC").''.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."
'.$langs->trans("TotalHT").''.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."
'.$langs->trans("TotalVAT").''.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."
'.$langs->trans("TotalTTC").''.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index ec2a2b49d63..2d33607c092 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -261,23 +261,23 @@ if ($socid) print ''; } + // EMail + print ''.$langs->trans('EMail').''; + print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL'); + print ''; + + // Web + print ''.$langs->trans('Web').''; + print dol_print_url($soc->url); + print ''; + // Phone print ''.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').''; - // EMail - print ''.$langs->trans('EMail').''; - print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL'); - print ''; - - // Web - print ''.$langs->trans('Web').''; - print dol_print_url($soc->url); - print ''; - // Assujeti a TVA ou pas print ''; - print ''.$langs->trans('VATIsUsed').''; + print ''.$langs->trans('VATIsUsed').''; print yn($soc->tva_assuj); print ''; print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 377c06fd8d8..f8091fa8fa6 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -241,11 +241,8 @@ class Categorie $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; - $sql.= " SET label = '".$this->db->escape($this->label)."'"; - if (! empty($this->description)) - { - $sql .= ", description = '".$this->db->escape($this->description)."'"; - } + $sql.= " SET label = '".$this->db->escape($this->label)."',"; + $sql.= " description = '".$this->db->escape($this->description)."'"; if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 79ac19ff189..388cf47436a 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +$langs->load("categories"); $id=GETPOST('id','int'); $ref=GETPOST('ref'); @@ -62,7 +63,7 @@ if ($action == 'update' && $user->rights->categorie->creer) $result=$categorie->fetch($id); $categorie->label = $nom; - $categorie->description = $description; + $categorie->description = dol_htmlcleanlastbr($description); $categorie->socid = ($socid ? $socid : 'null'); $categorie->visible = $visible; diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 8aa2bb8df0c..34a036156a3 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -108,7 +108,7 @@ if ($action == 'add' && $user->rights->categorie->creer) $object = new Categorie($db); $object->label = $label; - $object->description = $description; + $object->description = dol_htmlcleanlastbr($description); $object->socid = ($socid ? $socid : 'null'); $object->visible = $visible; $object->type = $type; @@ -192,7 +192,7 @@ if ($user->rights->categorie->creer) if ($action == 'create' || $_POST["addcat"] == 'addcat') { dol_set_focus('#label'); - + print ''; print ''; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 57cffd387de..36ed1bd4ded 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -258,7 +258,7 @@ if ($object->type == 0) { $var=!$var; print "\t\n"; - print ''; + print ''; print $prod->getNomUrl(1,'category'); print "\n"; print ''.$prod->libelle."\n"; @@ -309,7 +309,7 @@ if ($object->type == 1) $var=!$var; print "\t\n"; - print ''; + print ''; print $soc->getNomUrl(1,'category_supplier'); print "\n"; // Link to delete from category @@ -361,7 +361,7 @@ if($object->type == 2) $i++; $var=!$var; print "\t\n"; - print ''; + print ''; print $soc->getNomUrl(1,'category'); print "\n"; // Link to delete from category @@ -413,7 +413,7 @@ if ($object->type == 3) { $var=!$var; print "\t\n"; - print ''; + print ''; $member->ref=$member->login; print $member->getNomUrl(1,0,'category'); print "\n"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 52620f4445b..9b15634945e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -35,7 +35,7 @@ class ActionComm extends CommonObject public $element='action'; public $table_element = 'actioncomm'; 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; diff --git a/htdocs/comm/action/contact.php b/htdocs/comm/action/contact.php index b3819ce3a04..87a13f28c55 100644 --- a/htdocs/comm/action/contact.php +++ b/htdocs/comm/action/contact.php @@ -266,7 +266,7 @@ if ($id > 0 || ! empty($ref)) // Ligne ajout pour contact interne print ""; - print ''; + print ''; print img_object('','user').' '.$langs->trans("Users"); print ''; @@ -298,7 +298,7 @@ if ($id > 0 || ! empty($ref)) $var=!$var; print ""; - print ''; + print ''; print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); print ''; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9fcbca3e743..7ad74302655 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -51,6 +51,21 @@ if ($user->societe_id > 0) $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 $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -79,7 +94,7 @@ if ($action == 'delete') { $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). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$act); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; @@ -96,184 +111,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($objectid > 0) +if ($act->id > 0) { - $act = new ActionComm($db); - if ($act->fetch($objectid)) + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($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 ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Type + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + print ''; + } - $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; + // Title + print ''; - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + // Full day event + print ''; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + // Date start + print ''; + print ''; + print ''; - $head=actions_prepare_head($act); - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + // Date end + print ''; - // Affichage fiche action en mode visu - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; + 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 ''."\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print '
'."\n"; + print '
'.$langs->trans("DateActionEnd").''; + 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 '
'; + // Status + print ''; - $linkback = ''.$langs->trans("BackToList").''; + // Location + print ''; - // Ref - print ''; - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '


'; + + + // Third party - Contact + print ''; + print "
".dol_print_phone($act->societe->tel); } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Status - print ''; - - // Location - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($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 '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; - 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 ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; - 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 '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Location").''.$act->location.'


'; - - - // Third party - Contact - print ''; - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - print ''; - } - - // Priority - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($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 "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - 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 "
".dol_print_phone($act->contact->phone_pro); - } - } - } - else - { - print $langs->trans("None"); - } - - print '
'.$langs->trans("Project").''; - if ($act->fk_project) - { - $project=new Project($db); - $project->fetch($act->fk_project); - print $project->getNomUrl(1); - } - print '
'.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); - print '


'; - - // 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) + } + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Contact").''; + if ($act->contact->id > 0) + { + print $act->contact->getNomUrl(1); + if ($act->contact->id && $act->type_code == 'AC_TEL') { - $totalsize+=$file['size']; + if ($act->contact->fetch($act->contact->id)) + { + print "
".dol_print_phone($act->contact->phone_pro); + } } - - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print ''; - - - // 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 { - dol_print_error($db); + print $langs->trans("None"); } + + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + print ''.$langs->trans("Project").''; + if ($act->fk_project) + { + $project=new Project($db); + $project->fetch($act->fk_project); + print $project->getNomUrl(1); + } + print ''; + } + + // Priority + print ''.$langs->trans("Priority").''; + print ($act->priority?$act->priority:''); + print ''; + + + print '

'; + + // 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 ''; + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print ''; + + + // 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 { diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 4b4917715b5..f230ba1a95b 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -53,7 +53,7 @@ $contactid=GETPOST('contactid','int'); $socid = GETPOST('socid','int'); $id = GETPOST('id','int'); 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"); $mesg=''; @@ -64,7 +64,7 @@ $contact = new Contact($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('actioncomm'); +$extralabels=$extrafields->fetch_name_optionals_label($actioncomm->table_element); //var_dump($_POST); @@ -473,7 +473,7 @@ if ($action == 'create') // Date start $datep=$actioncomm->datep; if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); - print ''.$langs->trans("DateActionStart").''; + print ''.$langs->trans("DateActionStart").''; 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 $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); @@ -514,12 +514,12 @@ if ($action == 'create') // Assigned to $var=false; - print ''.$langs->trans("ActionAffectedTo").''; + print ''.$langs->trans("ActionAffectedTo").''; $form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1); print ''; // Busy - print ''.$langs->trans("Busy").''; + print ''.$langs->trans("Busy").''; print ''; print ''; @@ -536,7 +536,7 @@ if ($action == 'create') print ''; // Societe, contact - print '\n"; //print '"; - print '\n"; print ''; - print ''; + print ''; $var=!$var; $i++; } @@ -579,10 +575,10 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; - print ''; + print ''; $i++; } $db->free($resql); @@ -631,14 +627,14 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print '\n"; print ''; - print '\n"; @@ -692,7 +688,7 @@ if ($id > 0) $fichinter_static->statut=$objp->fk_statut; print ""; - print ''."\n"; + print ''."\n"; //print ''."\n"; print ''."\n"; print ''."\n"; @@ -753,7 +749,7 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print ''; - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index de442152c14..367ab558194 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -157,19 +157,19 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $obj = $db->fetch_object($resql); $var=!$var; - print ''; - print ''; - print ''; + print ''; $i++; $total += $obj->total_ht; } @@ -224,15 +224,15 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $var=!$var; $obj = $db->fetch_object($resql); - print ''; - print ''; + print ''; - print ''; + print ''; $i++; $total += $obj->total_ttc; } @@ -295,7 +295,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $companystatic->client=$objp->client; $companystatic->canvas=$objp->canvas; print ''; - print ''; + print ''; print '"; @@ -351,7 +351,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $companystatic->name=$objp->name; $companystatic->canvas=$objp->canvas; print ''; - print ''; + print ''; print ''; print ''; $var=!$var; @@ -481,16 +481,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; // Ref - print '
'.$langs->trans("ActionOnCompany").''; + print '
'.$langs->trans("ActionOnCompany").''; if (GETPOST('socid','int') > 0) { $societe = new Societe($db); @@ -711,7 +711,7 @@ if ($id > 0) if ($backtopage) print ''; dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); - + print ''; // Ref @@ -732,7 +732,7 @@ if ($id > 0) print ''; // Date start - print ''; // Status - print ''; @@ -756,19 +756,19 @@ if ($id > 0) print '
'.$langs->trans("EventOnFullDay").'fulldayevent?' checked="checked"':'').'>
'.$langs->trans("DateActionStart").''; + print '
'.$langs->trans("DateActionStart").''; 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 $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); @@ -745,7 +745,7 @@ if ($id > 0) print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; print $htmlactions->form_select_status_action('formaction',$percent,1); print '


'; // Assigned to - print ''; // Busy - print ''; // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } @@ -838,7 +838,7 @@ if ($id > 0) print '
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1); print '
'.$langs->trans("Busy").''; + print '
'.$langs->trans("Busy").''; print 'transparency?' checked="checked"':'').'">'; print '
'.$langs->trans("ActionDoneBy").''; + print '
'.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print '
'; dol_fiche_end(); - + print '
'; print '     '; print '
'; @@ -848,7 +848,7 @@ if ($id > 0) else { dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); - + // Affichage fiche action en mode visu print ''; @@ -916,7 +916,7 @@ if ($id > 0) print ''; // Status - print ''; @@ -926,19 +926,19 @@ if ($id > 0) print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print $act->getLibStatut(4); print '


'; // Assigned to - print ''; // Busy - print ''; // Done by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 813c2578374..fd9df1ea848 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -780,7 +780,7 @@ if (empty($action) || $action == 'show_month') // View by month { $style='cal_other_month cal_past'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \n"; } @@ -796,7 +796,7 @@ if (empty($action) || $action == 'show_month') // View by month if ($today) $style='cal_today'; if ($curtime < $todaytms) $style.=' cal_past'; - echo ' \n"; } @@ -805,7 +805,7 @@ if (empty($action) || $action == 'show_month') // View by month { $style='cal_other_month'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \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 ($today) $style='cal_today'; - echo ' \n"; } @@ -863,7 +863,7 @@ elseif ($action == 'show_week') // View by week { $style='cal_current_month'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \n"; } @@ -892,7 +892,7 @@ else // View by day echo ' \n"; echo " \n"; echo " \n"; - echo ' \n"; @@ -947,7 +947,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print '
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); print '
'.$langs->trans("Busy").''; + print '
'.$langs->trans("Busy").''; print yn(($act->transparency > 0)?1:0); print '
'.$langs->trans("ActionDoneBy").''; + print '
'.$langs->trans("ActionDoneBy").''; if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); print '
'; + echo ' '; show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " '; + echo ' '; show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " '; + echo ' '; show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo "'; + echo ' '; show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo " '; + echo ' '; show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo "'.$langs->trans("Day".$arraytimestamp['wday'])."
'; + echo ' '; $maxnbofchar=80; show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo "
'; - print ''; - print ''; - print ''; - print ''; @@ -354,7 +354,7 @@ if ($resql) print ''; // Status/Percent - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 350583a5427..28534e08140 100755 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='propal'; +$elementtype='propal'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index ae8026d2b68..50c8bf903fb 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -236,7 +236,7 @@ if ($id > 0) print ""; // Zip / Town - print ''; + print ''; print '"; print ''; @@ -247,21 +247,21 @@ if ($id > 0) else print ($img?$img.' ':'').$object->country; print ''; - // Phone - print ''; - - // Fax - print ''; - // EMail print ''; // Web print ''; + // Phone + print ''; + + // Fax + print ''; + // Assujeti a TVA ou pas print ''; - print ''; print ''; @@ -271,10 +271,10 @@ if ($id > 0) { if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; } @@ -441,12 +441,12 @@ if ($id > 0) print "
'; + print '
'; print ''; - print ''; + print ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { //$param='month='.$monthshown.'&year='.$year; @@ -966,7 +966,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; } print '
'; + print '
'; //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $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 '
'; print '
  • '; print ''; - print ''; // Status - Percent - print '
    '; + print ''; if ($event->type_code == 'BIRTHDAY') // It's a birthday { 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 ''; + print ''; if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); else print ' '; print '
    '; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 7c775bf78ac..66dc178d4b8 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->load("commercial"); +$id = GETPOST('id','int'); + // Security check if ($user->societe_id > 0) { @@ -38,6 +40,7 @@ if ($user->societe_id > 0) $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); $act = new ActionComm($db); -$act->fetch($_GET["id"]); -$act->info($_GET["id"]); +$act->fetch($id); +$act->info($act->id); $head=actions_prepare_head($act); dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action'); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 9e7a7a959bb..c0b8430b75e 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -276,7 +276,7 @@ if ($resql) //print dol_trunc($obj->label,12); //print '
'; + print ''; print dol_print_date($db->jdate($obj->dp),"day"); $late=0; 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")).' '; print ''; + print ''; print dol_print_date($db->jdate($obj->dp2),"day"); print ''.$actionstatic->LibStatut($obj->percent,6).''.$actionstatic->LibStatut($obj->percent,6).'
'.$langs->trans('Zip').' / '.$langs->trans('Town').'
'.$langs->trans('Zip').' / '.$langs->trans('Town').''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town."
'.$langs->trans('Phone').''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('EMail').''.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'
'.$langs->trans("Web").''.dol_print_url($object->url,'_blank').'
'.$langs->trans('Phone').''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('VATIsUsed').''; + print ''.$langs->trans('VATIsUsed').''; print yn($object->tva_assuj); print '
'.$langs->trans('LocalTax1IsUsedES').''; + print '
'.$langs->trans('LocalTax1IsUsedES').''; print yn($object->localtax1_assuj); print '
'.$langs->trans('LocalTax2IsUsedES').''; + print '
'.$langs->trans('LocalTax2IsUsedES').''; print yn($object->localtax2_assuj); print '
"; - + print '
'; //print "
'; - + // Nbre max d'elements des petites listes $MAXLIST=4; $tableaushown=1; @@ -469,10 +469,6 @@ if ($id > 0) { $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.= " 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"; @@ -503,14 +499,14 @@ if ($id > 0) { $objp = $db->fetch_object($resql); print "
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; + print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { print " ".img_warning(); } print ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'.$propal_static->LibStatut($objp->fk_statut,5).'
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; + print ''.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; print ''.dol_print_date($db->jdate($objp->dc),'day')."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'; + print ''; $contrat->id=$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id; print $contrat->getNomUrl(1,12); print "'.dol_print_date($db->jdate($objp->dc),'day')." '; + print ''; $contrat->fetch_lines(); print $contrat->getLibStatut(4); print "
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''.dol_print_date($db->jdate($objp->startdate)).''.convertSecondToTime($objp->duration).''.$fichinter_static->getLibStatut(5).'
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; $facturestatic->type=$objp->type; @@ -769,7 +765,7 @@ if ($id > 0) } print ''.price($objp->total_ttc).''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'
'; + print '
'; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print $propalstatic->getNomUrl(1); print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print ''.price($obj->total_ht).'
'.price($obj->total_ht).'
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; + print '
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print ''.price($obj->total_ttc).'
'.price($obj->total_ttc).'
'.$companystatic->getNomUrl(1,'customer',48).''.$companystatic->getNomUrl(1,'customer',48).''; print $companystatic->getLibCustProspStatut(); print "
'.$companystatic->getNomUrl(1,'supplier',44).''.$companystatic->getNomUrl(1,'supplier',44).''.dol_print_date($db->jdate($objp->dm),'day').'
'; + print ''; $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; print ''; - print ''; - print '"; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index 1a09441b499..b05f859f54e 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -161,10 +161,10 @@ if ($result) print ''; } // Last send - print ''; + print ''; print ''; // Status - print ''; // Terms of payment - print ''; @@ -1561,7 +1561,7 @@ else // Ref client print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index e7d6cd2811d..28696228e45 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -137,6 +137,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit +1, $offset); +dol_syslog('comm:list.php: sql='.$sql,LOG_DEBUG); + $result = $db->query($sql); if ($result) { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 22c7de7c5f2..c533a01c5c5 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -483,7 +483,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) { print ' '.$langs->trans("MailingStatusNotSent"); + print ''.$langs->trans("MailingStatusNotSent"); if ($user->rights->mailing->creer) { print ''.img_delete($langs->trans("RemoveRecipient")); } @@ -492,7 +492,7 @@ if ($object->fetch($id) >= 0) else { print ''.$obj->date_envoi.''; + print ''; 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==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 2616850748e..a58e7d6ad4f 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -49,7 +49,7 @@ $result=$object->fetch($id); $extrafields = new ExtraFields($db); // 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 $hookmanager->initHooks(array('mailingcard')); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 8c1be3b3926..088ee43a02a 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -176,7 +176,7 @@ if ($result) $var=!$var; print "
'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''.dol_trunc($obj->titre,38).''.dol_print_date($db->jdate($obj->date_creat),'day').''.($obj->nbemail?$obj->nbemail:"0").''.dol_print_date($db->jdate($obj->date_envoi),'day').''.dol_print_date($db->jdate($obj->date_envoi),'day').''; + print ''; if ($filteremail) { if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error(); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 2a7c92dce56..9cde868a97a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -83,7 +83,7 @@ $object = new Propal($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('propal'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || ! empty($ref)) @@ -1116,7 +1116,7 @@ else if ($action == 'down' && $user->rights->propal->creer) else if ($action == 'update_extras') { // 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); // Actions on extra fields (by external module or standard code) @@ -1290,7 +1290,7 @@ if ($action == 'create') print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); print '
'; - print '
'; + print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; @@ -1837,65 +1837,37 @@ else if ($action == 'edit_extras') { + print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).'
'; print '
'; print ''; print ''; print ''; + print ''; } - // TODO : use showOptionals($extrafields) function - 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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } - } + print $object->showOptionals($extrafields,'edit'); if(count($extrafields->attribute_label) > 0) { if ($action == 'edit_extras' && $user->rights->propal->creer) { - print ''; - + print '
'; - - // 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 '
'; + print '
'; print ''; - print ''; print '
'; + print ''; } else { if ($object->statut == 0 && $user->rights->propal->creer) { - print ''; + print ''; } } } } // Amount HT - print ''; + print ''; print ''; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1b283e41ed0..f407d6b597a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -307,13 +307,13 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param timestamp $date_start Start date of the line + * @param timestamp $date_end End date of the line * @return int >0 if OK, <0 if KO * * @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; @@ -403,7 +403,7 @@ class Propal extends CommonObject $this->line->product_type=$type; $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; - + $this->line->date_start=$date_start; $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 string $label ??? * @param int $type 0/1=Product/service - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param timestamp $date_start Start date of the line + * @param timestamp $date_end End date of the line * @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; @@ -552,7 +552,7 @@ class Propal extends CommonObject // infos marge $this->line->fk_fournprice = $fk_fournprice; $this->line->pa_ht = $pa_ht; - + $this->line->date_start=$date_start; $this->line->date_end=$date_end; @@ -830,7 +830,7 @@ class Propal extends CommonObject } } else if ($reshook < 0) $error++; - + if (! $notrigger) { // Appel des triggers @@ -1099,6 +1099,16 @@ class Propal extends CommonObject $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->lines = array(); @@ -1164,7 +1174,7 @@ class Propal extends CommonObject $line->product_label = $objp->product_label; $line->product_desc = $objp->product_desc; // Description produit $line->fk_product_type = $objp->fk_product_type; - + $line->date_start = $objp->date_start; $line->date_end = $objp->date_end; @@ -1187,15 +1197,10 @@ class Propal extends CommonObject 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('propal',true); - //$this->fetch_optionals($this->id,$extralabels); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); 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; } @@ -1209,7 +1214,7 @@ class Propal extends CommonObject return -1; } } - + /** * Update value of extrafields on the proposal * @@ -1235,7 +1240,7 @@ class Propal extends CommonObject } } else if ($reshook < 0) $error++; - + if (!$error) { return 1; @@ -1244,7 +1249,7 @@ class Propal extends CommonObject { return -1; } - + } /** @@ -1262,16 +1267,16 @@ class Propal extends CommonObject $now=dol_now(); if ($user->rights->propale->valider) - { + { $this->db->begin(); - + // Numbering module definition $soc = new Societe($this->db); $soc->fetch($this->socid); - + // Class of company linked to propal $result=$soc->set_as_client(); - + // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { @@ -1648,7 +1653,7 @@ class Propal extends CommonObject $this->db->rollback(); return -2; } - + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -1674,7 +1679,7 @@ class Propal extends CommonObject } else { - + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -1688,7 +1693,7 @@ class Propal extends CommonObject //$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); } - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -1769,9 +1774,9 @@ class Propal extends CommonObject /** * 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 $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 $limit For pagination * @param int $offset For pagination @@ -1785,15 +1790,22 @@ class Propal extends CommonObject $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"; + 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"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND p.fk_soc = s.rowid"; $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 ($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->plimit($limit,$offset); @@ -1808,14 +1820,19 @@ class Propal extends CommonObject { $obj = $this->db->fetch_object($result); - if ($shortlist) + if ($shortlist == 1) { $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]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; } $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) { 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 ($statut==0) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusDraftShort'),'statut0'); - if ($statut==1) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusOpenedShort'),'statut1'); - if ($statut==2) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusSignedShort'),'statut3'); - if ($statut==3) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusNotSignedShort'),'statut5'); - if ($statut==4) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusBilledShort'),'statut6'); + if ($statut==0) return ''.$this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusDraftShort'),'statut0'); + if ($statut==1) return ''.$this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusOpenedShort'),'statut1'); + if ($statut==2) return ''.$this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusSignedShort'),'statut3'); + if ($statut==3) return ''.$this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusNotSignedShort'),'statut5'); + if ($statut==4) return ''.$this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusBilledShort'),'statut6'); } } @@ -2640,7 +2672,7 @@ class PropaleLigne var $localtax2_tx; var $total_localtax1; var $total_localtax2; - + var $date_start; var $date_end; @@ -2713,7 +2745,7 @@ class PropaleLigne $this->libelle = $objp->product_label; // deprecated $this->product_label = $objp->product_label; $this->product_desc = $objp->product_desc; - + $this->date_start = $this->db->jdate($objp->date_start); $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->special_code)) $this->special_code=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; @@ -2767,7 +2800,8 @@ class PropaleLigne // Insert line into database $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.= ' info_bits, '; $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.= " ".($this->subprice?price2num($this->subprice):'null').","; $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_tva).","; $sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax2).","; $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.= ' '.$this->special_code.','; $sql.= ' '.$this->rang.','; @@ -2891,6 +2925,7 @@ class PropaleLigne if (empty($this->info_bits)) $this->info_bits=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_fournprice=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_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; - $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null"); + $sql.= " , buy_price_ht=".price2num($this->pa_ht); 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"); if (! empty($this->rang)) $sql.= ", rang=".$this->rang; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 971f6d10a86..2a31d4a48b7 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -184,7 +184,7 @@ if (! empty($conf->propal->enabled)) $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; - print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->socname; @@ -242,17 +242,17 @@ if ($resql) $obj = $db->fetch_object($resql); print ""; - print '
'.img_picto('','edit').' '.$langs->trans('Modify').'
'.img_picto('','edit').' '.$langs->trans('Modify').'
'.$langs->trans('AmountHT').'
'.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).''.$propalstatic->getNomUrl(1).''.$propalstatic->getNomUrl(1).'
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -321,16 +321,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) print ''; // Ref - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; print '"; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; @@ -403,17 +403,17 @@ if (! empty($conf->propal->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print "
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -475,17 +475,17 @@ if (! empty($conf->propal->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1d4d5b82c24..2e3b70a8ca3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -131,7 +131,7 @@ if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; $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,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; @@ -301,17 +301,17 @@ if ($result) $now = dol_now(); $var=!$var; print ''; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $objectstatic->id=$objp->propalid; $objectstatic->ref=$objp->ref; print ''; - print ''; - print ''; @@ -333,7 +333,7 @@ if ($result) print ''; // Customer ref - print ''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index bd0f6376f1f..873ef051612 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -402,12 +402,12 @@ if ($resql) print $prospectstatic->getLibProspLevel(); print ""; // Statut - print '"; //$sts = array(-1,0,1,2,3); - print ''; print ''; // Need 120+ for format with AM/PM print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -342,7 +342,7 @@ if ($socid > 0) print ''; if ($obj->description == '(CREDIT_NOTE)') { - print ''; } - print ''; + print ''; print ''; print ''; print ''; @@ -373,7 +373,7 @@ if ($socid > 0) print ''; if ($user->rights->societe->creer || $user->rights->facture->creer) { - print ''; print ''; // Need 120+ for format with AM/PM print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -499,7 +499,7 @@ if ($socid > 0) print ''; if ($obj->description == '(CREDIT_NOTE)') { - print ''; } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4612d378908..60522561346 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -761,7 +761,7 @@ class Commande extends CommonOrder } } } - + if (! $error) { // 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->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; - + $line->date_start = $object->lines[$i]->date_start; $line->date_end = $object->lines[$i]->date_end; @@ -1339,6 +1339,16 @@ class Commande extends CommonOrder $this->lines = array(); 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(); @@ -1972,23 +1982,38 @@ class Commande extends CommonOrder /** * Return list of orders (eventuelly filtered on a user) into an array * - * @param int $brouillon 0=non brouillon, 1=brouillon - * @param User $user Objet user de filtre + * @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($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(); - $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"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.entity = ".$conf->entity; $sql.= " AND c.fk_soc = s.rowid"; - if ($brouillon) $sql.= " AND c.fk_statut = 0"; - if ($user) $sql.= " AND c.fk_user_author <> ".$user->id; - $sql .= " ORDER BY c.date_commande DESC"; + 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 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); if ($result) @@ -2001,7 +2026,20 @@ class Commande extends CommonOrder { $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++; } } @@ -2382,6 +2420,17 @@ class Commande extends CommonOrder // Delete linked contacts $res = $this->delete_linked_contact(); 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 $comref = dol_sanitizeFileName($this->ref); @@ -2409,6 +2458,8 @@ class Commande extends CommonOrder } } } + + } if (! $error) @@ -2557,12 +2608,12 @@ class Commande extends CommonOrder } elseif ($mode == 5) { - if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5'); - if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0'); - if ($statut==1) return $langs->trans('StatusOrderValidatedShort').' '.img_picto($langs->trans('StatusOrderValidated'),'statut1'); - if ($statut==2) return $langs->trans('StatusOrderSentShort').' '.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 $langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6'); + if ($statut==-1) return ''.$langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5'); + if ($statut==0) return ''.$langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0'); + if ($statut==1) return ''.$langs->trans('StatusOrderValidatedShort').' '.img_picto($langs->trans('StatusOrderValidated'),'statut1'); + if ($statut==2) return ''.$langs->trans('StatusOrderSentShort').' '.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 ''.$langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6'); } } @@ -2781,7 +2832,7 @@ class Commande extends CommonOrder return -1; } } - + /** * Update value of extrafields on the proposal * @@ -2807,7 +2858,7 @@ class Commande extends CommonOrder } } else if ($reshook < 0) $error++; - + if (!$error) { return 1; @@ -2816,7 +2867,7 @@ class Commande extends CommonOrder { return -1; } - + } /** diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 4801305a091..99168cdc6a0 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1,34 +1,34 @@ * Copyright (C) 2004-2013 Laurent Destailleur -* Copyright (C) 2005 Marc Barilley / Ocebo -* Copyright (C) 2005-2013 Regis Houssin -* Copyright (C) 2006 Andre Cianfarani -* Copyright (C) 2010-2013 Juanjo Menent -* Copyright (C) 2011 Philippe Grand -* Copyright (C) 2012 Christophe Battarel -* Copyright (C) 2012 Marcos García -* Copyright (C) 2013 Florian Henry -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Florian Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /** * \file htdocs/commande/fiche.php -* \ingroup commande -* \brief Page to show customer order -*/ + * \ingroup commande + * \brief Page to show customer order + */ require '../main.inc.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 -$extralabels=$extrafields->fetch_name_optionals_label('commande'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || ! empty($ref)) @@ -1127,7 +1127,7 @@ else if ($action == 'print_file' AND $user->rights->printipp->use) else if ($action == 'update_extras') { // 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); // Actions on extra fields (by external module or standard code) @@ -1565,7 +1565,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ""; // Conditions de reglement - print ''; @@ -1907,7 +1907,7 @@ else // Ref commande client print '
'; + print ''; print $objectstatic->getNomUrl(1); print ''; + print ''; if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; + print ''; print $objp->ref_client; print ''; + print ''; print $prospectstatic->LibProspStatut($obj->fk_stcomm,2); print "'; + print ''; foreach ($sts as $key => $value) { if ($value <> $obj->fk_stcomm) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 7f92b7e65c0..56dec89394d 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -323,7 +323,7 @@ if ($socid > 0) print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.dol_print_date($db->jdate($obj->dc),'dayhour').''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -351,7 +351,7 @@ if ($socid > 0) } elseif ($obj->description == '(DEPOSIT)') { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -364,7 +364,7 @@ if ($socid > 0) print $obj->description; print ''.$langs->trans("NotConsumed").''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; + print ''; print 'rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').''; print '   '; print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; @@ -459,7 +459,7 @@ if ($socid > 0) print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.dol_print_date($db->jdate($obj->dc),'dayhour').''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -508,7 +508,7 @@ if ($socid > 0) } elseif ($obj->description == '(DEPOSIT)') { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -521,7 +521,7 @@ if ($socid > 0) print $obj->description; print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).'
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements($cond_reglement_id,'cond_reglement_id',-1,1); print '
'; - print '
'; + print ''; if ($action != 'refcustomer' && $object->brouillon) print ''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index e0e2e09df73..d9f5cca0415 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -195,7 +195,7 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '"; print ''; $i++; @@ -247,21 +247,21 @@ if ($resql) $obj = $db->fetch_object($resql); print ""; - print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).'
'; + print ''; print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; - print '"; - print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -316,21 +316,21 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print "
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; - print '"; - print ''; @@ -333,18 +334,16 @@ if ($resql) $companystatic->client=$objp->client; print ''; // Amount HT - print ''; + print ''; // Statut - print ''; + print ''; print ''; @@ -391,10 +390,10 @@ if ($resql) { $var=!$var; print ''; - print ''; + print ''; // Total HT - print ''; - print ''; + print ''; + print ''; print ''; } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 42a39dd9fa8..93a4db53fbb 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -607,21 +607,21 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) $objp = $db->fetch_object($resql); $var=!$var; print ''; - print ' - - + + control->tpl['localtax'])) echo $this->control->tpl['localtax']; ?> diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 7e1e8631bd3..0afcb99dc56 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -173,8 +173,8 @@ for ($i=1; $i<=4; $i++) { - - + + diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 2beb21e3430..4ea5afcbdcb 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -90,7 +90,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); - + @@ -136,7 +136,7 @@ for ($i=1; $i<=4; $i++) { - + diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 7c99adc360b..d2fc7e5551b 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -89,7 +89,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); - + diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0c1b8016938..0ea3253bdd1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -852,13 +852,9 @@ class Societe extends CommonObject // 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('company',true); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); if (count($extralabels)>0) { - $this->array_options = array(); - } - foreach($extrafields->attribute_label as $key=>$label) - { - $this->array_options['options_'.$key]=$label; + $this->fetch_optionals($this->id,$extralabels); } } else @@ -1463,7 +1459,7 @@ class Societe extends CommonObject { $lien = '"; - print '"; // Name - print '"; - print '"; print "\n"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index eb22a97a41b..043cd4ead71 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin @@ -56,7 +56,7 @@ $object = new Societe($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('company'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($socid); @@ -699,6 +699,7 @@ else print ''."\n"; print "
\n"; + print '
'; print $langs->trans("ThirdPartyType").':   '; print ' '.$langs->trans("Company/Fundation"); @@ -706,7 +707,7 @@ else print ' '.$langs->trans("Individual"); print ' ('.$langs->trans("ToCreateContactWithSameName").')'; - print "
\n"; + print '
'; print "
\n"; } @@ -832,13 +833,14 @@ else print ''; } + // Email web + print '
'; + print ''; + // Phone / Fax print ''; print ''; - print ''; - print ''; - // Prof ids $i=1; $j=0; while ($i <= 6) @@ -870,8 +872,8 @@ else print ''; - print ''; - print ''; + print ''; // Capital - print ''; + print ''; // Local Taxes //TODO: Place into a function to control showing by country or study better option @@ -982,7 +985,7 @@ else } // Ajout du logo - print ''; + print ''; print ''; print ''; } + // EMail / Web + print ''; + print ''; + // Phone / Fax print ''; print ''; - // EMail / Web - print ''; - print ''; - // Prof ids $i=1; $j=0; while ($i <= 6) @@ -1295,8 +1298,8 @@ else print ''; // VAT Code - print ''; - print ''; + print ''; // Country - print ''; - print ''; - print ''; - // EMail - print ''; + print ''; // Web - print ''; + // Phone / Fax + print ''; + print ''; + // Prof ids $i=1; $j=0; while ($i <= 6) @@ -1603,7 +1607,7 @@ else print ''; // VAT Code - print ''; - print ''; - print ''; } - print ''; } @@ -370,7 +370,7 @@ if ($result) { print ''; } - print ''; } @@ -385,7 +385,7 @@ if ($result) print $form->textwithtooltip($langs->trans("Inherited"),$langs->trans("PermissionInheritedFromAGroup")); print ''; } - print ''; } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 01f8ea84b55..864bd9cb5af 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -98,234 +98,12 @@ else $type=dol_mimetype($original_file); // Suppression de la chaine de caractere ../ dans $original_file $original_file = str_replace("../","/", $original_file); -// Security checks +// Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); -$accessallowed=0; -if ($modulepart) -{ - // Check permissions and define directory - - // Wrapping for company logo - if ($modulepart == 'companylogo') - { - $accessallowed=1; - $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file; - } - // Wrapping for users photos - elseif ($modulepart == 'userphoto') - { - $accessallowed=1; - $original_file=$conf->user->dir_output.'/'.$original_file; - } - // Wrapping for members photos - elseif ($modulepart == 'memberphoto') - { - $accessallowed=1; - $original_file=$conf->adherent->dir_output.'/'.$original_file; - } - // Wrapping for members photos - elseif ($modulepart == 'member') - { - $accessallowed=1; - $original_file=$conf->adherent->dir_output.'/'.$original_file; - } - // Wrapping pour les images des societes - elseif ($modulepart == 'societe') - { - $accessallowed=1; - $original_file=$conf->societe->multidir_output[$entity].'/'.$original_file; - } - // Wrapping pour les apercu factures - elseif ($modulepart == 'apercufacture') - { - if ($user->rights->facture->lire) $accessallowed=1; - $original_file=$conf->facture->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu propal - elseif ($modulepart == 'apercupropal') - { - if ($user->rights->propale->lire) $accessallowed=1; - $original_file=$conf->propal->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu commande - elseif ($modulepart == 'apercucommande') - { - if ($user->rights->commande->lire) $accessallowed=1; - $original_file=$conf->commande->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu intervention - elseif ($modulepart == 'apercufichinter') - { - if ($user->rights->ficheinter->lire) $accessallowed=1; - $original_file=$conf->ficheinter->dir_output.'/'.$original_file; - } - // Wrapping pour les images des stats propales - elseif ($modulepart == 'propalstats') - { - if ($user->rights->propale->lire) $accessallowed=1; - $original_file=$conf->propal->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats commandes - elseif ($modulepart == 'orderstats') - { - if ($user->rights->commande->lire) $accessallowed=1; - $original_file=$conf->commande->dir_temp.'/'.$original_file; - } - elseif ($modulepart == 'orderstatssupplier') - { - if ($user->rights->fournisseur->commande->lire) $accessallowed=1; - $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file; - } - // Wrapping pour les images des stats factures - elseif ($modulepart == 'billstats') - { - if ($user->rights->facture->lire) $accessallowed=1; - $original_file=$conf->facture->dir_temp.'/'.$original_file; - } - elseif ($modulepart == 'billstatssupplier') - { - if ($user->rights->fournisseur->facture->lire) $accessallowed=1; - $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'expeditionstats') - { - if ($user->rights->expedition->lire) $accessallowed=1; - $original_file=$conf->expedition->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'tripsexpensesstats') - { - if ($user->rights->deplacement->lire) $accessallowed=1; - $original_file=$conf->deplacement->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'memberstats') - { - if ($user->rights->adherent->lire) $accessallowed=1; - $original_file=$conf->adherent->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats produits - elseif (preg_match('/^productstats_/i',$modulepart)) - { - if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1; - $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file; - } - // Wrapping for products or services - elseif ($modulepart == 'product') - { - if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1; - $original_file=(! empty($conf->product->multidir_output[$entity])?$conf->product->multidir_output[$entity]:$conf->service->multidir_output[$entity]).'/'.$original_file; - } - // Wrapping for products or services - elseif ($modulepart == 'tax') - { - if ($user->rights->tax->charges->lire) $accessallowed=1; - $original_file=$conf->tax->dir_output.'/'.$original_file; - } - // Wrapping for products or services - elseif ($modulepart == 'actions') - { - if ($user->rights->agenda->myactions->read) $accessallowed=1; - $original_file=$conf->agenda->dir_output.'/'.$original_file; - } - // Wrapping for categories - elseif ($modulepart == 'category') - { - if ($user->rights->categorie->lire) $accessallowed=1; - $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file; - } - // Wrapping pour les prelevements - elseif ($modulepart == 'prelevement') - { - if ($user->rights->prelevement->bons->lire) $accessallowed=1; - $original_file=$conf->prelevement->dir_output.'/receipts/'.$original_file; - } - // Wrapping pour les graph energie - elseif ($modulepart == 'graph_stock') - { - $accessallowed=1; - $original_file=$conf->stock->dir_temp.'/'.$original_file; - } - // Wrapping pour les graph fournisseurs - elseif ($modulepart == 'graph_fourn') - { - $accessallowed=1; - $original_file=$conf->fournisseur->dir_temp.'/'.$original_file; - } - // Wrapping pour les graph des produits - elseif ($modulepart == 'graph_product') - { - $accessallowed=1; - $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file; - } - // Wrapping pour les code barre - elseif ($modulepart == 'barcode') - { - $accessallowed=1; - // If viewimage is called for barcode, we try to output an image on the fly, - // with not build of file on disk. - //$original_file=$conf->barcode->dir_temp.'/'.$original_file; - $original_file=''; - } - // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'iconmailing') - { - $accessallowed=1; - $original_file=$conf->mailing->dir_temp.'/'.$original_file; - } - // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'scanner_user_temp') - { - $accessallowed=1; - $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; - } - // Wrapping pour les images fckeditor - elseif ($modulepart == 'fckeditor') - { - $accessallowed=1; - $original_file=$conf->fckeditor->dir_output.'/'.$original_file; - } - - // GENERIC Wrapping - // If modulepart=module_user_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp/iduser - // If modulepart=module_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp - // If modulepart=module_user Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/iduser - // If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart - else - { - if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file; - } - else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file; - } - else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file; - } - else - { - $perm=GETPOST('perm'); - $subperm=GETPOST('subperm'); - if ($perm || $subperm) - { - if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1; - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; - } - else - { - if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1; - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; - } - } - } -} +$check_access = dol_check_secure_access_document($modulepart,$original_file,$entity); +$accessallowed = $check_access['accessallowed']; +$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; +$original_file = $check_access['original_file']; // Security: // Limit access if permissions are wrong @@ -418,4 +196,4 @@ else // Open and return file if (is_object($db)) $db->close(); -?> +?> \ No newline at end of file diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index c10c4183468..08d21d5cba2 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -118,7 +118,7 @@ $contact_fields = array( //Retreive all extrafield for contact // fetch optionals attributes and labels $extrafields=new ExtraFields($db); -$extralabels=$extrafields->fetch_name_optionals_label('contact',true); +$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); if (count($extrafields)>0) { $extrafield_array = array(); } @@ -306,7 +306,7 @@ function getContact($authentication,$id,$ref='',$ref_ext='') //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('contact',true); + $extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); //Get extrafield values $contact->fetch_optionals($contact->id,$extralabels); @@ -413,7 +413,7 @@ function createContact($authentication,$contact) //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('contact',true); + $extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); foreach($extrafields->attribute_label as $key=>$label) { $key='options_'.$key; @@ -657,7 +657,7 @@ function updateContact($authentication,$contact) //Retreive all extrafield for contact // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('contact',true); + $extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); foreach($extrafields->attribute_label as $key=>$label) { $key='options_'.$key; diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 64bc426d144..bb296f56794 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -27,7 +27,7 @@ require_once '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -82,6 +82,21 @@ $server->wsdl->addComplexType( ) ); +// Define WSDL Return object for document +$server->wsdl->addComplexType( + 'document', + 'complexType', + 'struct', + 'all', + '', + array( + 'filename' => array('name'=>'filename','type'=>'xsd:string'), + 'mimetype' => array('name'=>'mimetype','type'=>'xsd:string'), + 'content' => array('name'=>'content','type'=>'xsd:string'), + 'length' => array('name'=>'length','type'=>'xsd:string') + ) +); + // Define other specific objects // None @@ -107,6 +122,20 @@ $server->register( 'WS to get Versions' ); +// Register WSDL +$server->register( + 'getDocument', + // Entry values + array('authentication'=>'tns:authentication', 'modulepart'=>'xsd:string', 'file'=>'xsd:string' ), + // Exit values + array('result'=>'tns:result','document'=>'tns:document'), + $ns, + $ns.'#getDocument', + $styledoc, + $styleuse, + 'WS to get document' +); + // Full methods code @@ -144,6 +173,150 @@ function getVersions($authentication) } +/* + * Method to get a document by webservice +* \param authentication array +* \param modulepart array Properties of document +* +*/ +function getDocument($authentication, $modulepart, $file) +{ + global $db,$conf,$langs,$mysoc; + + dol_syslog("Function: getDocument login=".$authentication['login'].' - modulepart='.$modulepart.' - file='.$file); + + if ($authentication['entity']) $conf->entity=$authentication['entity']; + + $objectresp=array(); + $errorcode='';$errorlabel=''; + $error=0; + + // Properties of doc + $original_file = $file; + $type=dol_mimetype($original_file); + $relativefilepath = $ref . "/"; + $relativepath = $relativefilepath . $ref.'.pdf'; + + $accessallowed=0; + + $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); + + if ($fuser->societe_id) $socid=$fuser->societe_id; + + // Check parameters + if (! $error && ( ! $file || ! $modulepart ) ) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter file and modulepart must be both provided."; + } + + if (! $error) + { + $fuser->getrights(); + + // Suppression de la chaine de caractere ../ dans $original_file + $original_file = str_replace("../","/", $original_file); + + // find the subdirectory name as the reference + $refname=basename(dirname($original_file)."/"); + + // Security check + $check_access = dol_check_secure_access_document($modulepart,$original_file,$conf->entity); + $accessallowed = $check_access['accessallowed']; + $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; + $original_file = $check_access['original_file']; + + // Basic protection (against external users only) + if ($fuser->societe_id > 0) + { + if ($sqlprotectagainstexternals) + { + $resql = $db->query($sqlprotectagainstexternals); + if ($resql) + { + $num=$db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + if ($fuser->societe_id != $obj->fk_soc) + { + $accessallowed=0; + break; + } + $i++; + } + } + } + } + + // Security: + // Limite acces si droits non corrects + if (! $accessallowed) + { + $errorcode='NOT_PERMITTED'; + $errorlabel='Access not allowed'; + $error++; + } + + // Security: + // On interdit les remontees de repertoire ainsi que les pipe dans + // les noms de fichiers. + if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file)) + { + dol_syslog("Refused to deliver file ".$original_file); + $errorcode='REFUSED'; + $errorlabel=''; + $error++; + } + + clearstatcache(); + + if(!$error) + { + if(file_exists($original_file)) + { + dol_syslog("Function: getDocument $original_file $filename content-type=$type"); + + $file=$fileparams['fullname']; + $filename = basename($file); + + $f = fopen($original_file,'r'); + $content_file = fread($f,filesize($original_file)); + + $objectret = array( + 'filename' => basename($original_file), + 'mimetype' => dol_mimetype($original_file), + 'content' => base64_encode($content_file), + 'length' => filesize($original_file) + ); + + // Create return object + $objectresp = array( + 'result'=>array('result_code'=>'OK', 'result_label'=>''), + 'document'=>$objectret + ); + } + else + { + dol_syslog("File doesn't exist ".$original_file); + $errorcode='NOT_FOUND'; + $errorlabel=''; + $error++; + } + } + } + + if ($error) + { + $objectresp = array( + 'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel) + ); + } + + return $objectresp; +} + // Return the results. $server->service($HTTP_RAW_POST_DATA); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 448da44ece2..a8ef028a9c8 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -124,7 +124,7 @@ $thirdparty_fields= array( //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); -$extralabels=$extrafields->fetch_name_optionals_label('company',true); +$extralabels=$extrafields->fetch_name_optionals_label('societe',true); if (count($extrafields)>0) { $extrafield_array = array(); } @@ -331,7 +331,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='') //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('company',true); + $extralabels=$extrafields->fetch_name_optionals_label('societe',true); //Get extrafield values $thirdparty->fetch_optionals($thirdparty->id,$extralabels); @@ -446,7 +446,7 @@ function createThirdParty($authentication,$thirdparty) //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('company',true); + $extralabels=$extrafields->fetch_name_optionals_label('societe',true); foreach($extrafields->attribute_label as $key=>$label) { $key='options_'.$key; @@ -567,7 +567,7 @@ function updateThirdParty($authentication,$thirdparty) //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('company',true); + $extralabels=$extrafields->fetch_name_optionals_label('societe',true); foreach($extrafields->attribute_label as $key=>$label) { $key='options_'.$key; diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 5b644b150bf..3a7d0a89283 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -187,7 +187,7 @@ $thirdpartywithuser_fields = array( //Retreive all extrafield for contact // fetch optionals attributes and labels $extrafields=new ExtraFields($db); -$extralabels=$extrafields->fetch_name_optionals_label('contact',true); +$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); if (count($extrafields)>0) { $extrafield_array = array(); } @@ -574,7 +574,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); - $extralabels=$extrafields->fetch_name_optionals_label('contact',true); + $extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); foreach($extrafields->attribute_label as $key=>$label) { $key='contact_options_'.$key; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index e62403366fb..2484bb2e541 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -39,7 +39,7 @@ if (! isset($argv[1]) || ! $argv[1] || ! in_array($argv[1],array('test','confirm { print "Usage: $script_file [test|confirm] [delay]\n"; print "\n"; - print "Send an email to users to remind all unpaid invoices of customers they are sale representative for.\n"; + print "Send an email to users to remind all unpaid customer invoices user is sale representative for.\n"; print "If you choose 'test' mode, no emails are sent.\n"; print "If you add a delay (nb of days), only invoice with due date < today + delay are included.\n"; exit; @@ -50,6 +50,7 @@ $mode=$argv[1]; require($path."../../htdocs/master.inc.php"); require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +$langs->load('main'); /* @@ -62,7 +63,7 @@ $duration_value=$argv[2]; $error = 0; print $script_file." launched with mode ".$mode.($duration_value?" delay=".$duration_value:"")."\n"; -$sql = "SELECT f.facnumber, f.total_ttc, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; +$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -110,7 +111,7 @@ if ($resql) if (dol_strlen($oldemail)) { $message .= $langs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n"; - print "Invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", linked to company ".$obj->name." with sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname)." qualified.\n"; + print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email.") qualified.\n"; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); } @@ -129,7 +130,7 @@ if ($resql) } else { - print "No unpaid invoices to companies linked to a particular commercial dolibarr user\n"; + print "No unpaid invoices (for companies linked to a particular commercial dolibarr user) found\n"; } } else @@ -213,6 +214,8 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang) } else { + print "No email sent (test mode)\n"; + dol_syslog("No email sent (test mode)"); $mail->dump_mail(); $result=1; } diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 0eaf6149f3b..d48ddfbdc29 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -324,19 +324,5 @@ class DateLibTest extends PHPUnit_Framework_TestCase return $result; } - /** - * testDolGetFirstDay - * - * @return void - */ - public function testDolGetFirstDay() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - } } -?> \ No newline at end of file +?>
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -387,21 +387,21 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print "
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index b628dc2d5db..a9de12c790a 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -304,26 +304,27 @@ if ($resql) $objp = $db->fetch_object($resql); $var=!$var; print '
'; + print ''; $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; print ''; - print ''; - print ''; - print '
'; + print ''; print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print ''; + print ''; 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 ''; + print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); - print '
'; + print '
'; print '
'; print $companystatic->getNomUrl(1,'customer'); - print ' '; // 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 (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) { - - print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom,'object_bill').''; + print ' '; + print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmrtphone').''; } } } @@ -375,10 +374,10 @@ if ($resql) print ''.price($objp->total_ht).''.price($objp->total_ht).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'
'.$langs->trans('TotalHT').''.$langs->trans('TotalHT').''.price($total).' '.price($total).' 
'; + print ''; $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; print ''; - print ''; - print ''; - print ''; // Statut - print ''; + print ''; // Checkbox print ''; print ''; - print ''; - print ''; @@ -505,9 +505,9 @@ if ($id > 0 || ! empty($ref)) print ''; - print '\n"; + print '\n"; - print '\n"; // Payment type @@ -636,11 +636,11 @@ if ($id > 0 || ! empty($ref)) // Amount if ($objp->amount < 0) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } // Balance diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 21a669d618a..78c3c6998fd 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -974,7 +974,7 @@ class Account extends CommonObject $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('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; } diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index e38ce88633a..da28602314a 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -238,10 +238,10 @@ if ($resql) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; print "\n"; @@ -258,12 +258,12 @@ if ($resql) // print "rowid."\">"; // Date op - print ''; + print ''; // Date value if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) { - print ''; + print ''; // Description print '"; // Date operation - print ''; + print ''; // Date de valeur - print '\n"; // Num cheque - print ''; + print ''; // Libelle print '"; // Ref - print ''; // Date ope - print '\n"; + print '\n"; // Date value - print '\n"; + print '\n"; // Payment type print "'."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") { @@ -391,7 +391,7 @@ foreach ($dirsociete as $dirroot) print ''; - print '\n"; + print '\n"; if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") { @@ -538,7 +538,7 @@ foreach ($dirsociete as $dirroot) $htmltooltip.='
'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1); - print '"; print ''; if (! $conf->use_javascript_ajax) { - print '"; } @@ -704,7 +704,7 @@ print ""; print ''; if (! $conf->use_javascript_ajax) { - print '"; } diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 11cb02e80ae..15ccdac8ef7 100755 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='company'; +$elementtype='societe'; //Must be the $element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index d6539f917cc..6c1387bc35b 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -131,19 +131,20 @@ if ($socid) print ''; } - print ''; - print ''; - // EMail - print ''; + print ''; // Web - print ''; + // Phone / Fax + print ''; + print ''; + print '
'; + print ''; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; + print ''; 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 ''; + print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; @@ -642,7 +642,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 7830abef655..2aad34cd229 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -351,10 +351,10 @@ if ($id > 0 || ! empty($ref)) print '
'; + print ''; $form->select_date($dateop,'op',0,0,0,'transaction'); print ''; + print ''; $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == 2 ? 'LIQ' : '')),'operation','1,2',2,1); print ''; print '
'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day"); + print ''.dol_print_date($db->jdate($objp->dv),"day"); print "'.price($objp->amount * -1).' '.price($objp->amount * -1).'   '.price($objp->amount).'  '.price($objp->amount).''.$langs->trans("DateValueShort").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Action").''.$langs->trans("ToConciliate").''.$langs->trans("ToConciliate").'
'.dol_print_date($db->jdate($objp->do),"day").''.dol_print_date($db->jdate($objp->do),"day").''; + print ''; print ''.dol_print_date($db->jdate($objp->dv),"day").""; print '   '; print ''; @@ -282,7 +282,7 @@ if ($resql) // Type + Number $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=''; - print ''.$label.($objp->num_chq?' '.$objp->num_chq:'').''.$label.($objp->num_chq?' '.$objp->num_chq:'').''; @@ -390,7 +390,7 @@ if ($resql) // If not already reconciliated if ($user->rights->banque->modifier) { - print ''; + print ''; print ''; print img_edit(); @@ -418,7 +418,7 @@ if ($resql) if ($db->jdate($objp->do) <= $now) { - print ''; + print ''; print 'rowid])?' checked="checked"':'').'>'; // print ''; // print '   '; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 044b4b70ebc..2a6ddd762d3 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -281,10 +281,10 @@ else print "
'.dol_print_date($db->jdate($objp->do),"day").''.dol_print_date($db->jdate($objp->do),"day").''; + print ''; print ''; print img_previous().' '; print dol_print_date($db->jdate($objp->dv),"day") .' '; @@ -293,7 +293,7 @@ else print "'.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 9117a099fb5..bdfda680d6d 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -209,15 +209,15 @@ if ($resql) print "
'; + print ''; print "rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."   "; print ''.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day")."'.dol_print_date($db->jdate($objp->dv),"day").""; @@ -266,7 +266,7 @@ if ($resql) } // Bank account - print ''; + print ''; $bankaccountstatic->id=$objp->bankid; $bankaccountstatic->label=$objp->bankref; print $bankaccountstatic->getNomUrl(1); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 05c60f59294..2c26a5d6361 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -205,7 +205,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $total = 0 ; print ''; print ''; - print ''; + print ''; print ""; print '"; print '"; diff --git a/htdocs/compta/dons/index.php b/htdocs/compta/dons/index.php index 13c4301dad5..bc258dec541 100644 --- a/htdocs/compta/dons/index.php +++ b/htdocs/compta/dons/index.php @@ -175,7 +175,7 @@ if ($resql) $donation_static->id=$obj->rowid; $donation_static->ref=$obj->ref?$obj->ref:$obj->rowid; - print ''; @@ -185,7 +185,7 @@ if ($resql) print dolGetFirstLastname($obj->nom,$obj->firstname); print ''; - print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6c190bac20b..1d6909874b1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -49,6 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load('bills'); $langs->load('companies'); $langs->load('products'); +$langs->load('banks'); $langs->load('main'); if (! empty($conf->margin->enabled)) $langs->load('margins'); @@ -655,14 +656,10 @@ else if ($action == 'add' && $user->rights->facture->creer) $error=0; - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=GETPOST($key); - } - } + // Fill array 'array_options' with data from add form + $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + // Replacement invoice if ($_POST['type'] == 1) @@ -878,17 +875,17 @@ else if ($action == 'add' && $user->rights->facture->creer) if ($_POST['type'] == 3) { $typeamount=GETPOST('typedeposit','alpha'); $valuedeposit=GETPOST('valuedeposit','int'); - + if ($typeamount=='amount') { $amountdeposit=$valuedeposit; }else { $amountdeposit=0; - + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - + $classname = ucfirst($subelement); $srcobject = new $classname($db); - + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit line"); $result=$srcobject->fetch($object->origin_id); if ($result > 0) @@ -900,7 +897,7 @@ else if ($action == 'add' && $user->rights->facture->creer) { $totalamount=+$lines[$i]->subprice; } - + if ($totalamount!=0) { $amountdeposit=($totalamount*$valuedeposit)/100; } @@ -910,9 +907,9 @@ else if ($action == 'add' && $user->rights->facture->creer) $mesgs[]=$srcobject->error; $error++; } - + } - + $result = $object->addline( $id, $langs->trans('Deposit'), @@ -940,7 +937,7 @@ else if ($action == 'add' && $user->rights->facture->creer) 0, $langs->trans('Deposit') ); - + }else { @@ -1859,7 +1856,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture- if ($action == 'update_extras') { // 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); // 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'); - /********************************************************************* * * Mode creation @@ -1905,7 +1901,7 @@ llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES if ($action == 'create') { $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')); @@ -2117,7 +2113,7 @@ if ($action == 'create') // Deposit print '"; $classname = "impayee"; - print '"; - print '"; - print ''; @@ -321,7 +321,7 @@ if ($id > 0 || ! empty($ref)) $var=!$var; print ""; - print ''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 5d42a44d54b..90adc2925c2 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref)) { $projectstatic->fetch($object->fk_project); - if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); + if (! empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); + } + + $object->project = dol_clone($projectstatic); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } @@ -114,7 +118,7 @@ if ($action=='delete') { $langs->load("other"); $file = $upload_dir . '/' . GETPOST('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,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 977858cf35b..275f54c5c44 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -50,7 +50,7 @@ $extrafields = new ExtraFields($db); $projectstatic = new Project($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('projet_task'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); /* * Actions */ diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index a97de4f9f4f..7f32feadccb 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -309,25 +309,25 @@ if ($id > 0 || ! empty($ref)) print ''; // Date - print ''; // Contributor - print ''; // Note - print ''; // Duration - print ''; @@ -470,7 +470,7 @@ if ($id > 0 || ! empty($ref)) $total += $task_time->task_duration; } print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("PeriodEndDate").''.$langs->trans("PeriodEndDate").'".$langs->trans("Label")."'.$langs->trans("ExpectedToPay")."'.$langs->trans("RefPayment")."'; + print ''; print $donation_static->getNomUrl(1); print ''; + print ''; print price($obj->amount,1); print '
'; print ''; - print ''; + print ''; $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); print ''; if (($origin=='propal') ) { @@ -2293,8 +2289,9 @@ if ($action == 'create') print ''; $newclassname=$classname; - if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; - elseif ($newclassname == 'Commande') $newclassname = 'Order'; + if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; + elseif ($newclassname == 'Commande') $newclassname = 'Order'; + elseif ($newclassname == 'Expedition') $newclassname = 'Sending'; print ''; print ''; @@ -2340,21 +2337,21 @@ if ($action == 'create') $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); print ''; print ''; - print ''; + print ''; print ''; // Si le module service est actif, on propose des dates de debut et fin a la ligne if (! empty($conf->service->enabled)) { - print ''; @@ -2399,7 +2396,7 @@ else if ($id > 0 || ! empty($ref)) $result=$object->fetch($id,$ref); // fetch optionals attributes and labels - $extralabels=$extrafields->fetch_name_optionals_label('facture'); + $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); if ($result > 0) { @@ -2449,7 +2446,6 @@ else if ($id > 0 || ! empty($ref)) $objectidnext=$object->getIdReplacingInvoice(); - $head = facture_prepare_head($object); dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); @@ -2691,6 +2687,8 @@ else if ($id > 0 || ! empty($ref)) print $formconfirm; + + // Invoice content print '
'.$desc.'
'.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
%% '; + print ''; print ''; - print ''; - print '
'; + print ''; print $langs->trans('From').' '; - print ''; + print ''; print $form->select_date('','date_start'.$i,$usehm,$usehm,1,"add"); print '
'; + print ''; print $langs->trans('to').' '; - print ''; + print ''; print $form->select_date('','date_end'.$i,$usehm,$usehm,1,"add"); print '
'; print '
'; @@ -2878,13 +2876,13 @@ else if ($id > 0 || ! empty($ref)) if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')
'; else print '. '; } - /*if ($object->statut == 0 && $object->type != 2 && $object->type != 3) - { - if (! $absolute_discount && ! $absolute_creditnote) print '
'; + //if ($object->statut == 0 && $object->type != 2 && $object->type != 3) + // { + //if (! $absolute_discount && ! $absolute_creditnote) print '
'; //print '   -   '; - print $addabsolutediscount; + //print $addabsolutediscount; //print '   -   '.$addcreditnote; // We disbale link to credit note - }*/ + //} print ''; // Date invoice @@ -2914,9 +2912,7 @@ else if ($id > 0 || ! empty($ref)) print ''; - /* - * List of payments - */ + // List of payments $sign=1; if ($object->type == 2) $sign=-1; @@ -3090,7 +3086,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessReceived'); print ' :'; print ''; - print ''; + print ''; } else // Credit note { @@ -3108,7 +3104,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessPaydBack'); print ' :'; print ''; - print ''; + print ''; // Sold credit note //print ''; @@ -3358,9 +3354,7 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; } - /* - * Lines - */ + // Lines $result = $object->getLinesArray(); if (! empty($conf->use_javascript_ajax) && $object->statut == 0) @@ -3374,9 +3368,7 @@ else if ($id > 0 || ! empty($ref)) if (! empty($object->lines)) $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') { $var=true; @@ -3408,9 +3400,7 @@ else if ($id > 0 || ! empty($ref)) print "\n"; - /* - * Boutons actions - */ + // Boutons actions if ($action != 'prerelance' && $action != 'presend') { @@ -3623,12 +3613,9 @@ else if ($id > 0 || ! empty($ref)) if ($action != 'prerelance' && $action != 'presend') { print '
'; - //print '
'.price($resteapayeraffiche).' 
 
'.price($sign * $resteapayeraffiche).' 
 
'.$langs->trans('TotalTTC').' :
'; - //print ''; // ancre + print ''; // ancre - /* - * Documents generes - */ + // Documents generes $filename=dol_sanitizeFileName($object->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); $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); $somethingshown=$formfile->numoffiles; - /* - * Linked object block - */ + // Linked object block $somethingshown=$object->showLinkedObjectBlock(); // Link for paypal payment @@ -3651,14 +3636,12 @@ else if ($id > 0 || ! empty($ref)) } print '
'; - //print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice',$socid); - //print '
'; print ''; } else diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 57f4be119e6..8d6fb63cf80 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -43,7 +43,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='facture'; +$elementtype='facture'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a2a9cf6da13..bd1c6d29d28 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -879,13 +879,9 @@ class Facture extends CommonInvoice 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('facture',true); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); if (count($extralabels)>0) { - $this->array_options = array(); - } - foreach($extrafields->attribute_label as $key=>$label) - { - $this->array_options['options_'.$key]=$label; + $this->fetch_optionals($this->id,$extralabels); } /* @@ -1302,7 +1298,7 @@ class Facture extends CommonInvoice { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); - + $num=count($this->lines); 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 * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 240ad867358..1d7fda3934f 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -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_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; 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 "; $sql.= " ORDER BY "; $listfield=explode(',',$sortfield); @@ -332,7 +332,7 @@ if ($resql) print "
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; @@ -341,17 +341,17 @@ if ($resql) print ''; // Ref - print ''; // Warning picto - print ''; // PDF Picto - print ''; - + // Remain to receive //print ''; // Status of invoice - print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 952fc760af5..aa685e11ab3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -209,7 +209,7 @@ if ($search_user > 0) } 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.paye, f.fk_statut,'; $sql.= ' s.nom, s.rowid'; @@ -322,7 +322,7 @@ if ($resql) $datelimit=$db->jdate($objp->datelimite); print ''; - print '
'; + print ''; print $facturestatic->getNomUrl(1); print ''; + print ''; if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print ''; + print ''; $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); @@ -380,12 +380,12 @@ if ($resql) if (! empty($objp->am) && ! empty($cn)) print '+'; if (! empty($cn)) print price($cn); print ''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''; + print ''; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print '
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; @@ -332,12 +332,12 @@ if ($resql) print ''; - print ''; - print ''; // Affiche statut de la facture - print '"; //print ""; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index bfc50b11ae8..0b4a341e1c2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -54,7 +54,8 @@ $endyear=$year; * View */ -$langs->load("bills"); +$langs->load("bills"); +$langs->load("companies"); $form=new Form($db); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ad4d032d5a9..e67e4868dcc 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -150,6 +150,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) */ if (! empty($conf->don->enabled) && $user->rights->don->lire) { + $langs->load("donations"); print ''; print ''; print '
'; + print ''; print $facturestatic->getNomUrl(1,'',200,0,$notetoshow); print $objp->increment; print ''; + print ''; $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; @@ -377,7 +377,7 @@ if ($resql) print ''.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):' ').''; + print ''; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type); print " 
'; @@ -167,6 +168,7 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire) */ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { + $langs->load("trips"); print ''; print ''; print '
'; @@ -217,19 +219,19 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - print ''; - print ''; - print ''; + print ''; print ''; $tot_ttc+=$obj->total_ttc; $i++; @@ -369,19 +371,19 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $obj = $db->fetch_object($resql); print ''; - print '"; - print ''; } - print '"; - print '"; print "\n"; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 9fb9aa8de51..0495a318d42 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -169,7 +169,7 @@ else $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); - dol_syslog("sql=".$sql); + dol_syslog("product:list.php: sql=".$sql); $resql = $db->query($sql); if ($resql) { @@ -363,7 +363,7 @@ else print ''; // Ref - print ''; + print ''; // Status (to sell) - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 52462c35bbc..f39a06f36c2 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -299,7 +299,7 @@ if ($resql) } $var=!$var; - print ''; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 744c15d78dc..7d92e1546ad 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -232,7 +232,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering model - print '"; - print ''; @@ -261,7 +261,7 @@ if ($id > 0 || ! empty($ref)) $var=!$var; print ""; - print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 12b4eb5f472..ce9189ce1c6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -135,58 +135,89 @@ $listofreferent=array( 'propal'=>array( 'title'=>"ListProposalsAssociatedProject", 'class'=>'Propal', + 'table'=>'propal', 'test'=>$conf->propal->enabled), 'order'=>array( 'title'=>"ListOrdersAssociatedProject", 'class'=>'Commande', + 'table'=>'commande', 'test'=>$conf->commande->enabled), 'invoice'=>array( 'title'=>"ListInvoicesAssociatedProject", 'class'=>'Facture', + 'table'=>'facture', 'test'=>$conf->facture->enabled), 'invoice_predefined'=>array( 'title'=>"ListPredefinedInvoicesAssociatedProject", 'class'=>'FactureRec', + 'table'=>'facture_rec', 'test'=>$conf->facture->enabled), 'order_supplier'=>array( 'title'=>"ListSupplierOrdersAssociatedProject", 'class'=>'CommandeFournisseur', + 'table'=>'commande_fournisseur', 'test'=>$conf->fournisseur->enabled), 'invoice_supplier'=>array( 'title'=>"ListSupplierInvoicesAssociatedProject", 'class'=>'FactureFournisseur', + 'table'=>'facture_fourn', 'test'=>$conf->fournisseur->enabled), 'contract'=>array( 'title'=>"ListContractAssociatedProject", 'class'=>'Contrat', + 'table'=>'contrat', 'test'=>$conf->contrat->enabled), 'intervention'=>array( 'title'=>"ListFichinterAssociatedProject", 'class'=>'Fichinter', + 'table'=>'fichinter', 'disableamount'=>1, 'test'=>$conf->ficheinter->enabled), 'trip'=>array( 'title'=>"ListTripAssociatedProject", 'class'=>'Deplacement', + 'table'=>'deplacement', 'disableamount'=>1, 'test'=>$conf->deplacement->enabled), 'agenda'=>array( 'title'=>"ListActionsAssociatedProject", 'class'=>'ActionComm', - 'disableamount'=>1, + 'table'=>'actioncomm', + 'disableamount'=>1, 'test'=>$conf->agenda->enabled) ); +if ($action=="addelement") +{ + $tablename = GETPOST("tablename"); + $elementselectid = GETPOST("elementselect"); + $project->update_element($tablename, $elementselectid); +} + foreach ($listofreferent as $key => $value) { $title=$value['title']; $classname=$value['class']; + $tablename=$value['table']; $qualified=$value['test']; if ($qualified) { print '
'; print_titre($langs->trans($title)); + + $selectList=$project->select_element($tablename); + if ($selectList) + { + print ''; + print ''; + print ''; + print '
'; + print '
'; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->nom=$obj->nom; $companystatic->client=1; print $companystatic->getNomUrl(1,'',16); print ''.price($obj->total_ttc).''.price($obj->total_ttc).'
'; + print ''; print ''; - print ''; - print ''; - print '"; - print ''; - - if ($user->rights->societe->client->voir) - { - $facture = new Facture($db); - - print ''; - } - - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } print '
'; + print ''; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; if ($obj->fk_statut == 1 && ! $obj->paye && $db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); print ''; + print ''; $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; @@ -761,19 +763,19 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $obj = $db->fetch_object($resql); print "
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; - print ''; - print ''; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 0f4264b223f..a7e92bc463c 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -177,7 +177,7 @@ abstract class CommonDocGenerator 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('company',true); + $extralabels = $extrafields->fetch_name_optionals_label('societe',true); $object->fetch_optionals($object->id,$extralabels); foreach($extrafields->attribute_label as $key=>$label) @@ -245,10 +245,10 @@ abstract class CommonDocGenerator $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), $array_key.'_payment_term_code'=>$object->cond_reglement_code, $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code)!='PaymentCondition'.$object->cond_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code):$object->cond_reglement), - $array_key.'_total_ht'=>price2num($object->total_ht2,2), - $array_key.'_total_vat'=>price2num($object->total_tva,2), - $array_key.'_total_ttc'=>price2num($object->total_ttc,2), - $array_key.'_total_discount_ht' => price2num($object->getTotalDiscount(),2), + $array_key.'_total_ht'=>price($object->total_ht2), + $array_key.'_total_vat'=>price($object->total_tva), + $array_key.'_total_ttc'=>price($object->total_ttc), + $array_key.'_total_discount_ht' => price($object->getTotalDiscount()), $array_key.'_vatrate'=>vatrate($object->tva), $array_key.'_note_private'=>$object->note, $array_key.'_note'=>$object->note_public, @@ -293,12 +293,12 @@ abstract class CommonDocGenerator 'line_product_label'=>$line->product_label, 'line_desc'=>$line->desc, 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), - 'line_up'=>price2num($line->subprice, 2), + 'line_up'=>price($line->subprice), 'line_qty'=>$line->qty, 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), - 'line_price_ht'=>price2num($line->total_ht,2), - 'line_price_ttc'=>price2num($line->total_ttc,2), - 'line_price_vat'=>price2num($line->total_tva,2), + 'line_price_ht'=>price($line->total_ht), + 'line_price_ttc'=>price($line->total_ttc), + 'line_price_vat'=>price($line->total_tva), 'line_date_start'=>$line->date_start, 'line_date_end'=>$line->date_end ); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 20d56ae6ef6..0359d9dde25 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -273,17 +273,17 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); - if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); - return $langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); + if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); + return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); } else { - if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); - elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); - else return $langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); + if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); + elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); + else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); } } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73d7e7b0e5d..7aac8234b5f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2020,9 +2020,10 @@ abstract class CommonObject // optionsArray not already loaded, so we load it require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $optionsArray = $extrafields->fetch_name_optionals_label(); + $optionsArray = $extrafields->fetch_name_optionals_label($this->table_element); } + // Request to get complementary values if (count($optionsArray) > 0) { @@ -2044,13 +2045,15 @@ abstract class CommonObject foreach ($tab as $key => $value) { - if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member') + //Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine) + if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key)) { // we can add this attribute to adherent object $this->array_options["options_$key"]=$value; } } } + $this->db->free($resql); } else @@ -2108,7 +2111,7 @@ abstract class CommonObject $langs->load('admin'); require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $optionsArray = $extrafields->fetch_name_optionals_label($this->elementType); + $optionsArray = $extrafields->fetch_name_optionals_label($this->table_element); foreach($this->array_options as $key => $value) { @@ -2443,6 +2446,7 @@ abstract class CommonObject 'SE', // Sweden 'SK', // Slovakia 'SI', // Slovenia + 'UK', // United Kingdom //'CH', // Switzerland - No. Swizerland in not in EEC ); //print "dd".$this->country_code; @@ -2743,7 +2747,7 @@ abstract class CommonObject print ''; - print ''; // No width to allow autodim + print ''; // No width to allow autodim print "\n"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e2986615dde..17226e7d461 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -152,11 +152,6 @@ class ExtraFields { $table=$elementtype.'_extrafields'; - // Special case for not normalized table names - if ($elementtype == 'member') $table='adherent_extrafields'; - elseif ($elementtype == 'company') $table='societe_extrafields'; - elseif ($elementtype == 'contact') $table='socpeople_extrafields'; - if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) { if ($type=='boolean') { @@ -283,11 +278,6 @@ class ExtraFields { $table=$elementtype.'_extrafields'; - // Special case for not normalized table names - if ($elementtype == 'member') $table='adherent_extrafields'; - elseif ($elementtype == 'company') $table='societe_extrafields'; - elseif ($elementtype == 'contact') $table='socpeople_extrafields'; - if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) { $result=$this->db->DDLDropField(MAIN_DB_PREFIX.$table,$attrname); // This also drop the unique key @@ -323,7 +313,7 @@ class ExtraFields { $sql = "DELETE FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " WHERE name = '".$attrname."'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (0,".$conf->entity.')'; $sql.= " AND elementtype = '".$elementtype."'"; dol_syslog(get_class($this)."::delete_label sql=".$sql); @@ -362,10 +352,6 @@ class ExtraFields function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='') { $table=$elementtype.'_extrafields'; - // Special case for not normalized table names - if ($elementtype == 'member') $table='adherent_extrafields'; - elseif ($elementtype == 'company') $table='societe_extrafields'; - elseif ($elementtype == 'contact') $table='socpeople_extrafields'; if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) { @@ -533,7 +519,7 @@ class ExtraFields * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED * @return array Array of attributes for all extra fields */ - function fetch_name_optionals_label($elementtype='member',$forceload=false) + function fetch_name_optionals_label($elementtype='adherent',$forceload=false) { global $conf; @@ -545,7 +531,7 @@ class ExtraFields $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; - $sql.= " WHERE entity = ".$conf->entity; + $sql.= " WHERE entity IN (0,".$conf->entity.")"; if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; $sql.= " ORDER BY pos"; @@ -557,7 +543,6 @@ class ExtraFields { while ($tab = $this->db->fetch_object($resql)) { - // we can add this attribute to adherent object if ($tab->type != 'separate') { @@ -574,6 +559,7 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; } } + return $array_name_label; } else @@ -688,9 +674,9 @@ class ExtraFields elseif ($type == 'sellist') { $out='
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -861,19 +863,19 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $obj = $db->fetch_object($resql); print '
'; + print ''; print ''; - print ''; - print ''; - print ''; print ''; - print '\n"; + print '\n"; print "\n"; } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 2d5e77a4065..0d46cd7ae11 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -59,7 +59,7 @@ function pt ($db, $sql, $date) $total = 0; print '
'; + print ''; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; if ($db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); print ''; + print ''; $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; @@ -941,7 +943,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $sql.= " AND ff.fk_statut = 1"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql.= " AND ff.fk_soc = ".$socid; - $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, s.nom, s.rowid"; + $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; + $sql.= " s.nom, s.rowid"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 2676dc78e94..d82e7fabad9 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -275,7 +275,7 @@ if (is_array($coll_list)) $diff = $x_paye_sum; print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'; print ''; - print ''; + print ''; print ''; print ''."\n"; print "\n"; @@ -69,10 +69,10 @@ function pt ($db, $sql, $date) $obj = $db->fetch_object($result); $var=!$var; print ''; - print '\n"; + print '\n"; $total = $total + $obj->mm; - print '\n"; + print '\n"; print "\n"; $i++; @@ -179,9 +179,9 @@ for ($m = 1 ; $m < 13 ; $m++ ) if ($i > 2) { print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 0cc7e2008e6..78c81f9ab9c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -151,7 +151,7 @@ if ($socid > 0) // Author $userstatic->id=$objf->userid; $userstatic->login=$objf->login; - print ''; @@ -191,7 +191,7 @@ if ($socid > 0) // Author $userstatic->id=$objp->userid; $userstatic->login=$objp->login; - print ''; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6fbd0a23143..f62b2fcc594 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='rowid'; + public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dcb082b41d7..452de21285a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("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,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } @@ -172,7 +172,7 @@ if ($object->id) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); // List of document diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 516f1bb9326..2c5f1736d1b 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -204,7 +204,7 @@ if ($resql) // Due date print ''; - print ''; + print ''; print ''; $i++; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 6adbd4ebf06..ebfe0c4834b 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -47,7 +47,7 @@ if (! $sortorder) $sortorder="asc"; if (! $sortfield) $sortfield="name"; // Category -$selected_cat = (int)GETPOST('search_categ', 'int'); +$selected_cat = (int) GETPOST('search_categ', 'int'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 32d527cc779..63ca148e5c3 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -45,7 +45,7 @@ if (! $sortfield) $sortfield="nom"; $socid = GETPOST('socid','int'); // Category -$selected_cat = (int)GETPOST('search_categ', 'int'); +$selected_cat = (int) GETPOST('search_categ', 'int'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; @@ -185,7 +185,7 @@ if ($modecompta == 'CREANCES-DETTES') { } if ($selected_cat && $selected_cat !== -2) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = ".$selected_cat; - if (subcat) { + if ($subcat) { $sql.=" OR c.fk_parent = " . $selected_cat; } $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_categorie = c.rowid"; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 64abd53ae15..2d90767cffb 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -352,7 +352,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) // Montant total if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) { - print '"; + print '"; } else { @@ -364,7 +364,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($total[$annee-1] && $total[$annee]) { $percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100); - print ''; + print ''; } if ($total[$annee-1] && ! $total[$annee]) { diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 956edd92ff7..a5e0e7fdbb9 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -316,7 +316,7 @@ if (is_array($coll_list)) $diff = $x_coll_sum - $x_paye_sum; print ''; print ''; - print '\n"; + print '\n"; print "\n"; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 53473ed68ff..354d8c86535 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -64,7 +64,7 @@ function pt ($db, $sql, $date) $total = 0; print '
'.$date.''.$date.''.$langs->trans("Amount").' 
'.$obj->dm."'.$obj->dm."'.price($obj->mm)." '.price($obj->mm)." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotalpaye).''.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotalpaye).' 
'; + print ''; print $userstatic->getLoginUrl(1); print ''; + print ''; print $userstatic->getLoginUrl(1); print ''.dol_print_date($db->jdate($obj->date_ech), 'day').''.$chargesociale_static->LibStatut($obj->paye,5).''.$chargesociale_static->LibStatut($obj->paye,5).'
'.($total[$annee]?price($total[$annee]):"0")."'.($total[$annee]?price($total[$annee]):"0")."'.($percent>=0?"+$percent":"$percent").'%'.($percent>=0?"+$percent":"$percent").'%
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'; print ''; - print ''; + print ''; print ''; print ''."\n"; print "\n"; @@ -74,10 +74,10 @@ function pt ($db, $sql, $date) $obj = $db->fetch_object($result); $var=!$var; print ''; - print '\n"; + print '\n"; $total = $total + $obj->mm; - print '\n"; + print '\n"; print "\n"; $i++; @@ -188,9 +188,9 @@ for ($m = 1 ; $m < 13 ; $m++ ) if ($i > 2) { print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index e5aa35a1c05..393a9ee4efc 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -293,13 +293,13 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; print ''; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index cf03b860ba6..88c1be06409 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -617,7 +617,7 @@ else $diff = $x_coll_sum - $x_paye_sum; print ''; print ''; - print '\n"; + print '\n"; print "\n"; $i++; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a41aaf6b366..db8b408e6ed 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -36,6 +36,7 @@ class Contact extends CommonObject { public $element='contact'; public $table_element='socpeople'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $civilite_id; // In fact we store civility_code @@ -944,10 +945,10 @@ class Contact extends CommonObject } elseif ($mode == 5) { - if ($statut==0) return $langs->trans('StatusContactDraftShort').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0'); - elseif ($statut==1) return $langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1'); - elseif ($statut==4) return $langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut4'); - elseif ($statut==5) return $langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut5'); + if ($statut==0) return ''.$langs->trans('StatusContactDraftShort').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0'); + elseif ($statut==1) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1'); + elseif ($statut==4) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut4'); + elseif ($statut==5) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut5'); } } diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index c3f9f2605ee..5149eed9efb 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -29,26 +29,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; $langs->load("companies"); // Security check -$contactid = isset($_GET["id"])?$_GET["id"]:''; +$id = GETPOST('id', 'int'); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); /* * View */ -llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); + +llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); $form = new Form($db); $contact = new Contact($db); -$contact->fetch($_GET["id"], $user); +$contact->fetch($id, $user); $head = contact_prepare_head($contact); -dol_fiche_head($head, 'exportimport', $langs->trans("ContactsAddresses"), 0, 'contact'); +dol_fiche_head($head, 'exportimport', $title, 0, 'contact'); /* @@ -97,7 +99,7 @@ print ''; print '
'; print $langs->trans("ExportCardToFormat").': '; -print ''; +print ''; print img_picto($langs->trans("VCard"),'vcard.png').' '; print $langs->trans("VCard"); print ''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 9711654fa03..abb19b2cc91 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -53,7 +53,7 @@ $object = new Contact($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('contact'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($id); @@ -67,7 +67,7 @@ if (! empty($canvas)) } // Security check -$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', '', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('contactcard')); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index bb1114c18da..f284ee1834d 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -35,12 +35,12 @@ $langs->load("admin"); $action=GETPOST('action'); // Security check -$contactid = isset($_GET["id"])?$_GET["id"]:''; +$id = GETPOST('id', 'int'); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $contact = new Contact($db); -$contact->fetch($_GET["id"], $user); +$contact->fetch($id, $user); /* @@ -79,13 +79,15 @@ if ($action == 'dolibarr2ldap') * View */ -llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); + +llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); $form = new Form($db); $head = contact_prepare_head($contact); -dol_fiche_head($head, 'ldap', $langs->trans("ContactsAddresses"), 0, 'contact'); +dol_fiche_head($head, 'ldap', $title, 0, 'contact'); print '
'.$date.''.$date.''.$langs->trans("Amount").' 
'.$obj->dm."'.$obj->dm."'.price($obj->mm)." '.price($obj->mm)." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).''.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).' 
'.$langs->trans("Total").':'.price($subtot_coll_total).''.price($subtot_coll_vat).''.price($subtot_coll_total).''.price($subtot_coll_vat).''.price($subtot_paye_total).''.price($subtot_paye_vat).''.price($subtot_paye_total).''.price($subtot_paye_vat).''.price($total).''; + print ''.price($total).''; print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a6108ab9e8e..505992341de 100755 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -369,7 +369,7 @@ if ($result) print ''; diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index d321e07a258..86462d05fae 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -69,7 +69,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact $now=dol_now(); -llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); + +llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); $form = new Form($db); @@ -77,7 +79,7 @@ $object->fetch($id, $user); $head = contact_prepare_head($object); -dol_fiche_head($head, 'perso', $langs->trans("ContactsAddresses"), 0, 'contact'); +dol_fiche_head($head, 'perso', $title, 0, 'contact'); if ($action == 'edit') { diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index f9f4c80fad1..48189eb60f6 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -29,8 +29,13 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; +$id = GETPOST('id', 'int'); + +// Security check +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); + $contact = new Contact($db); -$result=$contact->fetch($_GET["id"]); +$result=$contact->fetch($id); $physicalperson=1; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index afbc82ab391..39d4d7aac60 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -284,14 +284,14 @@ class Contrat extends CommonObject global $langs, $conf; $error=0; - + // Definition du nom de module de numerotation de commande $soc = new Societe($this->db); $soc->fetch($this->socid); - + // Class of company linked to order $result=$soc->set_as_client(); - + // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { @@ -552,8 +552,8 @@ class Contrat extends CommonObject $line->libelle = $objp->description; $line->desc = $objp->description; $line->qty = $objp->qty; - $line->statut = $objp->statut; - $line->ref = $objp->ref; + $line->statut = $objp->statut; + $line->ref = ''; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; @@ -667,7 +667,7 @@ class Contrat extends CommonObject $error=0; $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat"); - + // Mise a jour ref $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; if ($this->db->query($sql)) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index d3ef925158b..ae5a1190c49 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1171,10 +1171,10 @@ else } if ($conf->margin->enabled) - print ''; + print ''; // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) - print ''; print ''; print ''; - print ''; + print ''; if ($conf->margin->enabled) { print ''; - print ''; - print ''; - print ''; @@ -481,12 +481,12 @@ if ($resql) $var=!$var; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 868b8cc1a0d..ea42df9e01d 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -247,7 +247,7 @@ if ($resql) if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late")); else print '    '; print ''; - print '
'; print ''.img_object($langs->trans("AddAction"),"action").''; print '   '; - print ''; + print ''; print img_picto($langs->trans("VCard"),'vcard.png').' '; print ''.price($objp->pa_ht).''.price($objp->pa_ht).''; + print ''; if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; @@ -1272,7 +1272,7 @@ else print '%%'; if ($objp->fk_product) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 2e9ab1b1cb6..845eaad86bb 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -334,7 +334,7 @@ if ($result) $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid); $staticcontrat->id=$obj->cid; print $staticcontrat->getNomUrl(1,16); @@ -400,7 +400,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); @@ -426,7 +426,7 @@ if ($resql) $staticcompany->nom=$obj->nom; print $staticcompany->getNomUrl(1,'',20); print ''; + print ''; $dateend=$db->jdate($obj->date_fin_validite); print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0); print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); print ''; + print ''; if ($obj->fk_product > 0) { $productstatic->id=$obj->fk_product; @@ -561,12 +561,12 @@ if ($resql) $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); print ''; + print ''; if ($obj->fk_product > 0) { $productstatic->id=$obj->fk_product; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 2155b3d9720..2042b5c45f7 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -133,7 +133,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; print '
'; + print ''; print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .''; if ($obj->nb_late) print img_warning($langs->trans("Late")); print ''; + print ''; if ($obj->cstatut == 0) // If contract is draft, we say line is also draft { print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)); diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 324339f5b25..50305655dcd 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -68,7 +68,6 @@ if ($boxorder && $zone != '' && $userid > 0) // boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B" dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG); - //$infobox=new InfoBox($db); $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); } diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 6c6a6d8d036..cbc8e7ee5b7 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -114,7 +114,7 @@ class box_actions extends ModeleBoxes 'text' => dol_trunc($objp->nom,24), 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid); - $this->info_box_contents[$i][4] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"', 'text' => dol_print_date($datelimite, "dayhour")); $this->info_box_contents[$i][5] = array('td' => 'align="right"', diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 87e555958e8..ad0da9451e9 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -41,9 +41,23 @@ class box_activity extends ModeleBoxes var $info_box_head = array(); var $info_box_contents = array(); - // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. - // FIXME: Removed number_format (not compatible with all languages) - // FIXME: Pb into some status + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. + // FIXME: Removed number_format (not compatible with all languages) + // FIXME: Pb into some status + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) + } /** * Charge les donnees en memoire pour affichage ulterieur diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 5fc8d2add91..2df5f0dd002 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -39,22 +39,23 @@ class box_comptes extends ModeleBoxes var $db; var $param; var $enabled = 1; - + var $info_box_head = array(); var $info_box_contents = array(); - + /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { global $conf, $user; - + $this->db = $db; - + // disable module for such cases $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index cf2ee151ebe..7dea6ed7f04 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -114,7 +114,7 @@ class box_contracts extends ModeleBoxes $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datec,'day')); - $this->info_box_contents[$i][5] = array('td' => 'align="right" nowrap="nowrap"', + $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', 'text' => $contractstatic->getLibStatut(6), 'asis'=>1 ); diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index faf8f872ecc..09b56cff52e 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -39,11 +39,12 @@ class box_external_rss extends ModeleBoxes var $depends = array("externalrss"); var $db; - var $param; + var $paramdef; // Params of box definition (not user params) var $info_box_head = array(); var $info_box_contents = array(); + /** * Constructor * @@ -53,7 +54,7 @@ class box_external_rss extends ModeleBoxes function __construct($db,$param) { $this->db=$db; - $this->param=$param; + $this->paramdef=$param; } /** @@ -71,7 +72,7 @@ class box_external_rss extends ModeleBoxes $this->max=$max; // On recupere numero de param de la boite - preg_match('/^([0-9]+) /',$this->param,$reg); + preg_match('/^([0-9]+) /',$this->paramdef,$reg); $site=$reg[1]; // Create dir nor required diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 78a81139654..765224baccc 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -112,7 +112,7 @@ class box_ficheinter extends ModeleBoxes $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datec,'day')); - $this->info_box_contents[$i][5] = array('td' => 'align="right" nowrap="nowrap"', + $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', 'text' => $ficheinterstatic->getLibStatut(6), 'asis'=>1 ); diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php new file mode 100644 index 00000000000..3ec5add8a05 --- /dev/null +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -0,0 +1,148 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_invoice_permonth.php + * \ingroup factures + * \brief Box to show graph of invoices per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last invoices + */ +class box_graph_invoices_permonth extends ModeleBoxes +{ + var $boxcode="invoicespermonth"; + var $boximg="object_bill"; + var $boxlabel="BoxInvoicesPerMonth"; + var $depends = array("facture"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $facturestatic=new Facture($db); + + $text = $langs->trans("BoxInvoicesPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1 + ); + + if ($user->rights->facture->lire) + { + $sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df"; + $sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; + $sql.= ", s.nom, s.rowid as socid"; + $sql.= ", f.date_lim_reglement as datelimite"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.entity = ".$conf->entity; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " ORDER BY f.tms DESC"; + $sql.= $db->plimit($max, 0); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $now=dol_now(); + + $i = 0; + $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + + while ($i < $num) + { + $objp = $db->fetch_object($result); + $datelimite=$db->jdate($objp->datelimite); + $datec=$db->jdate($objp->datec); + + $picto='bill'; + if ($objp->type == 1) $picto.='r'; + if ($objp->type == 2) $picto.='a'; + $late = ''; + if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));} + + $i++; + } + + $this->info_box_contents[0][0] = array('td' => 'align="center"','text2'=>'xxxxxxx'); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql)); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 91d3cd918b9..fdb6db8c7f5 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -39,25 +39,26 @@ class box_members extends ModeleBoxes var $db; var $param; var $enabled = 1; - + var $info_box_head = array(); var $info_box_contents = array(); /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { global $conf, $user; $this->db = $db; - + // disable module for such cases $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); - if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users + if (! in_array('adherent',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users } /** diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 7eda1bc04b3..c9e668b271e 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -120,7 +120,7 @@ class box_produits extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $price); - $this->info_box_contents[$i][3] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"', 'text' => $price_base_type); $this->info_box_contents[$i][4] = array('td' => 'align="right"', diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 57c2cc4de4c..a003451d8e9 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -127,7 +127,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $price); - $this->info_box_contents[$i][3] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"', 'text' => $price_base_type); $this->info_box_contents[$i][4] = array('td' => 'align="center"', diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index c681395f5af..140b5c757f9 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -40,6 +40,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" var $box_order; var $fk_user; var $sourcefile; + var $class; var $box_id; var $note; @@ -47,9 +48,10 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { $this->db=$db; } @@ -162,11 +164,13 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" } if ($conf->use_javascript_ajax) { - print ''; + print ''; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"'); print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); - print ''; + $label=$head['text']; + if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; + print ''; print '
'; } print '
'; - - if ($user->rights->societe->client->voir) - { - // Liste de "Other orders" - print ''; - } - print ''; } // Factures if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { - print ''; + $invoice = new Facture($db); - if ($user->rights->societe->client->voir) - { - print ''; - } - else - { - print ''; - } + $langs->load("bills"); - print ''; - - // Liste de Mes factures - print 'rights->societe->client->voir?' width="50%"':'').' valign="top">'; - - $sql = "SELECT s.nom, s.rowid as socid, f.rowid as factureid, f.facnumber, f.datef as df"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut = 0"; - $sql.= " AND f.fk_user_author = ".$user->id; - $sql.= " ORDER BY f.datec DESC, f.rowid DESC"; - - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $var=true; - print '
'; + $ret.=''; if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; @@ -344,7 +344,7 @@ class Form * Show a text and picto with tooltip on text or picto * * @param string $text Text to show - * @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded. + * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. * @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2 * @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres * @param string $img Code img du picto (use img_xxx() function to get it) @@ -383,7 +383,7 @@ class Form //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; + if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; $ret.=$langs->trans($text); $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'
'; @@ -692,6 +692,7 @@ class Form //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); /* +<<<<<<< HEAD if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -699,6 +700,15 @@ class Form $product->fetch($selected); $selected_input_value=$product->ref; } +======= + if ($selected && empty($selected_input_value)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($this->db); + $product->fetch($selected); + $selected_input_value=$product->ref; + } +>>>>>>> refs/remotes/origin/3.3 // mode=1 means customers products $ajaxoptions=array(); $urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype; @@ -2878,7 +2888,7 @@ class Form print ''; print ''; print ''; - print ''; - print ''; - print '"; // Show file name with link to download - $out.= ''; // Show file date $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); - $out.= ''; + $out.= ''; if ($delallowed) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index a0d63e42b4a..c87f2df36dd 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -886,7 +886,9 @@ class FormOther foreach($boxactivated as $box) { if (! empty($boxidactivatedforuser[$box->id])) continue; // Already visible for user - $arrayboxtoactivatelabel[$box->id]=$langs->transnoentitiesnoconv($box->boxlabel); // We keep only boxes not shown for user, to show into combo list + $label=$langs->transnoentitiesnoconv($box->boxlabel); + if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')'; + $arrayboxtoactivatelabel[$box->id]=$label; // We keep only boxes not shown for user, to show into combo list } $form=new Form($db); @@ -897,7 +899,7 @@ class FormOther if (! empty($conf->use_javascript_ajax)) { print ''."\n"; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 1a4cd9d4244..07ca9026482 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -27,6 +27,9 @@ */ class InfoBox { + static $listOfPages = array(0=>'Home'); // Nom des positions 0=Home, 1=... + + /** * Return array of boxes qualified for area and user * @@ -57,17 +60,16 @@ class InfoBox $sql.= " ORDER BY b.box_order"; } else - { + { $sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { - + if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) + { $sql.= " WHERE entity IN (1,".$conf->entity.")"; // TODO add method for define another master entity - - } else { - + } + else + { $sql.= " WHERE entity = ".$conf->entity; - } } @@ -95,18 +97,24 @@ class InfoBox $relsourcefile = "/core/boxes/".$boxname.".php"; } + // TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then + // the "enabled" condition for modules forbidden for external users and the depends condition can be done. + // Goal is to avoid making a new instance for each boxes returned by select. + dol_include_once($relsourcefile); if (class_exists($boxname)) { - $box=new $boxname($db,$obj->note); + $box=new $boxname($db,$obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params. + //$box=new stdClass(); // box properties $box->rowid = (empty($obj->rowid) ? '' : $obj->rowid); $box->id = (empty($obj->box_id) ? '' : $obj->box_id); - $box->position = (empty($obj->position) ? '' : $obj->position); + $box->position = ($obj->position == '' ? '' : $obj->position); // '0' must staty '0' $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user); - $box->sourcefile=$relsourcefile; + $box->sourcefile= $relsourcefile; + $box->class = $boxname; if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database { if (is_numeric($box->box_order)) @@ -119,6 +127,8 @@ class InfoBox $box->box_id = (empty($obj->box_id) ? '' : $obj->box_id); $box->note = (empty($obj->note) ? '' : $obj->note); + // Filter on box->enabled (fused for example by box_comptes) and box->depends + //$enabled=1; $enabled=$box->enabled; if (isset($box->depends) && count($box->depends) > 0) { @@ -131,6 +141,7 @@ class InfoBox //print 'xx module='.$module.' enabled='.$enabled; if ($enabled) $boxes[]=$box; + else unset($box); } } $j++; diff --git a/htdocs/core/filemanagerdol/browser/default/frmupload.php b/htdocs/core/filemanagerdol/browser/default/frmupload.php index 18496585bd2..dd58eded713 100755 --- a/htdocs/core/filemanagerdol/browser/default/frmupload.php +++ b/htdocs/core/filemanagerdol/browser/default/frmupload.php @@ -124,12 +124,12 @@ window.onload = function()
'; + print '
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice @@ -2893,7 +2903,7 @@ class Form if ($filter) $newfilter.=' AND ('.$filter.')'; $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); print ''; + print ''; if ($nbqualifiedlines > 0) { print '   load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid); - $previous_ref = $object->ref_previous?''.img_previous().'':''; - $next_ref = $object->ref_next?''.img_next().'':''; + $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; + $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; //print "xx".$previous_ref."x".$next_ref; if ($previous_ref || $next_ref || $morehtml) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 699977c05ff..5d2fbf4f225 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -91,7 +91,7 @@ class FormFile if (! empty($options)) print ''.$options.''; + print ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu @@ -383,6 +383,19 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); + +// Keep this. Used for test with jmobile +/*print ' + + + +';*/ + if (empty($noform)) $out.= '
'; $out.= ''; $out.= ''; @@ -479,7 +492,7 @@ class FormFile $out.= "
'; + $out.= ''; $out.= ''; + $out.= ''.dol_print_size($size).''.dol_print_date($date, 'dayhour').''.dol_print_date($date, 'dayhour').'
- diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 51bda89ffd0..0f1da52c46e 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -48,6 +48,8 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests $arrayofjs=array(); $arrayofcss=array(); +$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); +$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); print ''."\n"; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index a11fdac4dda..2e2d764b861 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -60,40 +60,40 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print '
+ Upload a new file in this folder
- +
  
'; if ($canedit || ! empty($conf->projet->enabled)) { - print ''; - - if ($user->rights->societe->client->voir) - { - // Liste de "Other propals" - print ''; - } - print ''; } @@ -1441,261 +1370,87 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status) $langs->load("orders"); - print ''; + print ''; + print ''; + print ''; + print ''; } + print '
'; + print '
'; print ''; if ($canedit) { print ''; - print ''; print ''; print ''; - print ''; print ''; - print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); print ''; - print ''; - print ''; } @@ -114,7 +114,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; // Buttons - print '
'; + print ''; print $langs->trans("ActionsAskedBy"); - print '  '; + print '  '; print $form->select_dolusers($filtera,'userasked',1,'',!$canedit); print '
'; + print ''; print $langs->trans("or").' '.$langs->trans("ActionsToDoBy"); - print '  '; + print '  '; print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit); print '
'; + print ''; print $langs->trans("or").' '.$langs->trans("ActionsDoneBy"); - print '  '; + print '  '; print $form->select_dolusers($filterd,'userdone',1,'',!$canedit); print '
'; + print ''; print $langs->trans("Type"); - print '  '; + print '  '; print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0)); @@ -103,9 +103,9 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { print '
'; + print ''; print $langs->trans("Project").'   '; - print ''; + print ''; select_projects($socid?$socid:-1, $pid, 'projectid', 64); print '
'; + print ''; print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; print '
'; print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' '; @@ -127,7 +127,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt // Legend if ($conf->use_javascript_ajax && is_array($showextcals)) { - print '
'; + print ''; print ''."\n"; } // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) { print ''."\n"; } @@ -1317,7 +1327,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '
'."\n"; - if (empty($_SESSION['dol_hide_topmenu']) && ! GETPOST('dol_hide_topmenu')) + if (empty($conf->dol_hide_topmenu)) { print '
'."\n"; @@ -1418,9 +1428,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a print "\n"; - if (empty($conf->use_javascript_ajax) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print ''; - - + //XXX if (empty($conf->use_javascript_ajax) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '
'; + if (empty($conf->dol_hide_leftmenu) && (empty($conf->use_javascript_ajax) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))) print '
'; } @@ -1448,10 +1457,11 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('searchform','leftblock')); - if (empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu')) + if (empty($conf->dol_hide_leftmenu)) { if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'
'."\n"; - else print '
'; + //XXX else print ''; + else print ''; // End div id="id-left" } print "\n"; @@ -1637,10 +1653,10 @@ function main_area($title='') if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print '
'."\n"; - print '
'; + //XXX else print ''; + else print '
'; print "\n"; @@ -1490,7 +1500,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Execute hook printSearchForm $parameters=array(); - $searchform.=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + $searchform.=$hookmanager->resPrint; + } + else $searchform=$hookmanager->resPrint; // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) @@ -1549,7 +1564,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print '
'; if ($doliurl) print ''; print $appli; - if ($doliurlx) print ''; + if ($doliurl) print ''; print '
'; // Link to Dolibarr wiki pages @@ -1613,7 +1628,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print $leftblock; if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '
'."\n"; - else print '
'; + //print '
'; } - - print '
'."\n"; + //XXX print ''."\n"; + if (empty($conf->dol_hide_leftmenu)) print '
'; print "\n"; @@ -1765,14 +1781,17 @@ if (! function_exists("llxFooter")) print '
'."\n"; - print "\n".'
'."\n"; - if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '
'."\n"; + //XXX print "\n".'
'."\n"; + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print ' '."\n"; + if (empty($conf->dol_hide_leftmenu)) print ''; // End div id-right print "\n"; if ($foot) print ''."\n"; printCommonFooter(); + if (empty($conf->dol_hide_leftmenu)) print ''; // End div container + print "\n"; print "\n"; } diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 990f9430345..a8d6d0d4e6e 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -126,7 +126,7 @@ print ''; print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; $var=true; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 7212ea38f5b..3008884a59e 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -143,7 +143,10 @@ if (! defined('NOREQUIREDB')) { $conf->entity = DOLENTITY; } - // TODO Multicompany Remove this. + else if (!empty($_COOKIE['DOLENTITY'])) // For other application with MultiCompany module + { + $conf->entity = $_COOKIE['DOLENTITY']; + } else if (! empty($conf->multicompany->force_entity) && is_int($conf->multicompany->force_entity)) // To force entity in login page { $conf->entity = $conf->multicompany->force_entity; diff --git a/htdocs/opensurvey/admin/index.php b/htdocs/opensurvey/admin/index.php index 9617a9c7ee6..6ab9c74dc24 100755 --- a/htdocs/opensurvey/admin/index.php +++ b/htdocs/opensurvey/admin/index.php @@ -29,7 +29,8 @@ require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); // Security check if (!$user->admin) accessforbidden(); - +$langs->load("admin"); +$langs->load("other"); /* @@ -40,7 +41,9 @@ $langs->load("opensurvey"); llxHeader(); -print_fiche_titre($langs->trans("OpenSurveyArea")); +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("OpenSurveyArea"),$linkback,'setup'); +print '
'; echo $langs->trans("OpenSurveyNothingToSetup").'

'."\n"; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index ce41a83e70a..8af6c133004 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -227,7 +227,7 @@ foreach ($dirproduct as $dirroot) print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; if (! empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) { @@ -333,7 +333,7 @@ print ''; print ''; if (empty($conf->use_javascript_ajax)) { - print ''; } diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 69bc6f481b2..98b85746051 100755 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -43,7 +43,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='product'; +$elementtype='product'; //Must be the $element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 396695aa98d..88360e6ec1d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -668,6 +668,17 @@ class Product extends CommonObject } } } + + // 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); + } + } if (! $error) { @@ -1803,7 +1814,7 @@ class Product extends CommonObject $result=$this->del_sousproduit($id_pere, $id_fils); if ($result < 0) return $result; - + // Check not already father of id_pere (to avoid father -> child -> father links) $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; @@ -1852,11 +1863,11 @@ class Product extends CommonObject { if (! is_numeric($fk_parent)) $fk_parent=0; if (! is_numeric($fk_child)) $fk_child=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = ".$fk_parent; $sql.= " AND fk_product_fils = ".$fk_child; - + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { @@ -2122,7 +2133,7 @@ class Product extends CommonObject * Define value of this->res * * @param array $prod Products array - * @param string $compl_path Directory path + * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level * @return void @@ -2132,65 +2143,36 @@ class Product extends CommonObject global $conf,$langs; $product = new Product($this->db); - foreach($prod as $nom_pere => $desc_pere) + //var_dump($prod); + foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product { if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs { $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + if ($multiply < 1) $multiply=1; - if ($multiply) - { - //print "XXX ".$desc_pere[1]." multiply=".$multiply; - $img=""; - $this->fetch($id); - $this->load_stock(); - if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte) - { - $img=img_warning($langs->trans("StockTooLow")); - } - $this->res[]= array( -/* " - ", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - else - { - $this->fetch($desc_pere[0]); - $this->load_stock(); - $this->res[]= array( -/* $compl_path.$nom_pere." (".$desc_pere[1].")", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product + //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; + $this->fetch($id); + $this->load_stock(); + $this->res[]= array( + 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - } - else if($nom_pere != "0" && $nom_pere != "1") - { - $this->res[]= array($compl_path.$nom_pere,$desc_pere); + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product + ); } // Recursive call if child is an array - if (is_array($desc_pere[0])) + if (is_array($desc_pere['childs'])) { - $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); } } } @@ -2227,11 +2209,12 @@ class Product extends CommonObject $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { - foreach($this->sousprods as $nom_pere => $desc_pere) + foreach($this->sousprods as $prod_name => $desc_product) { - if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply); + if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply); } } + //var_dump($this->res); return $this->res; } @@ -2292,7 +2275,7 @@ class Product extends CommonObject /** - * Return all parent products fo current product + * Return all direct parent products fo current product * * @return array prod */ @@ -2323,19 +2306,19 @@ class Product extends CommonObject } /** - * Return childs of product with if fk_parent + * Return childs of product $id * - * @param int $fk_parent Id of product to search childs of + * @param int $id Id of product to search childs of * @return array Prod */ - function getChildsArbo($fk_parent) + function getChildsArbo($id) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; - $sql.= " AND pa.fk_product_pere = ".$fk_parent; - $sql.= " AND pa.fk_product_fils != ".$fk_parent; // This should not happens, it is to avoid invinite loop if it happens + $sql.= " AND pa.fk_product_pere = ".$id; + $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); @@ -2350,7 +2333,7 @@ class Product extends CommonObject $listofchilds=$this->getChildsArbo($rec['id']); foreach($listofchilds as $keyChild => $valueChild) { - $prods[$rec['rowid']][$keyChild] = $valueChild; + $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } } @@ -2372,14 +2355,14 @@ class Product extends CommonObject function get_sousproduits_arbo() { $parent = $this->getParent(); - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value[0]=id { foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) { $parent[$key][$keyChild] = $valueChild; } } - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value is array of childs { $this->sousprods[$key] = $value; } @@ -2417,7 +2400,7 @@ class Product extends CommonObject else if ($option == 'category') { $lien = ''; - } + } else { $lien = ''; diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 395275a9911..71ce35c76e1 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -198,15 +198,18 @@ if ($id || $ref) print ''; // Number of subproducts - $prodsfather = $product->getFather(); //Parent Products + $prodsfather = $product->getFather(); // Parent Products $product->get_sousproduits_arbo(); - print ''; + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); + print ''; dol_fiche_end(); - // List of subproducts - $prods_arbo = $product->get_arbo_each_prod(); + // List of products into this virtual product if (count($prods_arbo) > 0) { print ''; + //print ''; print ''; if (! empty($conf->stock->enabled)) print ''; print ''; @@ -231,8 +235,10 @@ if ($id || $ref) print ''; } - // Number of parent products - print ''; + // Number of parent virtual products + print ''; if (count($prodsfather) > 0) { @@ -286,12 +292,14 @@ if ($id || $ref) // Number of subproducts $prodsfather = $product->getFather(); //Parent Products $product->get_sousproduits_arbo(); - print ''; + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); + print ''; print ''; // List of subproducts - $prods_arbo = $product->get_arbo_each_prod(); - //var_dump($prods_arbo); if(count($prods_arbo) > 0) { print ''; } - // Number of parent products - print ''; + // Number of parent virtual products + print ''; if (count($prodsfather) > 0) { diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 143ed6e9551..632540df203 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -57,7 +57,7 @@ $object = new Product($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('product'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); if ($id > 0 || ! empty($ref)) { @@ -1316,6 +1316,7 @@ print "\n
\n"; if ($object->id && ($action == '' || $action == 'view') && $object->status) { print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Details").''.$langs->trans("Description").'
'.$modCodeProduct->nom.''.$modCodeProduct->info($langs).''.$modCodeProduct->getExample($langs).''.$modCodeProduct->getExample($langs).'
'.$langs->trans("UseSearchToSelectProduct").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print '
      -> - ".$compl_path.stripslashes($nom_pere)." - (".$desc_pere[1].") ".($desc_pere[1]*$multiply)."  ".$this->stock_entrepot[1]." ".$img."
'.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).'
'.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print '
'; @@ -223,6 +226,7 @@ if ($id || $ref) //print $productstatic->getNomUrl(1).'
'; //print $value[0]; // This contains a tr line. print '
'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').')    '.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '.$langs->trans("Stock").' : '.$productstatic->stock_reel.'
'.$langs->trans("ParentProductsNumber").''.count($prodsfather).'
'.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print '
'.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).'
'.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print '
'; @@ -316,8 +324,10 @@ if ($id || $ref) print '
'.$langs->trans("ParentProductsNumber").''.count($prodsfather).'
'.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print '
'; + //print '
'; // Propals if (! empty($conf->propal->enabled) && $user->rights->propale->creer) @@ -1324,113 +1325,41 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status) $langs->load("propal"); - print '
'; + print ''; + print ''; + print ''; + print ''; } + print '
'; - print $langs->trans("AddToMyProposals") . '
'.$langs->trans("AddToOtherProposals").'
'; - if ($user->rights->societe->client->voir) + $var=true; + $otherprop = $propal->liste_array(2,1,0); + print ''; + print ''; + print ''; + if (is_array($otherprop) && count($otherprop)) { - print ''; + $var=!$var; + print ''; + print ''; } else { - print ''; - } - - print ''; - - // Liste de "Mes propals" - print 'rights->societe->client->voir?' width="50%"':'').' valign="top">'; - - $sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.ref, p.datep as dp"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; - $sql.= " WHERE p.fk_soc = s.rowid"; - $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND p.fk_statut = 0"; - $sql.= " AND p.fk_user_author = ".$user->id; - $sql.= " ORDER BY p.datec DESC, p.tms DESC"; - - $result=$db->query($sql); - if ($result) - { - $var=true; - $num = $db->num_rows($result); - print '
'; - print $langs->trans("AddToOtherProposals").'
'; + print ''; + print $langs->trans("Proposals").''; + print $form->selectarray("propalid", $otherprop, 0, 1); + print '
'.$langs->trans("Quantity").' '; + print ''.$langs->trans("ReductionShort").'(%) '; + print ''; + print ''; + print ''; + print '
 
'; - if ($num) - { - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ''; - print ''; - print ''; - print ""; - print '\n"; - print "\n"; - print "\n"; - print ''; - print ''; - print ''; - $i++; - } - } - else { - print ""; - } - print "
'; - print "propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."socid."\">".dol_trunc($objp->nom,18)."".dol_print_date($objp->dp,"%d %b")."'; - print ''.$langs->trans("ReductionShort"); - print '%'; - if (isset($object->stock_proposition)) print " ".$object->stock_proposition; - print ''; - print ''; - print '
"; - print $langs->trans("NoOpenedPropals"); - print "
"; - $db->free($result); + print "
"; + print $langs->trans("NoOtherOpenedPropals"); + print '
'; + print ''; print '
'; - - $var=true; - $otherprop = $propal->liste_array(1,1,1); - print '
'; - print ''; - print ''; - if (is_array($otherprop) && count($otherprop)) - { - $var=!$var; - print ''; - print ''; - } - else - { - print "'; - } - print '
'; - print ''; - print $langs->trans("OtherPropals").''; - print $form->selectarray("propalid", $otherprop); - print '
'.$langs->trans("Qty"); - print ''.$langs->trans("ReductionShort"); - print '%'; - print ''; - print ''; - print '
"; - print $langs->trans("NoOtherOpenedPropals"); - print '
'; - print '
'; - - print '
'; - print $langs->trans("AddToMyOrders").'
'.$langs->trans("AddToOtherOrders").'
'; - if ($user->rights->societe->client->voir) + $var=true; + $othercom = $commande->liste_array(2, 1, null); + print '
'; + print ''; + print ''; + if (is_array($othercom) && count($othercom)) { - print ''; + $var=!$var; + print ''; + print ''; } else - { - print ''; - } - - print ''; - - // Liste de "Mes commandes" - print 'rights->societe->client->voir?' width="50%"':'').' valign="top">'; - - $sql = "SELECT s.nom, s.rowid as socid, c.rowid as commandeid, c.ref, c.date_commande as dc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; - $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND c.fk_statut = 0"; - $sql.= " AND c.fk_user_author = ".$user->id; - $sql.= " ORDER BY c.date_creation DESC"; - - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $var=true; - print '
'; - print $langs->trans("AddToOtherOrders").'
'; + print ''; + print $langs->trans("Orders").''; + print $form->selectarray("commandeid", $othercom, 0, 1); + print '
'.$langs->trans("Quantity").' '; + print ''.$langs->trans("ReductionShort").'(%) '; + print ''; + print ''; + print ''; + print '
 
'; - if ($num) - { - $i = 0; - while ($i < $num) - { - $objc = $db->fetch_object($result); - $var=!$var; - print ''; - print ''; - print ''; - print ""; - print '\n"; - print "\n"; - print "\n"; - print ''; - print ''; - print ''; - $i++; - } - } - else - { - print "'; - } - print "
'; - print "commandeid."\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."socid."\">".dol_trunc($objc->nom,18)."".dol_print_date($db->jdate($objc->dc),"%d %b")."'; - print ''.$langs->trans("ReductionShort"); - print '%'; - if (isset($object->stock_proposition)) print " ".$object->stock_proposition; - print ''; - print ''; - print '
"; - print $langs->trans("NoOpenedOrders"); - print '
"; - $db->free($result); + { + print "
"; + print $langs->trans("NoOtherOpenedOrders"); + print '
'; + print ''; print '
'; - - $var=true; - $othercom = $commande->liste_array(1, $user); - print '
'; - print ''; - print ''; - if (is_array($othercom) && count($othercom)) - { - $var=!$var; - print ''; - print ''; - } - else - { - print "'; - } - print '
'; - print ''; - print $langs->trans("OtherOrders").''; - print $form->selectarray("commandeid", $othercom); - print '
'.$langs->trans("Qty"); - print ''.$langs->trans("ReductionShort"); - print '%'; - print ''; - print ''; - print '
"; - print $langs->trans("NoOtherOpenedOrders"); - print '
'; - print '
'; - - print '
'; - print $langs->trans("AddToMyBills").''; - print $langs->trans("AddToOtherBills").' 
'; - if ($num) - { - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ''; - print ''; - print ''; - print ""; - print "\n"; - print "\n"; - print "\n"; - print ''; - print ''; - print ''; - $i++; - } - } - else { - print "'; - } - print "
"; - print "factureid."\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."socid."\">".dol_trunc($objp->nom,18)."".dol_print_date($db->jdate($objp->df),"%d %b")."'; - print ''.$langs->trans("ReductionShort"); - print '%'; - print ''; - print ''; - print '
"; - print $langs->trans("NoDraftBills"); - print '
"; - $db->free($result); - } - else - { - dol_print_error($db); - } - - print '
'; - - // Liste de Autres factures - $var=true; - - $sql = "SELECT s.nom, s.rowid as socid, f.rowid as factureid, f.facnumber, f.datef as df"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut = 0"; - $sql.= " AND f.fk_user_author <> ".$user->id; - $sql.= " ORDER BY f.datec DESC, f.rowid DESC"; - - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $var=true; - print ''; - if ($num) - { - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - - $var=!$var; - print ''; - print ''; - print ''; - print ""; - print "\n"; - print "\n"; - print ""; - print ''; - print ''; - print ''; - $i++; - } - } - else - { - print "'; - } - print "
factureid."\">$objp->facnumbersocid."\">".dol_trunc($objp->nom,24)."".$langs->trans("Qty"); - print "'; - print ''.$langs->trans("ReductionShort"); - print '%'; - print ''; - print ''; - print '
"; - print $langs->trans("NoOtherDraftBills"); - print '
"; - $db->free($result); - } - else - { - dol_print_error($db); - } - - print '
'.$langs->trans("AddToOtherOrders").'
'; + + $var=true; + $otherinvoice = $invoice->liste_array(2, 1, null); + print '
'; + print ''; + print ''; + if (is_array($otherinvoice) && count($otherinvoice)) + { + $var=!$var; + print ''; + print ''; + } + else + { + print "'; + } + print '
'; + print ''; + print $langs->trans("Invoice").''; + print $form->selectarray("factureid", $otherinvoice, 0, 1); + print '
'.$langs->trans("Quantity").' '; + print ''.$langs->trans("ReductionShort").'(%) '; + print ''; + print ''; + print ''; + print '
"; + print $langs->trans("NoOtherDraftBills"); + print '
'; + print '
'; + + print '
'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index e973516f5f9..247ddf7d5ff 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -220,7 +220,7 @@ if ($result) $var=!$var; print "
'; + print ''; $product_static->id=$objp->rowid; $product_static->ref=$objp->ref; $product_static->type=$objp->fk_product_type; @@ -238,10 +238,10 @@ if ($result) else print price($objp->price).' '.$langs->trans("HT"); print ''; + print ''; print $product_static->LibStatut($objp->tosell,5,0); print "'; + print ''; print $product_static->LibStatut($objp->tobuy,5,1); print "
'; + print ''; $product_static->id = $objp->rowid; $product_static->ref = $objp->ref; $product_static->type = $objp->fk_product_type; @@ -439,10 +439,10 @@ else } // Status (to buy) - print ''.$product_static->LibStatut($objp->tosell,5,0).''.$product_static->LibStatut($objp->tosell,5,0).''.$product_static->LibStatut($objp->tobuy,5,1).''.$product_static->LibStatut($objp->tobuy,5,1).'
'; + print '
'; $product_static->ref=$objp->ref; $product_static->id=$objp->rowid; $product_static->type=$objp->fk_product_type; @@ -324,8 +324,8 @@ if ($resql) print $objp->stock_physique; print ''.$langs->trans("Movements").''.$product_static->LibStatut($objp->statut,5,0).''.$product_static->LibStatut($objp->tobuy,5,1).''.$product_static->LibStatut($objp->statut,5,0).''.$product_static->LibStatut($objp->tobuy,5,1).'
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index e397b7c7c1a..a23da939757 100755 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='projet'; +$elementtype='projet'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 321936ad6a9..e6376bbe7eb 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -36,6 +36,7 @@ class Project extends CommonObject public $table_element = 'projet'; //!< Name of table without prefix where object is stored public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $ref; @@ -52,6 +53,7 @@ class Project extends CommonObject var $statuts_short; var $statuts; var $oldcopy; + /** * Constructor @@ -474,6 +476,12 @@ class Project extends CommonObject } } + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_extrafields"; + $sql.= " WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")"; + + dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); + $resql = $this->db->query($sql); + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task"; $sql.= " WHERE fk_projet=" . $this->id; @@ -485,6 +493,13 @@ class Project extends CommonObject dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); + + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; + $sql.= " WHERE fk_object=" . $this->id; + + dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { // We remove directory @@ -820,11 +835,11 @@ class Project extends CommonObject { // To verify role of users $userAccess = 0; - if (($mode == 'read' && $user->rights->projet->all->lire) || ($mode == 'write' && $user->rights->projet->all->creer) || ($mode == 'delete' && $user->rights->projet->all->supprimer)) + if (($mode == 'read' && ! empty($user->rights->projet->all->lire)) || ($mode == 'write' && ! empty($user->rights->projet->all->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->all->supprimer))) { $userAccess = 1; } - else if ($this->public && (($mode == 'read' && $user->rights->projet->lire) || ($mode == 'write' && $user->rights->projet->creer) || ($mode == 'delete' && $user->rights->projet->supprimer))) + else if ($this->public && (($mode == 'read' && ! empty($user->rights->projet->lire)) || ($mode == 'write' && ! empty($user->rights->projet->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->supprimer)))) { $userAccess = 1; } @@ -1262,7 +1277,86 @@ class Project extends CommonObject } return $result; } + + /** + * Build Select List of element associable to a project + * + * @param TableName Table of the element to update + * @return string The HTML select list of element + */ + function select_element($Tablename) + { + global $db; + $projectkey="fk_projet"; + switch ($Tablename) + { + case "facture": + case "facture_fourn": + $sql = "SELECT rowid, facnumber as ref"; + break; + case "facture_rec": + $sql = "SELECT rowid, titre as ref"; + break; + case "actioncomm": + $sql = "SELECT id as rowid, label as ref"; + $projectkey="fk_project"; + break; + default: + $sql = "SELECT rowid, ref"; + break; + } + + $sql.= " FROM ".MAIN_DB_PREFIX.$Tablename; + $sql.= " WHERE ".$projectkey." is null"; + $sql.= " AND fk_soc=".$this->societe->id; + $sql.= " ORDER BY ref DESC"; + + dol_syslog("Project.Lib::select_element sql=".$sql); + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) + { + $sellist = ''; + } + return $sellist ; + } + } + + /** + * Associate element to a project + * + * @param TableName Table of the element to update + * @param ElementSelectId Key-rowid of the line of the element to update + * @return int 1 if OK or < 0 if KO + */ + function update_element($TableName, $ElementSelectId) + { + global $db; + $sql="update ".MAIN_DB_PREFIX.$TableName; + if ($TableName=="actioncomm") + { + $sql.= " SET fk_project=".$this->id; + $sql.= " WHERE id=".$ElementSelectId; + } + else + { + $sql.= " SET fk_projet=".$this->id; + $sql.= " WHERE rowid=".$ElementSelectId; + } + $resql=$db->query($sql); + } } ?> diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ac29870106b..a177ddf838b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -183,6 +183,7 @@ class Task extends CommonObject $sql.= " t.label,"; $sql.= " t.description,"; $sql.= " t.duration_effective,"; + $sql.= " t.datec,"; $sql.= " t.dateo,"; $sql.= " t.datee,"; $sql.= " t.fk_user_creat,"; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 4f6ba12b1f3..2f253112cdf 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -222,7 +222,7 @@ if ($id > 0 || ! empty($ref)) // Ligne ajout pour contact interne print "
'; + print ''; print img_object('','user').' '.$langs->trans("Users"); print '
'; + print ''; print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); print '
'; + print ''; + print ''; + print '
'.$langs->trans("SelectElement").''.$selectList.'
'; + print ''; + } print ''; print ''; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 7df49a38bd0..17e5975a272 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -44,12 +44,6 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti $mine = GETPOST('mode')=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects - -// Security check -$socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; -$result = restrictedArea($user, 'projet', $id); - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('projectcard')); @@ -61,8 +55,13 @@ if ($object->id > 0) $object->fetch_thirdparty(); } +// Security check +$socid=0; +if ($user->societe_id > 0) $socid=$user->societe_id; +$result = restrictedArea($user, 'projet', $object->id); + // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('projet'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int')); $date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));; @@ -137,7 +136,7 @@ if ($action == 'add' && $user->rights->projet->creer) $object->datec=dol_now(); $object->date_start=$date_start; $object->date_end=$date_end; - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -209,7 +208,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $object->public = GETPOST('public','alpha'); $object->date_start = empty($_POST["project"])?'':$date_start; $object->date_end = empty($_POST["projectend"])?'':$date_end; - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -560,7 +559,7 @@ else { print $object->showOptionals($extrafields,'edit'); } - + print '
'; print '

'; @@ -741,10 +740,13 @@ else print '
'; - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'project',$socid); + if (!empty($object->id)) + { + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'project',$socid); + } print '
'; } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index d7eb62f927a..0cd8fd9ca64 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load("projects"); $langs->load("companies"); -$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +$mine = GETPOST('mode')=='mine' ? 1 : 0; // Security check $socid=0; @@ -49,7 +49,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $socstatic=new Societe($db); $projectstatic=new Project($db); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:($user->rights->projet->all->lire?2:0)),1); +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1); //var_dump($projectsListId); @@ -64,7 +64,7 @@ print_fiche_titre($text); if ($mine) print $langs->trans("MyProjectsDesc").'

'; else { - if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; + if (! empty($user->rights->projet->all->lire) && ! $socid) print $langs->trans("ProjectsDesc").'

'; else print $langs->trans("ProjectsPublicDesc").'

'; } @@ -90,7 +90,7 @@ $sql.= ", s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql.= " WHERE p.entity = ".$conf->entity; -if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; +if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " GROUP BY s.nom, s.rowid"; @@ -106,7 +106,7 @@ if ( $resql ) $obj = $db->fetch_object($resql); $var=!$var; print "
'; + print ''; if ($obj->socid) { $socstatic->id=$obj->socid; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d9530f2d232..b79bb65ed74 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -44,6 +44,7 @@ $mine = ($mode == 'mine' ? 1 : 0); //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $object = new Project($db); +$taskstatic = new Task($db); $extrafields_project = new ExtraFields($db); $extrafields_task = new ExtraFields($db); if ($ref) @@ -54,8 +55,8 @@ if ($ref) // fetch optionals attributes and labels if (!empty($id)) { - $extralabels_projet=$extrafields_project->fetch_name_optionals_label('projet'); - $extralabels_task=$extrafields_task->fetch_name_optionals_label('projet_task'); + $extralabels_projet=$extrafields_project->fetch_name_optionals_label($object->table_element); + $extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->table_element); } @@ -167,7 +168,6 @@ if ($action == 'createtask' && $user->rights->projet->creer) $form=new Form($db); $formother=new FormOther($db); -$taskstatic = new Task($db); $userstatic=new User($db); $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 710990ac1c6..5f8fd84c6e4 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -288,7 +288,7 @@ if ($id > 0 || ! empty($ref)) // Ligne ajout pour contact interne print "
'; + print ''; print img_object('','user').' '.$langs->trans("Users"); print '
'; + print ''; print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); print '
'; + print ''; $newdate=dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]); print $form->select_date($newdate,'time','','','',"timespent_date"); print ''; + print ''; $contactoftask=$object->getListContactId('internal'); print img_object('','user'); print $form->select_users($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$contactoftask); print ''; + print ''; print ''; print ''; + print ''; print $form->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:'')); print '
'.$langs->trans("Total").''.convertSecondToTime($total).' '.convertSecondToTime($total).' 
"; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 1c03c17c5b5..f4acea385ea 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -38,48 +38,55 @@ global $dolibarr_main_demo; if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,1); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('demo')); - -$demoprofiles=array( - array('default'=>'1', 'key'=>'profdemoservonly','label'=>'DemoCompanyServiceOnly', - 'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,mailmanspip,margin,prelevement,product,stock', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png'), - array('default'=>'-1','key'=>'profdemoshopwithdesk','label'=>'DemoCompanyShopWithCashDesk', - 'disablemodules'=>'adherent,boutique,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,product,stock', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), - array('default'=>'0', 'key'=>'profdemoprodstock','label'=>'DemoCompanyProductAndStocks', - 'disablemodules'=>'adherent,boutique,contrat,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,service', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), - array('default'=>'0', 'key'=>'profdemoall','label'=>'DemoCompanyAll', - 'disablemodules'=>'adherent,boutique,don,externalsite,mailmanspip', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'), - array('default'=>'-1', 'key'=>'profdemofun','label'=>'DemoFundation', - 'disablemodules'=>'banque,barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,margin,prelevement,product,projet,propal,propale,service,societe,stock,tax', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'), - array('default'=>'0', 'key'=>'profdemofun2','label'=>'DemoFundation2', - 'disablemodules'=>'barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,margin,prelevement,product,projet,propal,propale,service,societe,stock,tax', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png') -); +$res=$hookmanager->initHooks(array('demo')); +$demoprofiles=array(); +$alwayscheckedmodules=array(); +$alwaysuncheckedmodules=array(); +$alwayshiddencheckedmodules=array(); +$alwayshiddenuncheckedmodules=array(); $tmpaction = 'view'; $parameters=array(); $object=new stdClass(); $reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - -// Visible -$alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want -$alwaysuncheckedmodules=array('paybox','paypal','google','scanner','workflow'); // Module we never want -// Not visible -$alwayshiddencheckedmodules=array('accounting','barcode','bookmark','clicktodial','comptabilite','document','domain','externalrss','externalsite','fckeditor','geoipmaxmind','gravatar','label','ldap', - 'mailmanspip','notification','syslog','user','webservices', - // Extended modules - 'memcached','numberwords','zipautofillfr'); -$alwayshiddenuncheckedmodules=array('boutique','ftp', - // Extended modules - 'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','customfield','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','multicompany','nltechno','numberingpack','openstreetmap', - 'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail'); +if (empty($reshook)) +{ + $demoprofiles=array( + array('default'=>'1', 'key'=>'profdemoservonly','label'=>'DemoCompanyServiceOnly', + 'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,mailmanspip,margin,prelevement,product,stock', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png'), + array('default'=>'-1','key'=>'profdemoshopwithdesk','label'=>'DemoCompanyShopWithCashDesk', + 'disablemodules'=>'adherent,boutique,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,product,stock', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), + array('default'=>'0', 'key'=>'profdemoprodstock','label'=>'DemoCompanyProductAndStocks', + 'disablemodules'=>'adherent,boutique,contrat,categorie,don,externalsite,ficheinter,mailmanspip,prelevement,service', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), + array('default'=>'0', 'key'=>'profdemoall','label'=>'DemoCompanyAll', + 'disablemodules'=>'adherent,boutique,don,externalsite,mailmanspip', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'), + array('default'=>'-1', 'key'=>'profdemofun','label'=>'DemoFundation', + 'disablemodules'=>'banque,barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,margin,prelevement,product,projet,propal,propale,service,societe,stock,tax', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'), + array('default'=>'0', 'key'=>'profdemofun2','label'=>'DemoFundation2', + 'disablemodules'=>'barcode,boutique,cashdesk,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,facture,ficheinter,fournisseur,mailmanspip,margin,prelevement,product,projet,propal,propale,service,societe,stock,tax', + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png') + ); + + // Visible + $alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want + $alwaysuncheckedmodules=array('paybox','paypal','google','scanner','workflow'); // Module we never want + // Not visible + $alwayshiddencheckedmodules=array('accounting','barcode','bookmark','clicktodial','comptabilite','document','domain','externalrss','externalsite','fckeditor','geoipmaxmind','gravatar','label','ldap', + 'mailmanspip','notification','syslog','user','webservices', + // Extended modules + 'memcached','numberwords','zipautofillfr'); + $alwayshiddenuncheckedmodules=array('boutique','ftp', + // Extended modules + 'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','customfield','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','multicompany','nltechno','numberingpack','openstreetmap', + 'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail'); +} // Search modules $dirlist=$conf->file->dol_document_root; @@ -151,8 +158,8 @@ foreach ($modulesdir as $dir) // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) $modulequalified=0; + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) $modulequalified=0; if ($modulequalified) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index d6368514821..358201aa4a7 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -75,6 +75,8 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) exit; } +$extrafields = new ExtraFields($db); + /** * Show header for new member @@ -245,11 +247,10 @@ if ($action == 'add') $adh->morphy = $_POST["morphy"]; $adh->birth = $birthday; - foreach($_POST as $key => $value){ - if (preg_match("/^options_/",$key)){ - $adh->array_options[$key]=$_POST[$key]; - } - } + + // Fill array 'array_options' with data from add form + $extralabels=$extrafields->fetch_name_optionals_label($adh->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels,$adh); $result=$adh->create($user->id); if ($result > 0) @@ -360,8 +361,7 @@ if ($action == 'added') $form = new Form($db); $formcompany = new FormCompany($db); $adht = new AdherentType($db); -$extrafields = new ExtraFields($db); -$extrafields->fetch_name_optionals_label('member'); // fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels llxHeaderVierge($langs->trans("NewSubscription")); @@ -576,7 +576,7 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT) $amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT; } // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal' or 'paybox' - print '
'.$langs->trans("Subscription").''; + print '
'.$langs->trans("Subscription").''; if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { print ''; diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index d250b838386..0fc725c8ed4 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -69,7 +69,7 @@ $extrafields = new ExtraFields($db); llxHeaderVierge($langs->trans("MemberCard")); // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('member'); +$extralabels=$extrafields->fetch_name_optionals_label('adherent'); if ($id > 0) { $res=$object->fetch($id); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index a2460c6cda4..36adc4f38b2 100755 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='contact'; +$elementtype='socpeople'; //Must be the $element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 1cd6fef8b4b..d4bc91b6b65 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -314,7 +314,7 @@ foreach ($dirsociete as $dirroot) print '
'.$modCodeTiers->nom.''.$modCodeTiers->info($langs).''.$modCodeTiers->getExample($langs).''.$modCodeTiers->getExample($langs).''.$modCodeCompta->nom."\n"; print $modCodeCompta->info($langs); print ''.$modCodeCompta->getExample($langs)."'.$modCodeCompta->getExample($langs)."'; + print ''; if ($module->type == 'pdf') { $linkspec=''.img_object($langs->trans("Preview"),'bill').''; @@ -675,7 +675,7 @@ print "
'.$langs->trans("UseSearchToSelectCompany").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "
'.$langs->trans("UseSearchToSelectContact").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "
'.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'
'.$langs->trans('EMail').''; + print '
'.$langs->trans('EMail').''; print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL'); - print '
'.$langs->trans('Web').''; + print '
'.$langs->trans('Web').''; print dol_print_url($soc->url); print '
'.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'
'; print ''; diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index b16db4916cb..478d24a4e8f 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -182,8 +182,8 @@ for ($i=1; $i<=4; $i++) {
trans('VATIsUsed'); ?> control->tpl['yn_assujtva']; ?>trans('VATIntra'); ?>control->tpl['tva_intra']; ?>trans('VATIntra'); ?>control->tpl['tva_intra']; ?>
trans('VATIsUsed'); ?> control->tpl['yn_assujtva']; ?>trans('VATIntra'); ?>control->tpl['tva_intra']; ?>trans('VATIntra'); ?>control->tpl['tva_intra']; ?>
trans("Country"); ?>control->tpl['country']; ?>control->tpl['country']; ?>
trans('VATIsUsed'); ?> control->tpl['tva_assuj']; ?>trans('VATIntra'); ?>trans('VATIntra'); ?> control->tpl['tva_intra']; ?>
trans("Country"); ?>control->tpl['country']; ?>control->tpl['country']; ?>
'; + print ''; $documentstatic->id=$objp->doc_id; $documentstatic->ref=$objp->doc_number; $documentstatic->type=$objp->type; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 90513c239de..66cbb3e2523 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -197,7 +197,7 @@ if ($result) $var=!$var; print "
'; + print ''; $thirdparty_static->id=$objp->rowid; $thirdparty_static->name=$objp->name; $thirdparty_static->client=$objp->client; @@ -231,7 +231,7 @@ if ($result) print ''; print dol_print_date($thirdparty_static->datem,'day'); print "'; + print ''; print $thirdparty_static->getLibStatut(3); print "
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').''.$langs->trans('Web').'
'; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print ''.$langs->trans('VATIntra').''; + print ''.$langs->trans('VATIntra').''; $s = ''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) @@ -887,7 +889,7 @@ else print "}\n"; print ''; print "\n"; - $s.=''.$langs->trans("VATIntraCheck").''; + $s.=''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); } else @@ -923,7 +925,8 @@ else print '
'.$langs->trans('Capital').' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans('Capital').' '; + print ''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Logo").''; print ''; @@ -1256,14 +1259,14 @@ else print '
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').''.$langs->trans('Web').'
'.$langs->trans('VATIntra').''; + print ''.$langs->trans('VATIntra').''; $s =''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) @@ -1548,7 +1551,7 @@ else print '
'.$langs->trans("Country").''; + print '
'.$langs->trans("Country").''; $img=picto_from_langcode($object->country_code); if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); else print ($img?$img.' ':'').$object->country; @@ -1557,19 +1560,20 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('EMail').''; + print '
'.$langs->trans('EMail').''; print dol_print_email($object->email,0,$object->id,'AC_EMAIL'); - print '
'.$langs->trans('Web').''; + print '
'.$langs->trans('Web').''; print dol_print_url($object->url); print '
'.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('VATIntra').''; + print ''.$langs->trans('VATIntra').''; if ($object->tva_intra) { $s=''; @@ -1793,7 +1797,7 @@ else print '
'.$langs->trans('Delete').'
'."\n"; } else - { + { print ''."\n"; } } @@ -1803,7 +1807,8 @@ else if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) { - print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$params,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$params,'',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"),$textprofid[1],1,0),$_SERVER["PHP_SELF"],"s.siren","",$params,'nowrap="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$params,'nowrap="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$params,'nowrap="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$params,'nowrap="nowrap"',$sortfield,$sortorder); + print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"),$textprofid[1],1,0),$_SERVER["PHP_SELF"],"s.siren","",$params,'class="nowrap"',$sortfield,$sortorder); + print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$params,'class="nowrap"',$sortfield,$sortorder); + print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$params,'class="nowrap"',$sortfield,$sortorder); + print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$params,'class="nowrap"',$sortfield,$sortorder); print ''; print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$params,'align="right"',$sortfield,$sortorder); print "\n"; diff --git a/htdocs/theme/amarok/img/warning.png b/htdocs/theme/amarok/img/warning.png index 7c2c5f117f8..ae8e35e781d 100755 Binary files a/htdocs/theme/amarok/img/warning.png and b/htdocs/theme/amarok/img/warning.png differ diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index c5e92cdcb1b..5788b0f011f 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -116,6 +116,66 @@ $colortext='40,40,40'; $fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; +$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); +$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); +$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); +$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); +$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); +$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); +$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); +$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); +$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); +$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); +$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); +$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); +$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); +$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); +$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); +$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); +$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} + +// Set text color to black or white +$tmppart=explode(',',$colorback1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); +$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); +$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); +//print $tmpval; +if ($tmpval < 340) $colortextmain='FFFFFF'; +else $colortextmain='101010'; + +$usecss3=true; +if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; +elseif ($conf->browser->name == 'iceweasel') $usecss3=false; +elseif ($conf->browser->name == 'epiphany') $usecss3=false; + +print '/*'."\n"; +print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; +print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; +print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; +print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepair1='.$colorbacklinepair1."\n"; +print 'colorbacklinepair2='.$colorbacklinepair2."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'usecss3='.$usecss3."\n"; +print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; +print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; +print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; +print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; +print 'dol_use_jmobile='.$dol_use_jmobile."\n"; +print '*/'."\n"; + +if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11; ?> @@ -250,6 +310,9 @@ th .button { .right { text-align: ; } +.nowrap { + white-space: ; +} .blockvmenubookmarks .menu_contenu { @@ -349,8 +412,9 @@ div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */ /* Login */ +body.body center { color:white; margin-top: 100px; } + form#login { - display:block; border:solid 1px rgba(0,0,0,.4); border-top:solid 1px #ffffff; background-color:#c7d0db; @@ -370,7 +434,7 @@ form#login { margin-right:auto; margin-bottom:25px; padding:20px 20px 10px; - width:500px; + max-width:500px; border-radius:12px; box-shadow:0 0 16px rgba(0,0,0,.8); } @@ -493,26 +557,39 @@ img.login, img.printer, img.entity { font-weight:bold; } +div.login_main_home { + color: #000000; +} + /* ============================================================================== */ /* Menu gauche */ /* ============================================================================== */ +td.vmenu { + + margin-right:2px; + padding:0px; + width:170px; + /* border-right: 1px solid #666666; */ + +} + div.vmenu { display:none; width:170px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 3px 0px 6px #CCC; + -webkit-box-shadow: 3px 0px 6px #CCC; + box-shadow: 3px 0px 6px #CCC; } .blockvmenupair .menu_titre, .blockvmenuimpair .menu_titre { height:22px; line-height:22px; - text-align:center; + /* text-align:center; */ background-color:rgba(0,0,0,.08); background-image:linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image:-o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); @@ -526,7 +603,7 @@ div.vmenu { color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); - padding-left:3px; + padding-left:5px; border-top:solid 1px rgba(255,255,255,.5); border-bottom:solid 1px rgba(0,0,0,.5); } @@ -535,7 +612,7 @@ div.vmenu { .menu_contenu { background-color:#ffffff; - padding-left:12px; + padding-left:6px; border-top:solid 1px rgba(0,0,0,.05); } @@ -555,7 +632,7 @@ div.vmenu { .blockvmenusearch .menu_titre { margin-top:6px; text-align:left; - padding-left:18px; + padding-left:0px; } #blockvmenuhelp { @@ -812,13 +889,17 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size: } -.tab:hover {color:#333333;} +a.tab:hover {color:#333333;} /* ============================================================================== */ /* Styles de positionnement des zones */ /* ============================================================================== */ -td.vmenu { - - margin-right:2px; - padding:0px; - width:170px; - /* border-right: 1px solid #666666; */ - +#id-container { + display: table; + table-layout: fixed; +} +#id-right, #id-left { + display: table-cell; + float: none; + vertical-align: top; +} +#id- { + width: 100%; } div.fiche { - padding:8px 6px 10px; - margin-: dol_optimize_smallscreen) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px; - margin-: dol_optimize_smallscreen)?'12':'6'; ?>px; + padding: 8px 5px 10px; + margin-: global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'3':'16'):'24')); ?>px; + margin-: dol_optimize_smallscreen)?'12':'3')); ?>px; } div.fichecenter { @@ -913,7 +994,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -926,7 +1007,7 @@ div.ficheaddleft { div.divButAction { margin-bottom: 1.4em; } .button, .butAction {background: #999; border: solid 1px #888; font-weight: normal; } -.butActionRefused {background: #eaeaea; color:rgba(0,0,0,0.6); font-weight: normal; cursor: not-allowed; } +.butActionRefused {background: #eaeaea; color:rgba(0,0,0,0.6); font-weight: normal !important; cursor: not-allowed; } .butActionDelete {background: #b33c37; border:solid 1px #8d2f2b; font-weight: normal;} .button, .butAction, .butActionRefused, .butActionDelete { @@ -1114,6 +1195,10 @@ table.liste { table.liste td {padding:1px 2px 1px 0px;} +tr.liste_titre, tr.liste_titre_sel +{ + height: 22px; +} div.liste_titre, tr.liste_titre, tr.box_titre { padding:4px; background-color:rgba(0,0,0,.2); @@ -1129,21 +1214,18 @@ div.liste_titre, tr.liste_titre, tr.box_titre { color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); - height: 22px; + text-align: ; } tr.box_titre td.boxclose { width: 36px; } -tr.liste_titre td { +tr.liste_titre td, tr.liste_titre th { padding:2px; padding-left:2px !important; white-space:nowrap; -} - -tr.liste_titre td input.flat { - width:70%; + text-shadow:1px 1px 1px #ffffff; } td.liste_titre_sel { @@ -1936,7 +2018,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; @@ -1950,3 +2032,80 @@ div.jnotify-background { box-shadow: 4px 4px 4px #AAA !important; } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +li.ui-li-divider .ui-link { + color: #FFF !important; +} +.ui-btn-inner { + padding-left: 10px; + padding-right: 10px; + white-space: normal; +} +.ui-select .ui-btn-icon-right .ui-btn-inner { + padding-right: 36px; +} +.fiche .ui-controlgroup { + margin: 0px; + padding-bottom: 0px; +} +div.ui-controlgroup-controls div.tabsElem +{ + margin-top: 2px; + margin-right: 8px; +} +div.ui-controlgroup-controls div.tabsElem a +{ + -moz-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + -webkit-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + box-shadow: 0 -3px 6px rgba(0,0,0,.2); + border: none; +} + +a.tab span.ui-btn-inner, a.tab span.ui-btn-inner span.ui-btn-text +{ + border: none; + padding: 0; +} + +.ui-body-c { + border: none; + text-shadow: none; +} +.ui-link { + color: rgb() !important; +} + +div.tabsElem a.ui-btn-corner-all { + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomleft: 0px; + border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + border-bottom-right-radius: 0px; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} + +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + +close(); +?> diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 6068aebf385..f998fdc4e9c 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -195,6 +195,9 @@ div.inline-block .right { text-align: ; } +.nowrap { + white-space: ; +} /* ============================================================================== */ @@ -227,6 +230,19 @@ td.showDragHandle { /* Styles de positionnement des zones */ /* ============================================================================== */ +#id-container { + display: table; + table-layout: fixed; +} +#id-right, #id-left { + display: table-cell; + float: none; + vertical-align: top; +} +#id- { + width: 100%; +} + div.fiche { margin-: dol_optimize_smallscreen)?'10':'2'; ?>px; margin-: dol_optimize_smallscreen)?'8':''; ?>px; @@ -253,7 +269,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -593,7 +609,7 @@ img.login, img.printer, img.entity { /* Menu gauche */ /* ============================================================================== */ -td.vmenu { +div.vmenu, td.vmenu { margin-: 2px; padding: 0px; padding-bottom: 0px; @@ -1329,9 +1345,12 @@ table.liste td { padding-right: 2px; } -div.liste_titre, tr.liste_titre +tr.liste_titre, tr.liste_titre_sel { height: 24px; +} +div.liste_titre, tr.liste_titre +{ background: #7699A9; background-image: url(); background-repeat: repeat-x; @@ -2186,7 +2205,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; @@ -2202,6 +2221,43 @@ div.ecmjqft { box-shadow: 0px 0px 10px #AAA; } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-body-c { + border: none; + text-shadow: none; +} + +div.tabsElem a.ui-btn-corner-all { + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomleft: 0px; + border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + border-bottom-right-radius: 0px; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} + +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index ea565c5d1f4..f87364fef9b 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -224,6 +224,9 @@ div.inline-block .right { text-align: ; } +.nowrap { + white-space: ; +} /* ============================================================================== */ @@ -256,19 +259,24 @@ td.showDragHandle { /* Styles de positionnement des zones */ /* ============================================================================== */ +#id-container { + display: table; + table-layout: fixed; +} +#id-right, #id-left { + display: table-cell; + float: none; + vertical-align: top; +} +#id- { + width: 100%; +} + div.leftContent { margin-left: 20px !important; width: 220px !important; } -div.vmenu { - position: relative; - float: left; - margin: 0px; - width: 180px; - margin-left: 10px; -} - div.fiche { margin-: dol_optimize_smallscreen)?'10':'2'; ?>px; margin-: dol_optimize_smallscreen)?'10':''; ?>px; @@ -298,7 +306,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -644,10 +652,11 @@ img.login, img.printer, img.entity { /* ============================================================================== */ /* Menu gauche */ /* ============================================================================== */ -.vmenu{ -margin: 0; -position: relative; -width: 180px; + +.vmenu { + margin: 0; + position: relative; + width: 180px; } .vmenu { @@ -655,6 +664,14 @@ width: 180px; } +div.vmenu { + position: relative; + float: left; + margin: 0px; + width: 180px; + margin-left: 10px; +} + a.vmenu:link { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; } a.vmenu:visited { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; } a.vmenu:active { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; } @@ -735,7 +752,6 @@ div.blockvmenusearch { margin: 3px 0px 15px 0px; padding: 25px 0px 2px 2px; - width: 180px; background-image: url(); background-position: top right; background-repeat: no-repeat; @@ -1107,7 +1123,6 @@ div.tabs a.tab { color: #FFFFFF; text-decoration: none; position: relative; - float: left; padding: 0px 10px 0px 10px; } @@ -1468,7 +1483,6 @@ tr.liste_titre { font-weight: normal; /* text-decoration: underline; */ /* border-bottom: 1px solid #FDFFFF; */ - white-space: nowrap; } tr.liste_titre { @@ -1497,8 +1511,8 @@ div.liste_titre, tr.liste_titre { } div.liste_titre a, tr.liste_titre a { -color: #333333; -margin: 0px 5px; + color: #333333; + margin: 0px 5px; } div.liste_titre td, tr.liste_titre td { @@ -1513,7 +1527,6 @@ div.liste_titre, th.liste_titre, td.liste_titre color: #333333; font-family: ; font-weight: normal; - white-space: nowrap; background-image: none; background: none; } @@ -1533,7 +1546,6 @@ th.liste_titre_sel, td.liste_titre_sel font-weight: normal; /* text-decoration: underline; */ /* border-bottom: 1px solid #FDFFFF; */ - white-space: nowrap; } input.liste_titre { @@ -1549,7 +1561,6 @@ background: #F0F0F0; background-repeat: repeat-x; color: #332266; font-weight: normal; -white-space: nowrap; padding: 5px; } @@ -1614,7 +1625,6 @@ tr.box_titre { font-family: , sans-serif; font-weight: normal; border-bottom: 1px solid #FDFFFF; - white-space: nowrap; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; } @@ -2414,13 +2424,68 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; } +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-btn-inner { + padding-left: 10px; + padding-right: 10px; + white-space: normal; +} + +div.ui-controlgroup +{ + height: auto; + background-image: none; +} + +div.ui-controlgroup-controls div.tabsElem, div.ui-controlgroup-controls div.tabsElem a.tab +{ + height: auto; +} + +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} +div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, div.tabs a.tab span.ui-btn-inner, div.tabs a.tab span.ui-btn-text { + background-image: none; + color: #D45416; + height: auto; +} + +.ui-body-c { + border: none; + text-shadow: none; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} + +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index ddc88ac61d9..3203e556e82 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -130,7 +130,6 @@ input.button[type=submit] { /*border: 2px solid #063953;*/ color: #FFF; padding: 0px 10px 0px 10px; - margin: 0px 10px 0px 10px; text-decoration: none; white-space: nowrap; /*display: block; @@ -200,6 +199,9 @@ div.inline-block .right { text-align: ; } +.nowrap { + white-space: ; +} /* ============================================================================== */ @@ -231,9 +233,22 @@ td.showDragHandle { /* ============================================================================== */ /* Styles de positionnement des zones */ /* ============================================================================== */ + +#id-container { + display: table; + table-layout: fixed; +} +#id-right, #id-left { + display: table-cell; + float: none; + vertical-align: top; +} +#id- { + width: 100%; +} + div.leftContent { margin-left: 0px !important; - width: 200px !important; background-color: #FFF; } @@ -263,7 +278,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -649,7 +664,7 @@ img.login, img.printer, img.entity { /* Menu gauche */ /* ============================================================================== */ -td.vmenu { +div.vmenu, td.vmenu { margin-: 2px; padding: 0px; padding-bottom: 0px; @@ -752,7 +767,6 @@ div.blockvmenusearch { margin: 3px 0px 15px 0px; padding: 25px 0px 2px 2px; - width: 200px; background-image: url(); background-position: top right; background-repeat: no-repeat; @@ -1416,8 +1430,11 @@ table.liste td { padding-right: 2px; } -div.liste_titre, tr.liste_titre { +tr.liste_titre, tr.liste_titre_sel +{ height: 20px; +} +div.liste_titre, tr.liste_titre { color: #842F00; font-weight: bold; font-family: "Trebuchet MS",Arial,Helvetica,sans-serif; @@ -2240,13 +2257,63 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-body-c { + border: none; + text-shadow: none; +} + +div.ui-controlgroup +{ + height: auto; + background-image: none; +} + +div.ui-controlgroup-controls div.tabsElem, div.ui-controlgroup-controls div.tabsElem a.tab +{ + height: auto; +} + +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} +div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, div.tabs a.tab span.ui-btn-inner, div.tabs a.tab span.ui-btn-text { + background-image: none; + color: #D45416; + height: auto; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} + +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 43af5fc2482..9b7020700e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -116,16 +116,16 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; // Eldy colors if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) { - $conf->global->THEME_ELDY_TOPMENU_BACK1='180,196,216'; // topmenu - $conf->global->THEME_ELDY_TOPMENU_BACK2='190,206,226'; - $conf->global->THEME_ELDY_VERMENU_BACK1='253,253,253'; // vmenu - $conf->global->THEME_ELDY_VERMENU_BACK1b='226,228,230'; // vmenu (not menu) - $conf->global->THEME_ELDY_VERMENU_BACK2='232,234,236'; + $conf->global->THEME_ELDY_TOPMENU_BACK1='200,216,246'; // topmenu + $conf->global->THEME_ELDY_TOPMENU_BACK2='190,206,236'; + $conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu + $conf->global->THEME_ELDY_VERMENU_BACK1b='230,232,232'; // vmenu (not menu) + $conf->global->THEME_ELDY_VERMENU_BACK2='240,240,240'; $conf->global->THEME_ELDY_BACKTITLE1='140,160,185'; // title of arrays $conf->global->THEME_ELDY_BACKTITLE2='210,220,235'; - $conf->global->THEME_ELDY_BACKTABCARD1='231,232,235'; // card - $conf->global->THEME_ELDY_BACKTABCARD2='220,224,227'; - $conf->global->THEME_ELDY_BACKTABACTIVE='220,224,227'; + $conf->global->THEME_ELDY_BACKTABCARD1='240,240,240'; // card + $conf->global->THEME_ELDY_BACKTABCARD2='234,234,234'; + $conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234'; $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; $conf->global->THEME_ELDY_LINEIMPAIR1='242,242,242'; $conf->global->THEME_ELDY_LINEIMPAIR2='248,248,248'; @@ -134,7 +134,13 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_LINEPAIR2='255,255,255'; $conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; - $conf->global->THEME_ELDY_TEXT='48,102,102'; + $conf->global->THEME_ELDY_TEXT='50,50,130'; + if ($dol_use_jmobile) + { + $conf->global->THEME_ELDY_BACKTABCARD1='245,245,245'; // topmenu + $conf->global->THEME_ELDY_BACKTABCARD2='245,245,245'; + $conf->global->THEME_ELDY_BACKTABACTIVE='245,245,245'; + } } $colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); @@ -172,7 +178,7 @@ $tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); $tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); //print $tmpval; if ($tmpval < 340) $colortextmain='FFFFFF'; -else $colortextmain='101010'; +else $colortextmain='444444'; $usecss3=true; if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; @@ -219,7 +225,9 @@ body { trans("DIRECTION").";\n"; ?> } -a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #000000; text-decoration: none; } +a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #4A4A4A; text-decoration: none; } + +a:hover { text-decoration: underline; color: #000000;} input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; @@ -229,8 +237,10 @@ input, input.flat, textarea, textarea.flat, form.flat select, select.flat { font-family: ; background: #FDFDFD; border: 1px solid #C0C0C0; + padding: 1px 1px 1px 1px; margin: 0px 0px 0px 0px; + } input, textarea, select { border-radius:4px; @@ -264,6 +274,7 @@ textarea:disabled { } input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } + .button { font-family: ; background-image: url(); @@ -274,9 +285,9 @@ input[type=image] { background-color: transparent; border: none; box-shadow: non -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 2px 2px 3px #CCC; - -webkit-box-shadow: 2px 2px 3px #CCC; - box-shadow: 2px 2px 3px #CCC; + -moz-box-shadow: 2px 2px 3px #DDD; + -webkit-box-shadow: 2px 2px 3px #DDD; + box-shadow: 2px 2px 3px #DDD; } .button:focus { font-family: ; @@ -301,9 +312,9 @@ input[type=image] { background-color: transparent; border: none; box-shadow: non -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } form { padding:0px; @@ -346,7 +357,9 @@ th .button { .right { text-align: ; } - +.nowrap { + white-space: ; +} /* ============================================================================== */ @@ -380,9 +393,23 @@ td.showDragHandle { /* Styles de positionnement des zones */ /* ============================================================================== */ +#id-container { + display: table; + table-layout: fixed; +} +#id-right, #id-left { + display: table-cell; + float: none; + vertical-align: top; +} +#id- { + width: 100%; +} + div.fiche { margin-: global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'4':'20'):'24')); ?>px; margin-: dol_optimize_smallscreen)?'12':'4')); ?>px; + dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> } div.fichecenter { @@ -463,20 +490,17 @@ div.tmenudiv { height: px; - /* background-image: -o-linear-gradient(bottom, rgb() 75%, rgb() 100%); */ - /* background-image: -moz-linear-gradient(bottom, rgb() 75%, rgb() 100%);*/ - /* background-image: -webkit-linear-gradient(bottom, rgb() 40%, rgb() 60%, rgb() 100%);*/ - /* background-image: -ms-linear-gradient(bottom, rgb() 75%, rgb() 100%);*/ - /* background-image: linear-gradient(bottom, rgb() 75%, rgb() 100%); */ - background: url() 50% 0% repeat-x; - border-bottom: 1px solid rgb(); + background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(40,40,40,.3) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(40,40,40,.3) 100%); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(40,40,40,.3) 100%); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(40,40,40,.3) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(40,40,40,.3) 100%); + background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(40,40,40,.3)) ); box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; - border-bottom: 1px solid #DDDDDD; - background-image: url(); - background-position:top; - background-repeat:repeat-x; + background-image: rgb(); + color: #000000; text-decoration: none; @@ -498,6 +522,7 @@ a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { white-space: nowrap; /* text-shadow: 1px 1px 1px #000000; */ color: #; + text-decoration: none; } a.tmenu:link, a.tmenu:visited { color: #; @@ -533,7 +558,6 @@ ul.tmenu { /* t r b l */ margin: 0px 0px 0px 0px; list-style: none; height: px; - background: url() 0 0 repeat-x !important; } li.tmenu, li.tmenusel { @@ -579,7 +603,6 @@ div.tmenucenter text-shadow: 1px 1px 1px #DDD; } - div.mainmenu { position : relative; background-repeat:no-repeat; @@ -748,7 +771,7 @@ foreach($mainmenuusedarray as $val) /* Login */ form#login { - margin-top: 60px; + margin-top: px; margin-bottom: 30px; font-size: 13px; vertical-align: middle; @@ -772,9 +795,9 @@ form#login { border: 1px solid #C0C0C0; background-color: #E0E0E0; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; border-radius: 8px; border:solid 1px rgba(168,168,168,.4); @@ -844,7 +867,7 @@ img.login, img.printer, img.entity { /* Menu gauche */ /* ============================================================================== */ -td.vmenu { +div.vmenu, td.vmenu { margin-: 2px; padding: 0px; padding-bottom: 0px; @@ -875,7 +898,6 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:; color: #000000; text-align: ; @@ -899,19 +921,18 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks background-repeat:repeat-x; border-left: 1px solid #CCCCCC; - border-right: 1px solid #BBBBBB; - border-bottom: 1px solid #BBBBBB; + border-right: 1px solid #DDDDDD; + border-bottom: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenusearch { - width:174px; font-family: ; color: #000000; text-align: ; @@ -936,14 +957,13 @@ div.blockvmenusearch border-bottom: 1px solid #BBBBBB; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenubookmarksold { - width:174px; border-right: 1px solid #555555; border-bottom: 1px solid #555555; font-family: ; @@ -970,15 +990,14 @@ div.blockvmenubookmarksold border-bottom: 1px solid #BBBBBB; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenuhelp { dol_optimize_smallscreen)) { ?> - width:174px; font-family: ; color: #000000; text-align: center; @@ -1272,13 +1291,15 @@ img.toolbarbutton { /* ============================================================================== */ /* Onglets */ /* ============================================================================== */ - div.tabs { - top: 20px; - margin: 1px 0px 2px 0px; - padding: 0px 6px 0px 0px; + margin: 0px 0px 2px 6px; + padding: 0px 6px 3px 0px; text-align: ; + + clear:both; + height:100%; } +div.tabsElem { margin-top: 8px; } /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -1294,7 +1315,7 @@ div.tabBar { border-bottom: 1px solid #CCCCCC; border-left: 1px solid #D0D0D0; border-top: 1px solid #D8D8D8; - + width: auto; background-image: -o-linear-gradient(bottom, rgb() 25%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 25%, rgb() 100%); @@ -1305,9 +1326,9 @@ div.tabBar { background: #dee7ec url() repeat-x; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } @@ -1326,7 +1347,7 @@ a.tabTitle { text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal; - padding: 5px 6px 2px 6px; + padding: 4px 6px 2px 6px; margin: 0px 6px; text-decoration: none; white-space: nowrap; @@ -1334,17 +1355,24 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 5px 6px 2px 6px; + padding: 5px 12px 5px; + /* padding: 3px 6px 2px 6px;*/ margin: 0em 0.2em; text-decoration: none; white-space: nowrap; + -moz-border-radius:6px 6px 0px 0px; -webkit-border-radius:6px 6px 0px 0px; border-radius:6px 6px 0px 0px; - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; + -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); + -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); + box-shadow: 0 -1px 4px rgba(0,0,0,.1); + + border-bottom: none; + border-right: 1px solid #CCCCCC; + border-left: 1px solid #D0D0D0; + border-top: 1px solid #D8D8D8; background-image: -o-linear-gradient(bottom, rgb() 35%, rgb() 100%); @@ -1369,9 +1397,12 @@ a.tab#active { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { color: #; - font-weight: normal !important; + /* font-weight: normal !important; */ +} +a.tab:hover +{ + background: rgb() url() 50% 0 repeat-x; } - a.tabimage { color: #434956; font-family: ; @@ -1419,9 +1450,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 2px 2px 3px #CCC; - -webkit-box-shadow: 2px 2px 3px #CCC; - box-shadow: 2px 2px 3px #CCC; + -moz-box-shadow: 2px 2px 3px #DDD; + -webkit-box-shadow: 2px 2px 3px #DDD; + box-shadow: 2px 2px 3px #DDD; } .butAction:hover { @@ -1450,9 +1481,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> @@ -1556,9 +1587,9 @@ table.noborder, table.formdoc { margin: 0px 0px 2px 0px; /*padding: 1px 2px 1px 2px;*/ - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; -moz-border-radius: 0.2em; -webkit-border-radius: 0.2em; @@ -1617,32 +1648,32 @@ table.liste { margin-bottom: 2px; margin-top: 0px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } table.liste td { padding-right: 2px; } +tr.liste_titre, tr.liste_titre_sel +{ + height: 20px !important; +} div.liste_titre, tr.liste_titre, tr.liste_titre_sel { - height: 20px !important; - background: #7699A9; + background: rgb(); background-repeat: repeat-x; - - + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); - - background-image: url(); - + color: #; font-family: ; - font-weight: normal; + font-weight: bold; border-bottom: 1px solid #FDFFFF; white-space: ; text-align: ; @@ -1650,9 +1681,10 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre { font-family: ; - font-weight: normal; + /*font-weight: normal;*/ border-bottom: 1px solid #FDFFFF; white-space: ; + text-shadow:1px 0px 1px #ffffff; } tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel { @@ -1661,6 +1693,7 @@ tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre border-bottom: 1px solid #FDFFFF; white-space: ; text-decoration: underline; + text-shadow:1px 1px 1px #ffffff; } input.liste_titre { background: transparent; @@ -1730,15 +1763,15 @@ tr.liste_total td { /* Disable shadows */ .noshadow { - -moz-box-shadow: 0px 0px 0px #CCC !important; - -webkit-box-shadow: 0px 0px 0px #CCC !important; - box-shadow: 0px 0px 0px #CCC !important; + -moz-box-shadow: 0px 0px 0px #DDD !important; + -webkit-box-shadow: 0px 0px 0px #DDD !important; + box-shadow: 0px 0px 0px #DDD !important; } div.tabBar .noborder { - -moz-box-shadow: 0px 0px 0px #CCC !important; - -webkit-box-shadow: 0px 0px 0px #CCC !important; - box-shadow: 0px 0px 0px #CCC !important; + -moz-box-shadow: 0px 0px 0px #DDD !important; + -webkit-box-shadow: 0px 0px 0px #DDD !important; + box-shadow: 0px 0px 0px #DDD !important; } @@ -1747,9 +1780,9 @@ div.tabBar .noborder { */ .boxtable { - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; margin-bottom: 8px !important; } @@ -1762,21 +1795,21 @@ div.tabBar .noborder { tr.box_titre { height: 20px; - background: #7699A9; - - + background: rgb(); + background-repeat: repeat-x; + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); - - background-image: url(); - - background-repeat: repeat-x; + color: #; + text-shadow:1px 1px 1px #FFFFFF; + /* color: #FFFFFF; + text-shadow:1px 1px 1px #444444; */ font-family: , sans-serif; - font-weight: normal; + font-weight: bold; border-bottom: 1px solid #FDFFFF; white-space: nowrap; } @@ -2371,9 +2404,9 @@ a.cke_dialog_ui_button -moz-border-radius:0px 5px 0px 5px !important; -webkit-border-radius:0px 5px 0px 5px !important; border-radius:0px 5px 0px 5px !important; - -moz-box-shadow: 4px 4px 4px #CCC !important; - -webkit-box-shadow: 4px 4px 4px #CCC !important; - box-shadow: 4px 4px 4px #CCC !important; + -moz-box-shadow: 4px 4px 4px #DDD !important; + -webkit-box-shadow: 4px 4px 4px #DDD !important; + box-shadow: 4px 4px 4px #DDD !important; } .cke_dialog_ui_hbox_last { @@ -2555,40 +2588,74 @@ div.dolEventError h1, div.dolEventError h2 { li.ui-li-divider .ui-link { color: #FFF !important; } +a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-inner:hover { + text-decoration: none !important; +} + .ui-btn-inner { - padding-left: 12px; + padding-left: 10px; + padding-right: 10px; + /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 36px; } -/* Warning: setting this make screen not beeing refreshed after a combo selection */ -/*.ui-body-c { - background: #fff; -}*/ -/* -.ui-li-divider { - background: #eee !important; +.fiche .ui-controlgroup { + margin: 0px; + padding-bottom: 0px; } -.ui-bar-b { - border: 1px solid #ccc !important; - background: #aaa !important; - font-weight: bold !important; - color: #444 !important; - text-shadow: 0 1px 1px #fff !important; - background-image: -webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#aaa)) !important; - background-image: -webkit-linear-gradient(top,#fdfdfd,#aaa) !important; - background-image: -moz-linear-gradient(top,#fdfdfd,#aaa) !important; - background-image: -ms-linear-gradient(top,#fdfdfd,#aaa) !important; - background-image: -o-linear-gradient(top,#fdfdfd,#aaa) !important; - background-image: linear-gradient(top,#fdfdfd,#aaa) !important; +div.ui-controlgroup-controls div.tabsElem +{ + margin-top: 2px; } -.ui-bar-b .ui-link { +div.ui-controlgroup-controls div.tabsElem a +{ + -moz-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + -webkit-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + box-shadow: 0 -3px 6px rgba(0,0,0,.2); border: none; - font-weight: bold !important; - color: #444 !important; - text-shadow: 0 1px 1px #fff !important; } -*/ +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} + +.ui-body-c { + border: none; + text-shadow: none; +} +.ui-link { + color: rgb() !important; +} + +a.ui-link { + word-wrap: break-word; +} + +/* force wrap possible onto field overflow does not works */ +.formdoc .ui-btn-inner +{ + white-space: normal; + overflow: hidden; + text-overflow: hidden; +} + +/* Warning: setting this may make screen not beeing refreshed after a combo selection */ +.ui-body-c { + background: #fff; +} + +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} close(); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 8b4bc780cbf..83878126858 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='user'; +$elementtype='user'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 69d7855b8d3..8da493de97e 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -174,7 +174,7 @@ class UserGroup extends CommonObject } /** - * Return array of users id for group + * Return array of users id for group this->id (or all if this->id not defined) * * @param string $excludefilter Filter to exclude * @return array Array of users @@ -214,8 +214,10 @@ class UserGroup extends CommonObject $newuser->fetch($obj->rowid); $ret[$obj->rowid]=$newuser; } - - $ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity; + if (! empty($obj->usergroup_entity)) + { + $ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity; + } } $this->db->free($resql); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 892d5fc4ac3..7769a9da06c 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -561,7 +561,7 @@ if ($action == 'adduserldap') */ // fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('user'); +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); llxHeader('',$langs->trans("UserCard")); @@ -1302,17 +1302,17 @@ else { if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { - print ''.$langs->trans("Modify").''; + print ''; } else { - print ''.$langs->trans("Modify").''; + print ''; } } elseif ($caneditpassword && ! $object->ldap_sid && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("EditPassword").''; + print ''; } // Si on a un gestionnaire de generation de mot de passe actif @@ -1320,23 +1320,23 @@ else { if ($object->statut == 0) { - print ''.$langs->trans("ReinitPassword").''; + print ''; } elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("ReinitPassword").''; + print ''; } if ($object->statut == 0) { - print ''.$langs->trans("SendNewPassword").''; + print ''; } else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - if ($object->email) print ''.$langs->trans("SendNewPassword").''; - else print ''.$langs->trans("SendNewPassword").''; + if ($object->email) print ''; + else print ''; } } @@ -1344,13 +1344,13 @@ else if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("Reactivate").''; + print ''; } // Desactiver if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("DisableUser").''; + print ''; } // Delete if ($user->id <> $id && $candisableuser && @@ -1358,11 +1358,11 @@ else { if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin { - print ''.$langs->trans("DeleteUser").''; + print ''; } else { - print ''.$langs->trans("DeleteUser").''; + print ''; } } @@ -1545,7 +1545,7 @@ else if ($caneditfield) { if ($object->photo) print "
\n"; - print '
'; + print '
'; + //print ''; - print ''; - print ''; - print '
'; print ''; // ancre /* @@ -1818,10 +1823,10 @@ else $somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang); - print '
'; + print '
'; + + + print '
'; print '
'; } diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 93401eaebf0..ca4d35b5669 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -327,10 +327,10 @@ if ($resql) print '
'; + print '
'; if ($object->photo) print ''; print ''; print ''; @@ -1848,6 +1848,7 @@ else { print $langs->trans("ThisUserIsNot"); } + print ' ('.$langs->trans("UseTypeFieldToChange").')'; print ''; print "\n"; } diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 61220a41737..d100c9b3778 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -114,7 +114,7 @@ if ($resql) print ''; } print ''; - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 0ff27f4cc38..1f291d6b160 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -277,9 +277,9 @@ if ($id) if ($caneditperms) { print ''; - print ''; - print ''; // Module - print ''; + print ''; if (in_array($obj->id, $permsgroup)) { diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 537a4671b5a..33e80336e95 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -239,7 +239,7 @@ if ($canreadperms) print $mc->label; print ''; } - print ''; + print ''; print ""; $i++; } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 0713e3cb226..479f156e343 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -161,10 +161,10 @@ if ($result) print ''; // Date creation - print ''; + print ''; // Date last login - print ''; + print ''; // Statut $userstatic->statut=$obj->statut; diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 5e649badcd9..3dcd1eae8ff 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -27,7 +27,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // We need company to get correct logo onto home page if (! defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) define('EVEN_IF_ONLY_LOGIN_ALLOWED','1'); require_once '../main.inc.php'; @@ -64,7 +64,8 @@ if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOU if (GETPOST('dol_hide_topmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1'; if (GETPOST('dol_hide_leftmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1'; if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1'; -if (GETPOST('dol_no_mouse_over')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_over=1'; +if (GETPOST('dol_no_mouse_hover')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_hover=1'; +if (GETPOST('dol_use_jmobile')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_use_jmobile=1'; // Destroy session $prefix=dol_getprefix(); @@ -79,6 +80,5 @@ dol_syslog("End of session ".$sessionname); unset($_SESSION['dol_login']); unset($_SESSION['dol_entity']); -//print 'url='.$url;exit; header("Location: ".$url); ?> diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index a779894d1db..568cebad27e 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -119,6 +119,16 @@ llxHeader(); $head = user_prepare_head($fuser); $title = $langs->trans("User"); + +if ($action == 'edit') +{ + print ''; + print ''; + print ''; + print ''; +} + + dol_fiche_head($head, 'guisetup', $title, 0, 'user'); @@ -158,11 +168,6 @@ if ($action == 'edit') }); '; - print ''; - print ''; - print ''; - print ''; - clearstatcache(); $var=true; @@ -177,7 +182,7 @@ if ($action == 'edit') print $s?$s.' ':''; print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print ''; print ''; print ''; - print ''; print ''; @@ -198,13 +203,15 @@ if ($action == 'edit') // Theme show_theme($fuser,(($user->admin || empty($dolibarr_main_demo))?1:0),true); - print ''; + dol_fiche_end(); + print '
'; print ''; print '     '; print ''; print '
'; + print ''; } @@ -222,7 +229,7 @@ else print ($s?$s.' ':''); print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("Delete").'

'.$langs->trans("PhotoFile").'
'.$mc->label.''.$obj->nb.''.dol_print_date($db->jdate($obj->datec),"dayhour").''.dol_print_date($db->jdate($obj->datec),"dayhour").'
'.img_object('',$picto).' '.$objMod->getName(); + print ''.img_object('',$picto).' '.$objMod->getName(); print ' '; + print ''; print ''.$langs->trans("All").""; print '/'; print ''.$langs->trans("None").""; @@ -292,7 +292,7 @@ if ($id) print '
'.img_object('',$picto).' '.$objMod->getName().''.img_object('',$picto).' '.$objMod->getName().''.dol_print_date($db->jdate($obj->datec),'dayhour').''.dol_print_date($db->jdate($obj->datec),'dayhour').'
'.dol_print_date($db->jdate($obj->datec),"dayhour").''.dol_print_date($db->jdate($obj->datec),"dayhour").''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'
conf->MAIN_LANG_DEFAULT)?" checked":""); + print 'conf->MAIN_LANG_DEFAULT)?" checked":""); print ! empty($dolibarr_main_demo)?' disabled="disabled"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -188,7 +193,7 @@ if ($action == 'edit') $var=!$var; print '
'.$langs->trans("MaxSizeList").''.$conf->global->MAIN_SIZE_LISTE_LIMIT.'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); + print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); print ! empty($dolibarr_main_demo)?' disabled="disabled"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").'
conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; $s=(isset($fuser->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($fuser->conf->MAIN_LANG_DEFAULT) : ''); print ($s?$s.' ':''); @@ -232,7 +239,7 @@ else $var=!$var; print '
'.$langs->trans("MaxSizeList").''.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'' . (! empty($fuser->conf->MAIN_SIZE_LISTE_LIMIT)?$fuser->conf->MAIN_SIZE_LISTE_LIMIT:' ') . '

'; @@ -241,7 +248,8 @@ else // Skin show_theme($fuser,0,true); - print ''; + dol_fiche_end(); + print '
'; if (empty($user->admin) && ! empty($dolibarr_main_demo)) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index bca0ba9ee6a..3554af45ffd 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -336,9 +336,9 @@ if ($result) { // On affiche ligne pour modifier droits print '
'.img_object('',$picto).' '.$objMod->getName(); + print ''.img_object('',$picto).' '.$objMod->getName(); print ' '; + print ''; print ''.$langs->trans("All").""; print '/'; print ''.$langs->trans("None").""; @@ -360,7 +360,7 @@ if ($result) { print ''.img_picto($langs->trans("Administrator"),'star').''; + print ''; print img_picto($langs->trans("Active"),'tick'); print ''.img_edit_remove($langs->trans("Remove")).''; + print ''; print img_picto($langs->trans("Active"),'tick'); print ''; + print ''; print img_picto($langs->trans("Active"),'tick'); print '