Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop

This commit is contained in:
fappels
2015-11-16 16:51:20 +01:00
4906 changed files with 27323 additions and 152892 deletions

8
.gitignore vendored
View File

@@ -17,4 +17,10 @@ doxygen_warnings.log
*.iml
Thumbs.db
# Vagrant generated files
.vagrant
.vagrant
# Composer installed repositories
/htdocs/includes/**/.git
# Composer autoloader and unwanted files
htdocs/includes/autoload.php
htdocs/includes/bin/
htdocs/includes/composer/

View File

@@ -332,6 +332,12 @@ source_file = htdocs/langs/en_US/suppliers.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.supplier_proposal]
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.trips]
file_filter = htdocs/langs/<lang>/trips.lang
source_file = htdocs/langs/en_US/trips.lang

View File

@@ -4,7 +4,7 @@ How to contribute to Dolibarr
Bug reports and feature requests
--------------------------------
<a name=not-a-support-forum></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
@@ -13,9 +13,9 @@ Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
4. Tell us the version you are using!
3. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible).
We're still figuring out how to migrate old issues to GitHub. In the meantime, they are still available at [Doliforge](https://doliforge.org/projects/dolibarr).
<a name=code></a>Code
<a name="code"></a>Code
---------------------
### Basic workflow
@@ -26,7 +26,7 @@ We're still figuring out how to migrate old issues to GitHub. In the meantime, t
4. Commit and push your changes.
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
### <a name=branches></a>Branches
### <a name="branches"></a>Branches
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
@@ -38,9 +38,9 @@ We officially support versions N, N 1 and N 2 for N the latest version a
Choose your base branch accordingly.
### General rules
Please don't edit the ChangeLog file. A project manager will update it from your commit messages.
Please don't edit the ChangeLog file. File will be generated from your commit messages during release process by the project manager.
### <a name=commits></a>Commits
### <a name="commits"></a>Commits
Use clear commit messages with the following structure:
```
@@ -50,7 +50,7 @@ LONGDESC
```
#### Keyword
In uppercase to appear in ChangeLog when generated.
In uppercase if you want to have the log comment appears into the generated ChangeLog file.
The keyword can be ommitted if your commit does not fit in any of the following categories:
- Fix: for a bug fix
@@ -97,6 +97,13 @@ When submitting a pull request, use same rule as [Commits](#commits) for the mes
If your pull request only contains one commit, GitHub will be smart enough to fill it for you.
Otherwise, please be a bit verbose about what you're providing.
Your Pull Request must pass the Continuous Integration checks.
Also, some code changes need a prior approbation:
* if you want to include a new external library (into htdocs/includes directory), please ask before to the project leader to see if such a library can be accepted.
* if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project leader if the new data model you plan to add can be accepted as you suggest.
### Resources
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)

View File

@@ -12,7 +12,7 @@ Dolibarr uses some external libraries released under different licenses. This is
Component Version License GPL Compatible Usage
-------------------------------------------------------------------------------------
PHP libraries:
AdoDb-Date 0.33 Modified BSD License Yes Date convertion (not into rpm package)
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
EvalMath 1.0 BSD Yes Safe math expressions evaluation
@@ -24,7 +24,7 @@ Mobiledetect 2.8.3 MIT License Yes
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
PHPExcel 1.8.0 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
@@ -54,7 +54,7 @@ jQuery TableDnD 0.6 GPL and MIT License Yes
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
jsGantt 1.2 BSD License Yes JS library (to build Gantt reports)
JsTimezoneDetect 1.0.4 MIT License Yes JS library to detect user timezone
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
Raven.js 1.1.19 MIT License Yes Used for client-side error logging with Sentry logger
For licenses compatibility informations:

198
ChangeLog
View File

@@ -29,6 +29,63 @@ This is list of hooks modified:
***** ChangeLog for 3.8.2 compared to 3.8.1 *****
FIX: Add a protection to not make release if ChangeLog was not generated.
FIX: 1/ update_extra() function must not be in "if(!empty(MAIN_DISABLE_CONTACTS_TAB)" test. 2/ Reindented code
FIX: #3240
FIX: #3541 Bypass authentication when user was created using LDAP
FIX: #3605 deleting a shipping
FIX: #3661 Margin is not selected correctly when adding a product
FIX: #3689 Bug on workflow module
FIX: #3724 Bug: Blank page after cloning proposal if we changed client
FIX: #3726 Better support for PRODUCT_USE_OLD_PATH_FOR_PHOTO
FIX: #3726 Not showing images on product card
FIX: #3757 Can't set amount in a social contribution with some languages
FIX: #3786 Translation of select box.
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: #3878 Storing and deleting files on emailing was done at wrong place
FIX: #3880
FIX: #3882
FIX: action not appear before an update because of a lack of line in action ressource
FIX: add tag myuser_job into ODT replacement
FIX: Avoid changing the state to a thirdparty who shouldn't be contacted anymore
FIX: bad calculation for stock value
FIX: Bad parameters
FIX: Bad picto for expense report
FIX: bad property so after creating an event from calendar, filter were lost.
FIX: bad stock valorisation
FIX: better fix to generate a PROV ref after clone
FIX: bug invoice classified in propale next update commonobject class in 3.8
FIX: Can export a field into task time table with export project profile
FIX: change order date on clone (as everywhere else)
FIX: clone customer order create new order with validate ref and not with PROV
FIX: Contacts are not added to the list with the status "no contact"
FIX: Default thirdparty when cloning invoice was not set.
FIX: double db escape add too quote
FIX: event's data lost on user assign update
FIX: Filter in customer price per product of a thirdparty returned error
FIX: filters on supplier invoices list are not used, search_status instead
FIX: fix HTML into formconfirm box
FIX: IF autocomplete was set on thirdparty list, it was not possible to open list of extrafields.
FIX: If no end date is set on survey, we should be able to vote.
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: pmp calculation
FIX: Preview pages was not using correct style for ref
FIX: project was not retrieved on invoice creation form
FIX: Revert option WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES into option WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED for better compatibility with old versions
FIX: Search status not saved into list
FIX: search_status not used in mergefusiontool
FIX: Show category selector if we have permission to view products or services
FIX: Show product image on getNomUrl()
FIX: skeleton class must use db->order rather than ORDER BY into fetchAll
FIX: Societe::set_parent() function needs societe object to be fetched to update parent
FIX: supplier rights for orderToInvoice
FIX: tag object_total_vat_x need x to be a string with unknown decimal lenght. Now use for x the real vat real with no more decimal (x = 20 or x = 8.5 or x = 5.99, ...)
FIX: The preview of PDF was never refreshed if PDF document was changed
FIX: The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs.
FIX: Total in summary was not same than into detail on the referrer page.
***** ChangeLog for 3.8.1 compared to 3.8.0 *****
FIX: #3521 postgresql migration error
FIX: #3524
@@ -315,25 +372,94 @@ Dolibarr better:
to make difference between creation from contact or not.
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page
FIX [ bug #1852 ] JS error when editing a customer order line
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
FIX [ bug 1634 ] Error deleting a project when it had many linked objects
FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne
FIX: Not showing delivery date on rouget pdf
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX: #3009: Better filtering to prevent SQL injection
FIX: #3091 TotalHT amount in supplier order is bold unlike the rest of Dolibarr
FIX: #3262 Webservice getProductsForCategory()
FIX: #3318
FIX: [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice
FIX: #3530
FIX: #3630 - Wrong balance report when module salaries and donation disabled
FIX: #3679 Error when deleting a Localtax2 special payment
FIX: #3707 Thirdparty bank account page table has a glitch
FIX: #3724 Bug: Blank page after cloning proposal with changed client
FIX: #3836 Unable to upload a document to an invoice under some circunstances
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: Add a protection to not make release if ChangeLog was not generated.
FIX: adjusted test for affecting supplier reference
FIX: Admin fiche inter page do not take good action
FIX: Avoid warning strict mode when hosting server do not have php5_curl installed
FIX: bad calculation for stock value
FIX: Bad condition into invoice export request making reporting too many rows.
FIX: bad stock valorisation
FIX: Bad visualization of suppliers name on Incomes-Expenses mode
FIX: Better management error into the color conversion functions
FIX: [ bug 1634 ] Error deleting a project when it had many linked objects
FIX: [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: [ bug #3211 ] Error about sold to pay (Montant encours)
FIX: [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX: [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX: [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX: [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX: [ bug #3431 ] Invoice bank account is not respected
FIX: [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX: Can create Proposal on close thridparty #3526
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2855 Wrong translation key in localtax report page
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2900 Courtesy title is not stored in create thirdparty form
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: Display country name instead of country id (display country id makes no sense on vcard files)
FIX: display error on extrafields on ficheinter
FIX: double db escape add too quote
FIX: Email selector contact must not include inactive contact
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event's data lost on user assign update
FIX: Export of tags for contact and member
FIX: facturestat bad sql when customer view is limited
FIX: if multicompany enabled, call to undifend method _setCookie instead of setCookie
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: Line break display as a block
FIX: load propal langs for availability traduction
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
FIX: Mass Mailing activity don't display all status
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
FIX: multientity warehouse management
FIX: New adherent from, always redirect on entity
FIX: No check warehouse is provided if module stock is not enabled.
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX [ bug #3431 ] Invoice bank account is not respected
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message
FIX: only active customer should be return into new invoice creation select list
FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order
FIX: WAP calculation
FIX: Save of filters into export profiles failed.
FIX: supplier rights for orderToInvoice
FIX: Syntax error in Debian Apache configuration
FIX: The hours of date filter aren't correct
FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX: total amount in tpl linked object are not reset
FIX: translate Jabberid on contact page with edit view
FIX: translation for 1 word do not work if product/service module are disabled because the translation search in products.lang
FIX: update2.php test res befre assign it
FIX: When delete actioncomm also delete actioncomm_resources
FIX: when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated
FIX: when mailing is deleted, the targets list was kept in database
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
FIX: When we add an user on event in create mode, we lose linked object
FIX: When we automatically creta an order from a proposal with workflow module, if some extrafields of propal don't exist in order object, insertExtraFields() function tries to insert extrafields in unexistant column of commande_extrafields table.
FIX: When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third.
FIX: XSS security using the onerror and missing escapement on type of member page.
NEW: Created new ContratLigne::insert function
@@ -559,9 +685,43 @@ Dolibarr better:
warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX: #3009: Better filtering to prevent SQL injection
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: #3890 Expected transactions bank account page, shows negative numbers
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
FIX: bad calculation for stock value
FIX: bad stock valo
FIX: bad stock valorisation
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: button create payment hide if tax amount is less than 1
FIX: change object statut on close shipping and remove erratic db commit
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: double db escape add too quote
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event for restricted user was restricted if company null
FIX: facturestat bad sql when customer view is limited
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: pmp
FIX: send mail, copy sendto don't read the list of contact
FIX: The hours of date filter aren't correct
FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX: top links menu have target attribute with wrong value
FIX: total amount in tpl linked object are not reset
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
***** ChangeLog for 3.6.4 compared to 3.6.3 *****
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask

View File

@@ -133,12 +133,19 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
- Dolibarr ne fait pas le café (pas encore).
## RESEAUX SOCIAUX
## ACTUALITES ET RESEAUX SOCIAUX
Suivez le projet Dolibarr project sur
Suivez le projet Dolibarr project sur les réseaux francophones
Facebook: <https://www.facebook.com/dolibarr.fr>
- Facebook: <https://www.facebook.com/dolibarr.fr>
- Google+: <https://plus.google.com/+DolibarrFrance>
- Twitter: <http://www.twitter.com/dolibarr_france>
Google+: <https://plus.google.com/+DolibarrFrance>
ou sur les réseaux anglophones
Twitter: <http://www.twitter.com/dolibarr_france>
- [Facebook](https://www.facebook.com/dolibarr)
- [Google+](https://plus.google.com/+DolibarrOrg)
- [Twitter](http://www.twitter.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)

View File

@@ -1,6 +1,6 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dd/dolibarr.svg)
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
@@ -16,9 +16,9 @@ You can use it as a standalone application or as a web application to be able to
Dolibarr is released 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 (GPL-3+).
See the [COPYING](COPYING) file for a full copy of the license.
See the [COPYING](https://github.com/Dolibarr/dolibarr/blob/develop/COPYING) file for a full copy of the license.
Other licenses apply for some included dependencies. See [COPYRIGHT](COPYRIGHT) for a full list.
Other licenses apply for some included dependencies. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) for a full list.
## INSTALLING
@@ -65,9 +65,9 @@ You can use a Web server and a supported database (MySQL recommended) to install
*Note: migration process can safely be done multiple times.*
## NEWS
## WHAT'S NEW
See the [ChangeLog](ChangeLog) file.
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
## FEATURES
@@ -149,13 +149,17 @@ These are features that Dolibarr does **not** yet fully support:
Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](http://wiki.dolibarr.org).
## CONTRIBUTING
See file [CONTRIBUTING](https://github.com/Dolibarr/dolibarr/blob/develop/CONTRIBUTING.md)
## CREDITS
Dolibarr is the work of many contributors over the years and uses some fine libraries.
See [COPYRIGHT](COPYRIGHT) file.
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
## SOCIAL NETWORKS
## NEWS AND SOCIAL NETWORKS
Follow Dolibarr project on:

View File

@@ -239,7 +239,7 @@ http://packages.qa.debian.org/t/tcpdf.html
##### Create/Maintain dolibarr package
To update dolibarr debian package when upstream version has changed
To update dolibarr debian package when upstream (official version of external project) has changed:
* You can git clone debian git repo
> git clone git.debian.org:/git/collab-maint/dolibarr.git [dolibarr-debian]
@@ -284,10 +284,10 @@ Then check/modify also the user/date signature:
- Name and email must match value into debian/control file (Entry added here is used by next step).
To update dolibarr debian package when only files into debian has changed
To update dolibarr debian package when only files into debian has changed, or if you include manually backport:
* Change files and commit.
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2)
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2, 3...)
Once files has been prepared, it's time to test:

View File

@@ -22,7 +22,8 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
"SF"=>"git ssh rsync",
"ASSO"=>"git ssh rsync"
@@ -351,6 +352,28 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
# Test that the ChangeLog is ok
$ret=`grep "ChangeLog for $MAJOR.$MINOR\.$BUILD" "$SOURCE/ChangeLog" 2>&1`;
if (! $ret)
{
print "Error: The ChangeLogFile was not updated. Run the following command first:\n";
if (! $BUILD)
{
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
else
{
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
print "\n";
exit;
}
else
{
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n";
}
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/)

View File

@@ -9,8 +9,8 @@ beta version of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog.
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Commit all changes.
@@ -31,8 +31,8 @@ complete release of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog.
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Commit all changes.

View File

@@ -16,12 +16,12 @@
"php": ">=5.3.0",
"ext-curl": "*",
"ccampbell/chromephp": "^4.1",
"ckeditor/ckeditor": "4.3.3",
"ckeditor/ckeditor": "dev-full/4.3.x#0b7c3f1",
"mike42/escpos-php": "dev-master",
"mobiledetect/mobiledetectlib": "2.8.3",
"phpoffice/phpexcel": "1.8.0",
"phpoffice/phpexcel": "1.8.1",
"restler/framework": "^3.0",
"tecnick.com/tcpdf": "6.2.6",
"tecnickcom/tcpdf": "6.2.6",
"raven/raven": "^0.12.0",
"firephp/firephp-core": "^0.4.0"
},

27
composer.lock generated
View File

@@ -4,8 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "d88b5c84a9ea1af354d867ba2e2ab251",
"content-hash": "85e60ec7f8ab593387c7bd10d8db860d",
"hash": "335eb7bd5c2eb116fd2da80b4f48e857",
"packages": [
{
"name": "ccampbell/chromephp",
@@ -52,16 +51,16 @@
},
{
"name": "ckeditor/ckeditor",
"version": "4.3.3",
"version": "dev-full/4.3.x",
"source": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor-releases.git",
"reference": "0068dd540ce8bf1815abb7b5455c55354bc56334"
"reference": "0b7c3f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/0068dd540ce8bf1815abb7b5455c55354bc56334",
"reference": "0068dd540ce8bf1815abb7b5455c55354bc56334",
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/252e512e911f21d880ea542fe162c4643885b317",
"reference": "0b7c3f1",
"shasum": ""
},
"type": "library",
@@ -89,7 +88,7 @@
"text",
"wysiwyg"
],
"time": "2014-02-26 15:34:37"
"time": "2014-02-26 15:43:10"
},
{
"name": "firephp/firephp-core",
@@ -239,16 +238,16 @@
},
{
"name": "phpoffice/phpexcel",
"version": "1.8.0",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PHPExcel.git",
"reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b"
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/e69a5e4d0ffa7fb6f171859e0a04346e580df30b",
"reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"shasum": ""
},
"require": {
@@ -292,7 +291,7 @@
"xls",
"xlsx"
],
"time": "2014-03-02 15:22:49"
"time": "2015-05-01 07:00:55"
},
{
"name": "raven/raven",
@@ -423,7 +422,7 @@
"time": "2015-08-04 07:52:49"
},
{
"name": "tecnick.com/tcpdf",
"name": "tecnickcom/tcpdf",
"version": "6.2.6",
"source": {
"type": "git",
@@ -483,7 +482,6 @@
"pdf417",
"qrcode"
],
"abandoned": "tecnickcom/tcpdf",
"time": "2015-01-28 18:51:40"
}
],
@@ -491,6 +489,7 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"ckeditor/ckeditor": 20,
"mike42/escpos-php": 20
},
"prefer-stable": false,

View File

@@ -69,7 +69,7 @@ Add tcpdi.php
Add tcpdi_parser.php and replace:
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
with:
require_once(dirname(__FILE__).'/../tecnick.com/tcpdf/include/tcpdf_filters.php');
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');

View File

@@ -19,8 +19,8 @@
*/
/**
* \file dev/intdata/generate-facture.php
* \brief Script de generation de donnees aleatoires pour les factures
* \file dev/intdata/generate-invoice.php
* \brief Script example to inject random customer invoices (for load tests)
*/
// Test si mode batch

View File

@@ -20,8 +20,8 @@
*/
/**
* \file dev/initdata/generate-commande.php
* \brief Script de generation de donnees aleatoires pour les commandes
* \file dev/initdata/generate-order.php
* \brief Script example to inject random orders (for load tests)
*/
// Test si mode batch

View File

@@ -20,8 +20,8 @@
*/
/**
* \file dev/initdata/generate-produit.php
* \brief Script de generation de donnees aleatoires pour les produits
* \file dev/initdata/generate-product.php
* \brief Script example to inject random products (for load tests)
*/
// Test si mode batch

View File

@@ -20,8 +20,8 @@
*/
/**
* \file dev/initdata/generate-propale.php
* \brief Script de generation de donnees aleatoires pour les propales
* \file dev/initdata/generate-proposal.php
* \brief Script example to inject random proposals (for load tests)
*/
// Test si mode batch

View File

@@ -20,8 +20,8 @@
*/
/**
* \file dev/initdata/generate-societe.php
* \brief Script de generation de donnees aleatoires pour les societes
* \file dev/initdata/generate-thirdparty.php
* \brief Script example to inject random thirdparties (for load tests)
*/
// Test si mode batch

View File

@@ -15,6 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*
* Get a distant dump file and load it into a mysql database
*/
$sapi_type = php_sapi_name();
@@ -32,9 +34,10 @@ $error=0;
$sourceserver=isset($argv[1])?$argv[1]:''; // user@server:/src/file
$password=isset($argv[2])?$argv[2]:'';
$database=isset($argv[3])?$argv[3]:'';
$loginbase=isset($argv[4])?$argv[4]:'';
$passwordbase=isset($argv[5])?$argv[5]:'';
$dataserver=isset($argv[3])?$argv[3]:'';
$database=isset($argv[4])?$argv[4]:'';
$loginbase=isset($argv[5])?$argv[5]:'';
$passwordbase=isset($argv[6])?$argv[6]:'';
// Include Dolibarr environment
$res=0;
@@ -64,7 +67,7 @@ if (preg_match('/^(.*)@(.*):(.*)$/',$sourceserver,$reg))
}
if (empty($sourceserver) || empty($server) || empty($login) || empty($sourcefile) || empty($password) || empty($database) || empty($loginbase) || empty($passwordbase))
{
print "Usage: $script_file login@server:/src/file.(sql|gz|bz2) passssh database loginbase passbase\n";
print "Usage: $script_file login@server:/src/file.(sql|gz|bz2) passssh databaseserver databasename loginbase passbase\n";
print "Return code: 0 if success, <>0 if error\n";
print "Warning, this script may take a long time.\n";
exit(-1);
@@ -108,14 +111,14 @@ if ($connection)
print 'Get file '.$sourcefile.' into '.$targetdir.$targetfile."\n";
ssh2_scp_recv($connection, $sourcefile, $targetdir.$targetfile);
$fullcommand="cat ".$targetdir.$targetfile." | mysql -u".$loginbase." -p".$passwordbase." -D ".$database;
$fullcommand="cat ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database;
if (preg_match('/\.bz2$/',$targetfile))
{
$fullcommand="bzip2 -c -d ".$targetdir.$targetfile." | mysql -u".$loginbase." -p".$passwordbase." -D ".$database;
$fullcommand="bzip2 -c -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database;
}
if (preg_match('/\.gz$/',$targetfile))
{
$fullcommand="gzip -d ".$targetdir.$targetfile." | mysql -u".$loginbase." -p".$passwordbase." -D ".$database;
$fullcommand="gzip -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database;
}
print "Load dump with ".$fullcommand."\n";
$output=array();

View File

@@ -0,0 +1,48 @@
Content-Type: multipart/mixed; boundary="===============4543832834454763172=="
Date: Thu, 12 Nov 2015 17:58:00 -0000
From: Administrator <admin@yourcompany.example.com>
MIME-Version: 1.0
Message-ID: 5nLkUQEIn50FnlwxWDkh59NfLof1ode0uC5cZEgm9Y4=@mailhog.example
Message-Id: <1447351080.369951963424683.576889035053436-dolibarr-7-thirdparty@PCHOME-LD>
Received: from pchome-ld by mailhog.example (Go-MailHog)
id 5nLkUQEIn50FnlwxWDkh59NfLof1ode0uC5cZEgm9Y4=@mailhog.example; Thu, 12 Nov 2015 18:58:00 +0100
Reply-To: Administrator <admin@yourcompany.example.com>
Return-Path: <admin@yourcompany.example.com>
Subject: A test email from thirdparty card
To: Thirdparty company <thirdpartycompany@yourcompany.example.com>
--===============4543832834454763172==
Content-Type: multipart/alternative;
boundary="===============8764907306434163361=="
MIME-Version: 1.0
--===============8764907306434163361==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
dGVzdDIKCi0tCkFkbWluaXN0cmF0b3IKClNlbnQgYnkgWW91ckNvbXBhbnkgWzFdIHVzaW5nIE9k
b28gWzJdCgosICBhY2Nlc3MgZGlyZWN0bHkgdG8gUGFydG5lciBBZ3JvbGFpdCBbM10KCgpbMV0g
aHR0cDovL3d3dy5leGFtcGxlLmNvbQpbMl0gaHR0cHM6Ly93d3cub2Rvby5jb20vClszXSBodHRw
Oi8vbG9jYWxob3N0OjgxNjkvd2ViL3NpZ251cD9yZWRpcmVjdD0lMkZ3ZWIlMjNhY3Rpb24lM0Rt
YWlsLmFjdGlvbl9tYWlsX3JlZGlyZWN0JTI2bW9kZWwlM0RyZXMucGFydG5lciUyNmlkJTNENyZ0
b2tlbj1nM0s0QWU1T0Q5a3UxaEVubVZUQiZkYj1vZG9vX3Y4Cg==
--===============8764907306434163361==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
PHA+dGVzdDI8L3A+Cgo8c3Bhbj4tLTxicj4KQWRtaW5pc3RyYXRvcjwvc3Bhbj4KCjxiciAvPjxz
bWFsbD5TZW50IGJ5IDxhIHN0eWxlPSdjb2xvcjppbmhlcml0JyBocmVmPSdodHRwOi8vd3d3LmV4
YW1wbGUuY29tJz5Zb3VyQ29tcGFueTwvYT4gdXNpbmcgPGEgc3R5bGU9J2NvbG9yOmluaGVyaXQn
IGhyZWY9J2h0dHBzOi8vd3d3Lm9kb28uY29tLyc+T2RvbzwvYT48L3NtYWxsPgoKCiwgPHNwYW4g
Y2xhc3M9J29lX21haWxfZm9vdGVyX2FjY2Vzcyc+PHNtYWxsPmFjY2VzcyBkaXJlY3RseSB0byA8
YSBzdHlsZT0nY29sb3I6aW5oZXJpdCcgaHJlZj0naHR0cDovL2xvY2FsaG9zdDo4MTY5L3dlYi9z
aWdudXA/cmVkaXJlY3Q9JTJGd2ViJTIzYWN0aW9uJTNEbWFpbC5hY3Rpb25fbWFpbF9yZWRpcmVj
dCUyNm1vZGVsJTNEcmVzLnBhcnRuZXIlMjZpZCUzRDcmdG9rZW49ZzNLNEFlNU9EOWt1MWhFbm1W
VEImZGI9b2Rvb192OCc+UGFydG5lciBBZ3JvbGFpdDwvYT48L3NtYWxsPjwvc3Bhbj4K
--===============8764907306434163361==--
--===============4543832834454763172==--

View File

@@ -619,17 +619,28 @@ foreach ($skeletonfiles as $skeletonfile => $outfile)
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print '<td>'.\$obj->field1.'</td>';",'/').'/', $varprop, $targetcontent);
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print '<td>'.\$obj->field2.'</td>';",'/').'/', '', $targetcontent);
// LIST_OF_TD_LABEL_FIELDS_CREATE and EDIT - List of td for card view
// LIST_OF_TD_LABEL_FIELDS_CREATE - List of td for card view
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.\$".$prop['field'].".'\"></td></tr>';\n";
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.GETPOST('".$prop['field']."').'\"></td></tr>';\n";
}
}
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_CREATE/', $varprop, $targetcontent);
// LIST_OF_TD_LABEL_FIELDS_EDIT - List of td for card view
$varprop="\n";
$cleanparam='';
foreach($property as $key => $prop)
{
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
{
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.\$object->".$prop['field'].".'\"></td></tr>';\n";
}
}
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_EDIT/', $varprop, $targetcontent);
// LIST_OF_TD_LABEL_FIELDS_VIEW - List of td for card view

View File

@@ -112,7 +112,7 @@ if (empty($reshook))
if (empty($object->ref))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
}
if (! $error)
@@ -152,7 +152,7 @@ if (empty($reshook))
if (empty($object->ref))
{
$error++;
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
}
if (! $error)
@@ -189,8 +189,8 @@ if (empty($reshook))
}
else
{
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
else setEventMessages($object->error,null,'errors');
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, null, 'errors');
}
}
}
@@ -281,12 +281,17 @@ if (($id || $ref) && $action == 'edit')
// Part to show record
if ($id && (empty($action) || $action == 'view'))
if ($id && (empty($action) || $action == 'view' || $action == 'delete'))
{
print load_fiche_titre($langs->trans("MyModule"));
dol_fiche_head();
if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
print $formconfirm;
}
print '<table class="border centpercent">'."\n";
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
// LIST_OF_TD_LABEL_FIELDS_VIEW
@@ -310,14 +315,7 @@ if ($id && (empty($action) || $action == 'view'))
if ($user->rights->mymodule->delete)
{
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile
{
print '<div class="inline-block divButAction"><span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span></div>'."\n";
}
else
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
}
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
}
}
print '</div>'."\n";

View File

@@ -96,6 +96,23 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
if ($result < 0) dol_print_error($db);
}
// Definition of fields for list
$arrayfields=array(
't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
@@ -267,22 +284,6 @@ if ($resql)
print '</div>';
}
$arrayfields=array(
't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields

View File

@@ -27,8 +27,8 @@
* @since 2008-03-04
*/
require_once('../../htdocs/includes/tecnick.com/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnick.com/tcpdf/tcpdf.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

View File

@@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n";
* @since 2008-09-15
*/
require_once('../../htdocs/includes/tecnick.com/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnick.com/tcpdf/tcpdf.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

5
htdocs/.gitignore vendored
View File

@@ -15,3 +15,8 @@
/teclib*
/test.php
/ultimatepdf*
/lead
/dolimed*
/allscreens*
/ecommerce/
/cabinetmed*

View File

@@ -1,4 +1,4 @@
<?PHP
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/customer/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card customer ventilation
*/
@@ -88,7 +88,6 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/customer/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from customers invoices
*/
require '../../main.inc.php';
@@ -166,16 +166,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
* Customer Invoice lines
*/
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
$sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line";
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
$sql .= " aa.rowid as aarowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " WHERE f.fk_statut > 0";
$sql .= " AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
// Add search filter like

View File

@@ -23,7 +23,7 @@
*/
/**
* \file htdocs/accountancy/supplier/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card supplier ventilation
*/
@@ -88,7 +88,6 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from suppliers invoices
*/
require '../../main.inc.php';
@@ -171,19 +171,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
*
*/
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.tva_tx as tva_tx_line, ";
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
$sql .= " , f.datef";
$sql .= " , l.product_type as type_l";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
// Add search filter like
if (strlen(trim($search_invoice))) {
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";

View File

@@ -48,7 +48,8 @@ $boxes = array();
if ($action == 'addconst')
{
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES",$_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
}
if ($action == 'add') {
@@ -456,8 +457,8 @@ $var=false;
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.$langs->trans("Parameter").'</td>';
print '<td class="liste_titre">'.$langs->trans("Value").'</td>';
print '<td class="liste_titre"></td>';
print '</tr>';
print '<tr '.$bc[$var].'>';
print '<td>';
print $langs->trans("MaxNbOfLinesForBoxes");
@@ -465,12 +466,21 @@ print '</td>'."\n";
print '<td>';
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.$conf->global->MAIN_BOXES_MAXLINES.'">';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'" name="Button">';
print '</td>'."\n";
print '</tr>';
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
print '</td>';
print '</tr>';
}
print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'" name="Button"></div>';
print '</form>';
print "\n".'<!-- End Other Const -->'."\n";

View File

@@ -594,7 +594,7 @@ if ($action == 'edit' || $action == 'updateedit')
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print '<table class="nobordernopadding">';
print "<tr><td><label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
@@ -602,8 +602,8 @@ if ($action == 'edit' || $action == 'updateedit')
{
print '<tr><td align="left"><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
print '</td></tr>';
}
print '</td></tr>';
$opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
@@ -614,7 +614,7 @@ if ($action == 'edit' || $action == 'updateedit')
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@@ -639,14 +639,14 @@ if ($action == 'edit' || $action == 'updateedit')
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print '<table class="nobordernopadding">';
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
if(! isOnlyOneLocalTax(2))
{
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
print '</td></tr>';
}
print '<tr><td align="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
@@ -656,7 +656,7 @@ if ($action == 'edit' || $action == 'updateedit')
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@@ -965,7 +965,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
@@ -974,7 +974,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
@@ -988,7 +988,7 @@ else
/*
* Local Taxes
*/
if ($mysoc->useLocalTax(1))
if ($mysoc->useLocalTax(1)) // True if we found at least on vat with a setup adding a localtax 1
{
// Local Tax 1
print '<br>';
@@ -1000,7 +1000,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td></label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
@@ -1028,7 +1028,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"no_lt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@@ -1039,7 +1039,7 @@ else
print "</table>";
}
if ($mysoc->useLocalTax(2))
if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1
{
// Local Tax 2
print '<br>';
@@ -1051,7 +1051,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
@@ -1080,7 +1080,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";

View File

@@ -150,7 +150,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.fdm, c.decalage, c.active, c.sortorder FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c";
@@ -182,7 +182,7 @@ $tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC";
$tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC";
$tabsqlsort[8] ="country DESC, libelle ASC";
$tabsqlsort[9] ="label ASC";
$tabsqlsort[10]="country ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
$tabsqlsort[10]="country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
$tabsqlsort[11]="element ASC, source ASC, code ASC";
$tabsqlsort[12]="sortorder ASC, code ASC";
$tabsqlsort[13]="code ASC";
@@ -214,7 +214,7 @@ $tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country,accountancy_code,deductible";
$tabfield[8] = "code,libelle,country_id,country";
$tabfield[9] = "code,label,unicode";
$tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[10]= "country_id,country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfield[13]= "code,libelle,type,accountancy_code";
@@ -246,7 +246,7 @@ $tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
$tabfieldvalue[8] = "code,libelle,country";
$tabfieldvalue[9] = "code,label,unicode";
$tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[10]= "country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11]= "element,source,code,libelle";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldvalue[13]= "code,libelle,type,accountancy_code";
@@ -278,7 +278,7 @@ $tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
$tabfieldinsert[8] = "code,libelle,fk_country";
$tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[10]= "fk_pays,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[11]= "element,source,code,libelle";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldinsert[13]= "code,libelle,type,accountancy_code";
@@ -376,7 +376,7 @@ $tabhelp[6] = array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->
$tabhelp[7] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[8] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[9] = array('code'=>$langs->trans("EnterAnyCode"), 'unicode'=>$langs->trans("UnicodeCurrency"));
$tabhelp[10] = array('taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"));
$tabhelp[10] = array('code'=>$langs->trans("EnterAnyCode"), 'taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"));
$tabhelp[11] = array();
$tabhelp[12] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[13] = array('code'=>$langs->trans("EnterAnyCode"));
@@ -486,7 +486,7 @@ if ($id == 25)
'shipping_send' => $langs->trans('MailToSendShipment'),
'fichinter_send' => $langs->trans('MailToSendIntervention'),
'askpricesupplier_send' => $langs->trans('MailToSendSupplierRequestForQuotation'),
'supplier_proposal_send' => $langs->trans('MailToSendSupplierRequestForQuotation'),
'order_supplier_send' => $langs->trans('MailToSendSupplierOrder'),
'invoice_supplier_send' => $langs->trans('MailToSendSupplierInvoice'),
@@ -522,8 +522,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
@@ -1321,7 +1321,7 @@ if ($id)
// Can an entry be erased or disabled ?
$iserasable=1;$isdisable=1; // true by default
if (isset($obj->code))
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $isdisable = 0; }
else if ($obj->code == 'RECEP') { $iserasable = 0; $isdisable = 0; }
@@ -1356,7 +1356,7 @@ if ($id)
print "</td>";
// Modify link
if ($iserasable) print '<td align="center"><a href="'.$url.'action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
if ($iserasable) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link
@@ -1479,7 +1479,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
} // For state page, we do not show the country input (we link to region, not country)
print '<td>';
$fieldname='country';
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28);
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28, 'maxwidth300');
print '</td>';
}
elseif ($fieldlist[$field] == 'country_id')

View File

@@ -70,7 +70,8 @@ if ($action == "save")
* View
*/
llxHeader('',$langs->trans("Audit"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Audit"),$wikihelp);
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -56,24 +56,28 @@ if (empty($conf->use_javascript_ajax))
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
}
/*
* Action
*/
if (GETPOST('cancel'))
{
$action='';
}
if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
@@ -81,7 +85,14 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
/*
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
/*
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
@@ -91,15 +102,22 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
*/
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
// This one is not always defined
if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity);
@@ -199,16 +217,6 @@ if ($action == 'edit') // Edit
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
}
// Max size of lists
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
@@ -327,11 +335,12 @@ if ($action == 'edit') // Edit
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
print '<br>';
}
else // Show
{
@@ -393,14 +402,6 @@ else // Show
print '<td width="20">&nbsp;</td>';
print "</tr>";
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableFileCache").'</td><td>' . yn($conf->global->MAIN_ACTIVATE_FILECACHE) . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
}
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
print '<td width="20">&nbsp;</td>';
@@ -505,7 +506,6 @@ else // Show
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
print '<br>';
}

View File

@@ -152,7 +152,8 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$subject = $_POST['subject'];
$body = $_POST['message'];
$deliveryreceipt= $_POST["deliveryreceipt"];
$trackid = GETPOST('trackid');
//Check if we have to decode HTML
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
$body=dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401);
@@ -202,7 +203,9 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$sendtoccc,
$deliveryreceipt,
$msgishtml,
$errors_to
$errors_to,
'',
$trackid
);
$result=$mailfile->sendfile();
@@ -693,6 +696,7 @@ else
$formmail = new FormMail($db);
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid='test';
$formmail->withfromreadonly=0;
$formmail->withsubstit=0;
$formmail->withfrom=1;

View File

@@ -37,6 +37,7 @@ $langs->load("admin");
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
$action=GETPOST('action','alpha');
$value=GETPOST('value', 'alpha');
$page_y=GETPOST('page_y','int');
if (! $user->admin)
accessforbidden();
@@ -67,7 +68,7 @@ if ($action == 'set' && $user->admin)
{
$result=activateModule($value);
if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode);
header("Location: modules.php?mode=".$mode.($page_y?'&page_y='.$page_y:''));
exit;
}
@@ -75,7 +76,7 @@ if ($action == 'reset' && $user->admin)
{
$result=unActivateModule($value);
if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode);
header("Location: modules.php?mode=".$mode.($page_y?'&page_y='.$page_y:''));
exit;
}
@@ -425,7 +426,7 @@ if ($mode != 'marketplace')
}
else
{
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
}
@@ -488,7 +489,7 @@ if ($mode != 'marketplace')
else
{
// Module non actif
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'switch_off');
print "</a>\n";
}

View File

@@ -43,8 +43,9 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha');
// Supported OAUTH
$supportedoauth2array=array('OAUTH_GOOGLE_NAME');
// Supported OAUTH (a provider is supported when a file xxx_oauth2callback.php is available into htdocs/core/modules/oauth)
$supportedoauth2array=array('OAUTH_GOOGLE_NAME'=>'google');
// API access parameters OAUTH
$list = array (
array(
@@ -315,7 +316,7 @@ $var = true;
foreach ($list as $key)
{
$supported=0;
if (in_array($key[0], $supportedoauth2array)) $supported=1;
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
if (! $supported) continue; // show only supported
print '<tr class="liste_titre">';
@@ -325,7 +326,7 @@ foreach ($list as $key)
if ($supported)
{
$redirect_uri=$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php';
$redirect_uri=$urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$key[0]].'_oauthcallback.php';
$var = !$var;
print '<tr '.$bc[$var].' class="value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';

View File

@@ -62,7 +62,8 @@ if ($action == 'remove')
* View
*/
llxHeader('',$langs->trans("DefaultRights"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("DefaultRights"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -79,7 +79,8 @@ if (GETPOST("action") == 'set_proxy')
$form = new Form($db);
llxHeader('',$langs->trans("Proxy"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Proxy"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -187,7 +187,8 @@ if ($action == 'maj_pattern')
*/
$form = new Form($db);
llxHeader('',$langs->trans("Passwords"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Passwords"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -109,7 +109,8 @@ else if ($action == 'delete')
$form = new Form($db);
llxHeader('',$langs->trans("Files"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Files"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -87,7 +87,8 @@ else if ($action == 'updateform')
$form = new Form($db);
llxHeader('',$langs->trans("Miscellaneous"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Miscellaneous"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@@ -25,12 +25,12 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load('other');
$langs->load('askpricesupplier');
$langs->load('supplier_proposal');
if (! $user->admin) accessforbidden();
@@ -38,7 +38,7 @@ $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='askpricesupplier';
$type='supplier_proposal';
/*
* Actions
@@ -46,9 +46,9 @@ $type='askpricesupplier';
$error=0;
if ($action == 'updateMask')
{
$maskconstaskpricesupplier=GETPOST('maskconstaskpricesupplier','alpha');
$maskaskpricesupplier=GETPOST('maskaskpricesupplier','alpha');
if ($maskconstaskpricesupplier) $res = dolibarr_set_const($db,$maskconstaskpricesupplier,$maskaskpricesupplier,'chaine',0,'',$conf->entity);
$maskconstsupplier_proposal=GETPOST('maskconstsupplier_proposal','alpha');
$masksupplier_proposal=GETPOST('masksupplier_proposal','alpha');
if ($maskconstsupplier_proposal) $res = dolibarr_set_const($db,$maskconstsupplier_proposal,$masksupplier_proposal,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -66,15 +66,15 @@ if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
$askpricesupplier = new AskPriceSupplier($db);
$askpricesupplier->initAsSpecimen();
$supplier_proposal = new SupplierProposal($db);
$supplier_proposal->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/askpricesupplier/doc/pdf_".$modele.".modules.php");
$file=dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
if (file_exists($file))
{
$filefound=1;
@@ -89,9 +89,9 @@ if ($action == 'specimen')
$module = new $classname($db);
if ($module->write_file($askpricesupplier,$langs) > 0)
if ($module->write_file($supplier_proposal,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=askpricesupplier&file=SPECIMEN.pdf");
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
return;
}
else
@@ -107,11 +107,11 @@ if ($action == 'specimen')
}
}
if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK')
if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
{
$draft = GETPOST('ASKPRICESUPPLIER_DRAFT_WATERMARK','alpha');
$draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "ASKPRICESUPPLIER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
@@ -124,11 +124,11 @@ if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK')
}
}
if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT')
if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
{
$freetext = GETPOST('ASKPRICESUPPLIER_FREE_TEXT'); // No alpha here, we want exact string
$freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "ASKPRICESUPPLIER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -142,9 +142,9 @@ if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT')
}
}
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER')
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER",$value,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL",$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -198,15 +198,15 @@ else if ($action == 'del')
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->ASKPRICESUPPLIER_ADDON_PDF == "$value") dolibarr_del_const($db, 'ASKPRICESUPPLIER_ADDON_PDF',$conf->entity);
if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF',$conf->entity);
}
}
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "ASKPRICESUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
$conf->global->ASKPRICESUPPLIER_ADDON_PDF = $value;
$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
}
// On active le modele
@@ -222,7 +222,7 @@ else if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "ASKPRICESUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON",$value,'chaine',0,'',$conf->entity);
}
@@ -233,23 +233,23 @@ else if ($action == 'setmod')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader('',$langs->trans("AskPriceSupplierSetup"));
llxHeader('',$langs->trans("SupplierProposalSetup"));
$form=new Form($db);
//if ($mesg) print $mesg;
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup');
print load_fiche_titre($langs->trans("SupplierProposalSetup"),$linkback,'title_setup');
$head = askpricesupplier_admin_prepare_head();
$head = supplier_proposal_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'askpricesupplier');
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal');
/*
* Module numerotation
*/
print load_fiche_titre($langs->trans("AskPriceSupplierNumberingModules"),'','');
print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -263,7 +263,7 @@ print '</tr>'."\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/askpricesupplier/");
$dir = dol_buildpath($reldir."core/modules/supplier_proposal/");
if (is_dir($dir))
{
@@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 21) == 'mod_askpricesupplier_' && substr($file, dol_strlen($file)-3, 3) == 'php')
if (substr($file, 0, 21) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file)-4);
@@ -302,7 +302,7 @@ foreach ($dirmodels as $reldir)
print '</td>'."\n";
print '<td align="center">';
if ($conf->global->ASKPRICESUPPLIER_ADDON == "$file")
if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file")
{
print img_picto($langs->trans("Activated"),'switch_on');
}
@@ -314,13 +314,13 @@ foreach ($dirmodels as $reldir)
}
print '</td>';
$askpricesupplier=new AskPriceSupplier($db);
$askpricesupplier->initAsSpecimen();
$supplier_proposal=new SupplierProposal($db);
$supplier_proposal->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$askpricesupplier);
$nextval=$module->getNextValue($mysoc,$supplier_proposal);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) {
@@ -351,7 +351,7 @@ print "</table><br>\n";
* Document templates generators
*/
print load_fiche_titre($langs->trans("AskPriceSupplierPDFModules"),'','');
print load_fiche_titre($langs->trans("SupplierProposalPDFModules"),'','');
// Load array def with activated templates
$def = array();
@@ -394,7 +394,7 @@ foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
{
$dir = dol_buildpath($reldir."core/modules/askpricesupplier".$valdir);
$dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir);
if (is_dir($dir))
{
@@ -452,7 +452,7 @@ foreach ($dirmodels as $reldir)
// Defaut
print "<td align=\"center\">";
if ($conf->global->ASKPRICESUPPLIER_ADDON_PDF == "$name")
if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
@@ -526,10 +526,10 @@ print "</tr>";
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ASKPRICESUPPLIER_FREE_TEXT">';
print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnAskPriceSupplier").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='ASKPRICESUPPLIER_FREE_TEXT';
print $langs->trans("FreeLegalTextOnSupplierProposal").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
@@ -548,10 +548,10 @@ print '</form>';
$var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"set_ASKPRICESUPPLIER_DRAFT_WATERMARK\">";
print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("WatermarkOnDraftAskPriceSupplier").'<br>';
print '<input size="50" class="flat" type="text" name="ASKPRICESUPPLIER_DRAFT_WATERMARK" value="'.$conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK.'">';
print $langs->trans("WatermarkOnDraftSupplierProposal").'<br>';
print '<input size="50" class="flat" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
@@ -561,20 +561,20 @@ if ($conf->banque->enabled)
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER").'</td><td>&nbsp</td><td align="right">';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER');
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
}
else
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER))
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td></tr>';
@@ -583,7 +583,7 @@ else
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
print '</table>';
@@ -601,7 +601,7 @@ print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->askpricesupplier->dir_output."</td>\n</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
print "</table>\n<br>";
$db->close();

View File

@@ -100,7 +100,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head=user_admin_prepare_head();
dol_fiche_head($head,'card', $langs->trans("User"), 0, 'user');
dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), 0, 'user');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@@ -1173,7 +1173,7 @@ if ($id > 0)
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.dol_htmlentities($object->label).'</td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';

View File

@@ -189,6 +189,7 @@ class ActionComm extends CommonObject
// Check parameters
if (empty($this->userownerid))
{
dol_syslog("You tried to create an event but mandatory property ownerid was not defined", LOG_WARNING);
$this->errors[]='ErrorPropertyUserowneridNotDefined';
return -1;
}

View File

@@ -87,7 +87,9 @@ $pid=GETPOST("projectid","int",3);
$status=GETPOST("status");
$type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
$actioncode=GETPOST("actioncode","array",3) ? GETPOST("actioncode","array",3):(GETPOST("actioncode")=='0'?'0':'');
if(is_array($actioncode))$actioncode =implode(',', $actioncode);
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
@@ -437,7 +439,7 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;

View File

@@ -106,7 +106,7 @@ if ($action == 'add' || $action == 'update')
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action='create';
}
}
@@ -147,7 +147,7 @@ if ($action == 'add' || $action == 'update')
else
{
$reload = 0;
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action= "edit";
}
}

View File

@@ -105,7 +105,7 @@ if (empty($reshook))
$result=$object->fetch($id);
$object->code_compta=$_POST["customeraccountancycode"];
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// conditions de reglement
@@ -113,7 +113,7 @@ if (empty($reshook))
{
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// mode de reglement
@@ -121,7 +121,7 @@ if (empty($reshook))
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// assujetissement a la TVA
@@ -130,7 +130,7 @@ if (empty($reshook))
$object->fetch($id);
$object->tva_assuj=$_POST['assujtva_value'];
$result=$object->update($object->id);
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// set prospect level
@@ -139,7 +139,7 @@ if (empty($reshook))
$object->fetch($id);
$object->fk_prospectlevel=GETPOST('prospect_level_id','alpha');
$result=$object->set_prospect_level($user);
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// set communication status
@@ -148,7 +148,7 @@ if (empty($reshook))
$object->fetch($id);
$object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
$result=$object->set_commnucation_level($user);
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// update outstandng limit
@@ -157,7 +157,7 @@ if (empty($reshook))
$object->fetch($id);
$object->outstanding_limit=GETPOST('outstanding_limit');
$result=$object->set_OutstandingBill($user);
if ($result < 0) setEventMessage($object->error,$object->errors,'errors');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
}

View File

@@ -359,7 +359,7 @@ if (empty($reshook))
{
$statut=2; // Status 'sent partially' (because at least one error)
if ($nbok > 0) setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
else setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
}
else
{

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2010-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
@@ -131,7 +131,7 @@ if (empty($reshook))
{
if (! GETPOST('socid', 3))
{
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
}
else
{
@@ -141,7 +141,7 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
exit();
} else {
if (count($object->errors) > 0) setEventMessage($object->errors, 'errors');
if (count($object->errors) > 0) setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
@@ -157,7 +157,7 @@ if (empty($reshook))
exit();
} else {
$langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -211,8 +211,8 @@ if (empty($reshook))
}
} else {
$langs->load("errors");
if (count($object->errors) > 0) setEventMessage($object->errors, 'errors');
else setEventMessage($langs->trans($object->error), 'errors');
if (count($object->errors) > 0) setEventMessages($object->error, $object->errors, 'errors');
else setEventMessages($langs->trans($object->error), null, 'errors');
}
}
@@ -318,7 +318,7 @@ if (empty($reshook))
$id = $object->create_from($user);
} else {
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
setEventMessages($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), null, 'errors');
}
} else {
$object->ref = GETPOST('ref');
@@ -507,7 +507,7 @@ if (empty($reshook))
if ($result < 0)
{
$error++;
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
}
}
@@ -671,7 +671,7 @@ if (empty($reshook))
if ($object->id > 0) {
$result = $object->insert_discount($_POST["remise_id"]);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -875,7 +875,7 @@ if (empty($reshook))
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
setEventMessage($mesg, 'errors');
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $date_start, $date_end, $array_options, $fk_unit);
@@ -929,13 +929,13 @@ if (empty($reshook))
} else {
$db->rollback();
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
// Mise a jour d'une ligne dans la propale
// Update a line within proposal
else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save'))
{
// Define info_bits
@@ -991,7 +991,7 @@ if (empty($reshook))
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error ++;
}
} else {
@@ -1040,7 +1040,7 @@ if (empty($reshook))
} else {
$db->rollback();
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -1137,9 +1137,9 @@ if (empty($reshook))
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -1276,7 +1276,7 @@ if ($action == 'create')
// Ref customer
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
print '<input type="text" name="ref_client" value=""></td>';
print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
print '</tr>';
// Third party
@@ -1290,6 +1290,19 @@ if ($action == 'create')
} else {
print '<td colspan="2">';
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1);
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&ref_client="+$("input[name=ref_client]").val();
});
});
</script>';
}
print '</td>';
}
print '</tr>' . "\n";
@@ -1636,13 +1649,13 @@ if ($action == 'create')
else if ($action == 'validate') {
$error = 0;
// on verifie si l'objet est en numerotation provisoire
// We verifie whether the object is provisionally numbering
$ref = substr($object->ref, 1, 4);
if ($ref == 'PROV') {
$numref = $object->getNextNumRef($soc);
if (empty($numref)) {
$error ++;
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
$numref = $object->ref;
@@ -2304,6 +2317,15 @@ if ($action == 'create')
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='pro'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'pro'.$object->id);
}
$formmail->withfrom = 1;
$liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)

View File

@@ -439,7 +439,8 @@ class Propal extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
@@ -600,7 +601,8 @@ class Propal extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@@ -2739,7 +2741,7 @@ class Propal extends CommonObject
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -54,12 +54,12 @@ if ($id > 0 || ! empty($ref))
if ($ret == 0)
{
$langs->load("errors");
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
$error++;
}
else if ($ret < 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
@@ -75,7 +75,7 @@ else
/*
* Ajout d'un nouveau contact
* Add a new contact
*/
if ($action == 'addcontact' && $user->rights->propale->creer)
@@ -96,16 +96,16 @@ if ($action == 'addcontact' && $user->rights->propale->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
// Bascule du statut d'un contact
// Toggle the status of a contact
else if ($action == 'swapstatut' && $user->rights->propale->creer)
{
if ($object->id > 0)
@@ -114,7 +114,7 @@ else if ($action == 'swapstatut' && $user->rights->propale->creer)
}
}
// Efface un contact
// Deletes a contact
else if ($action == 'deletecontact' && $user->rights->propale->creer)
{
$result = $object->delete_contact($lineid);

View File

@@ -306,7 +306,7 @@ if ($result)
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
if ($conf->categorie->enabled && $user->rights->produit->lire)
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
@@ -322,7 +322,7 @@ if ($result)
print '</div>';
}
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);

View File

@@ -65,17 +65,17 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
if (! $res > 0)
{
$error++;
setEventMessage($langs->trans("ErrorFailedToLoadDiscount"), 'errors');
setEventMessages($langs->trans("ErrorFailedToLoadDiscount"), null, 'errors');
}
if (! $error && price2num($_POST["amount_ttc_1"]+$_POST["amount_ttc_2"]) != $discount->amount_ttc)
{
$error++;
setEventMessage($langs->trans("TotalOfTwoDiscountMustEqualsOriginal"), 'errors');
setEventMessages($langs->trans("TotalOfTwoDiscountMustEqualsOriginal"), null, 'errors');
}
if (! $error && $discount->fk_facture_line)
{
$error++;
setEventMessage($langs->trans("ErrorCantSplitAUsedDiscount"), 'errors');
setEventMessages($langs->trans("ErrorCantSplitAUsedDiscount"), null, 'errors');
}
if (! $error)
{
@@ -166,13 +166,13 @@ if ($action == 'setremise')
else
{
$error++;
setEventMessage($soc->error, 'errors');
setEventMessages($soc->error, $soc->errors, 'errors');
}
}
}
else
{
setEventMessage($langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")), 'errors');
setEventMessages($langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")), null, 'errors');
}
}
@@ -194,7 +194,7 @@ if (GETPOST("action") == 'confirm_remove' && GETPOST("confirm")=='yes')
}
else
{
setEventMessage($discount->error, 'errors');
setEventMessages($discount->error, $discount->errors, 'errors');
$db->rollback();
}
}
@@ -216,7 +216,7 @@ if ($socid > 0)
$object->fetch($socid);
/*
* Affichage onglets
* Display tabs
*/
$head = societe_prepare_head($object);
@@ -300,7 +300,7 @@ if ($socid > 0)
}
/*
* Liste remises fixes restant en cours (= liees a acune facture ni ligne de facture)
* Liste remises fixes restant en cours (= liees a aucune facture ni ligne de facture)
*/
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
$sql.= " rc.datec as dc, rc.description,";

View File

@@ -5,10 +5,10 @@
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
@@ -123,7 +123,7 @@ if (empty($reshook))
{
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
}
else
{
@@ -140,7 +140,7 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$object = $orig;
$action='';
}
@@ -156,12 +156,11 @@ if (empty($reshook))
$result = $object->set_reopen($user);
if ($result > 0)
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
setEventMessages($langs->trans('OrderReopened', $object->ref), null);
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -177,7 +176,7 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -208,7 +207,7 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -225,7 +224,7 @@ if (empty($reshook))
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
if ($datecommande == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors');
$action = 'create';
$error++;
}
@@ -374,11 +373,11 @@ if (empty($reshook))
if ($reshook < 0)
$error++;
} else {
setEventMessage($srcobject->error, 'errors');
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error++;
}
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
} else {
@@ -414,7 +413,7 @@ if (empty($reshook))
{
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
if ($result < 0) {
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
$error++;
}
}
@@ -432,7 +431,7 @@ if (empty($reshook))
} else {
$db->rollback();
$action = 'create';
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -442,7 +441,7 @@ if (empty($reshook))
$ret=$object->classifyBilled();
if ($ret < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -471,7 +470,7 @@ if (empty($reshook))
$result = $object->set_date($user, $date);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -481,7 +480,7 @@ if (empty($reshook))
$result = $object->set_date_livraison($user, $datelivraison);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -529,16 +528,25 @@ if (empty($reshook))
elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
{
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// bank account
else if ($action == 'setbankaccount' && $user->rights->commande->creer) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// shipping method
else if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setremisepercent' && $user->rights->commande->creer) {
@@ -586,11 +594,11 @@ if (empty($reshook))
}
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
@@ -599,11 +607,11 @@ if (empty($reshook))
$error++;
}
if ($qty == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error++;
}
@@ -664,7 +672,7 @@ if (empty($reshook))
}
else
{
setEventMessage($prodcustprice->error,'errors');
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
}
}
@@ -748,7 +756,7 @@ if (empty($reshook))
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
setEventMessage($mesg, 'errors');
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $info_bits, 0, $price_base_type, $pu_ttc, $date_start, $date_end, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $fk_unit);
@@ -802,7 +810,7 @@ if (empty($reshook))
unset($_POST['date_endmonth']);
unset($_POST['date_endyear']);
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -866,7 +874,7 @@ if (empty($reshook))
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
} else {
@@ -914,7 +922,7 @@ if (empty($reshook))
unset($_POST['fournprice']);
unset($_POST['buying_price']);
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -947,7 +955,7 @@ if (empty($reshook))
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action='';
}
}
@@ -1000,7 +1008,7 @@ if (empty($reshook))
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action='';
}
}
@@ -1032,7 +1040,7 @@ if (empty($reshook))
else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) {
$result = $object->cloture($user);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -1059,7 +1067,7 @@ if (empty($reshook))
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action='';
}
}
@@ -1068,7 +1076,7 @@ if (empty($reshook))
$result = $object->cancel($idwarehouse);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -1115,9 +1123,9 @@ if (empty($reshook))
$file = $upload_dir . '/' . GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret)
setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action = '';
}
}
@@ -1181,9 +1189,9 @@ if (empty($reshook))
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -1241,8 +1249,10 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($socid > 0)
$res = $soc->fetch($socid);
if (! empty($origin) && ! empty($originid))
{
$projectid = 0;
$remise_absolue = 0;
if (! empty($origin) && ! empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
@@ -1252,6 +1262,20 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($element == 'project') {
$projectid = $originid;
if (!$cond_reglement_id) {
$cond_reglement_id = $soc->cond_reglement_id;
}
if (!$mode_reglement_id) {
$mode_reglement_id = $soc->mode_reglement_id;
}
if (!$remise_percent) {
$remise_percent = $soc->remise_percent;
}
if (!$dateorder) {
// Do not set 0 here (0 for a date is 1970)
$dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder);
}
} else {
// For compatibility
if ($element == 'order' || $element == 'commande') {
@@ -1338,10 +1362,10 @@ if ($action == 'create' && $user->rights->commande->creer)
// Reference client
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER))
if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER) && ! empty($origin) && ! empty($originid))
print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
else
print '<input type="text" name="ref_client" value=""></td>';
print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
print '</tr>';
// Client
@@ -1355,6 +1379,19 @@ if ($action == 'create' && $user->rights->commande->creer)
} else {
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&ref_client="+$("input[name=ref_client]").val();
});
});
</script>';
}
print '</td>';
}
print '</tr>' . "\n";
@@ -1515,9 +1552,23 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">';
print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';
$newclassname = $classname;
if ($newclassname == 'Propal')
$newclassname = 'CommercialProposal';
switch ($classname) {
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
@@ -2394,6 +2445,15 @@ if ($action == 'create' && $user->rights->commande->creer)
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='ord'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id);
}
$formmail->withfrom = 1;
$liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)

View File

@@ -1159,7 +1159,7 @@ class Commande extends CommonOrder
{
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type, fk_unit=$fk_unit", LOG_DEBUG);
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@@ -1220,7 +1220,8 @@ class Commande extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type,'', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@@ -2442,7 +2443,8 @@ class Commande extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@@ -2964,7 +2966,7 @@ class Commande extends CommonOrder
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,11 +69,11 @@ if ($action == 'addcontact' && $user->rights->commande->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}

View File

@@ -302,8 +302,8 @@ if ($resql)
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.='</div>';
}
// If the user can view categories or products
if ($conf->categorie->enabled && $user->rights->produit->lire)
// If the user can view prospects other than his'
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';

View File

@@ -74,7 +74,7 @@ if ($action == 'create')
if (is_array($selected) == false)
{
$error++;
setEventMessage($langs->trans('Error_OrderNotChecked'), 'errors');
setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors');
}
else
{
@@ -251,7 +251,7 @@ if (($action == 'create' || $action == 'add') && !$error)
}
else
{
setEventMessage($discount->error, 'errors');
setEventMessages($discount->error, $discount->errors, 'errors');
$error++;
break;
}
@@ -320,7 +320,7 @@ if (($action == 'create' || $action == 'add') && !$error)
}
else
{
setEventMessage($objectsrc->error, 'errors');
setEventMessages($objectsrc->error, $objectsrc->errors, 'errors');
$error++;
}
$ii++;
@@ -328,7 +328,7 @@ if (($action == 'create' || $action == 'add') && !$error)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
@@ -348,7 +348,7 @@ if (($action == 'create' || $action == 'add') && !$error)
$action='create';
$_GET["origin"]=$_POST["origin"];
$_GET["originid"]=$_POST["originid"];
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}

View File

@@ -152,13 +152,13 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu
$insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
if ($insertid > 0)
{
setEventMessage($langs->trans("RecordSaved"));
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id."&action=addline");
exit;
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
@@ -378,19 +378,6 @@ if ($id > 0 || ! empty($ref))
{
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro)
{
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
if ($action != 'addline')
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
@@ -409,6 +396,20 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
if ($object->type != 2 && $object->rappro)
{
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
print '</div>';
}

View File

@@ -291,7 +291,7 @@ if ($result < 0)
{
$langs->load("errors");
$error++;
setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors');
setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors');
}
else
{

View File

@@ -4,7 +4,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@@ -102,19 +102,19 @@ if ($_POST["action"] == 'add')
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'error');
$action='create'; // Force chargement page en mode creation
$error++;
}
if (empty($account->ref))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
$action='create'; // Force chargement page en mode creation
$error++;
}
if (empty($account->label))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors');
$action='create'; // Force chargement page en mode creation
$error++;
}
@@ -130,7 +130,7 @@ if ($_POST["action"] == 'add')
$_GET["id"]=$id; // Force chargement page en mode visu
}
else {
setEventMessage($account->error,'errors');
setEventMessages($account->error, $account->errors, 'errors');
$action='create'; // Force chargement page en mode creation
}
}
@@ -177,19 +177,19 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'error');
$action='edit'; // Force chargement page en mode creation
$error++;
}
if (empty($account->ref))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
$action='edit'; // Force chargement page en mode creation
$error++;
}
if (empty($account->label))
{
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors');
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors');
$action='edit'; // Force chargement page en mode creation
$error++;
}
@@ -206,7 +206,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
}
else
{
setEventMessage($account->error, 'errors');
setEventMessages($account->error, $account->errors, 'errors');
$action='edit'; // Force chargement page edition
}
}

View File

@@ -998,7 +998,12 @@ class Account extends CommonObject
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.$linkclose;
$linkend='</a>';
}
else if ($mode == 'receipts')
{
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id.$linkclose;
$linkend='</a>';
}
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' ');
$result.=$link.$this->label.$linkend;
return $result;

View File

@@ -133,9 +133,9 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes') {
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
} else {
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);

View File

@@ -81,7 +81,7 @@ if ($result < 0)
{
$langs->load("errors");
$error++;
setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors');
setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors');
}
else
{
@@ -113,7 +113,7 @@ else
if ($mode == 'standard')
{
// Chargement du tableau $amounts
// Loading table $amounts
$amounts = array();
$monthnext = $month+1;
@@ -153,7 +153,7 @@ else
dol_print_error($db);
}
// Calcul de $solde avant le debut du graphe
// Calculation of $solde before the start of the graph
$solde = 0;
$sql = "SELECT SUM(b.amount)";
@@ -265,7 +265,7 @@ else
if ($mode == 'standard')
{
// Chargement du tableau $amounts
// Loading table $amounts
$amounts = array();
$sql = "SELECT date_format(b.datev,'%Y%m%d')";
$sql.= ", SUM(b.amount)";
@@ -296,7 +296,7 @@ else
dol_print_error($db);
}
// Calcul de $solde avant le debut du graphe
// Calculation of $solde before the start of the graph
$solde = 0;
$sql = "SELECT SUM(b.amount)";
@@ -403,7 +403,7 @@ else
if ($mode == 'showalltime')
{
// Chargement du tableau $amounts
// Loading table $amounts
$amounts = array();
$sql = "SELECT date_format(b.datev,'%Y%m%d')";

View File

@@ -113,7 +113,7 @@ foreach ($accounts as $key=>$type)
{
$result=$acc->load_board($user,$acc->id);
if ($result<0) {
setEventMessage($acc->error, 'errors');
setEventMessages($acc->error, $acc->errors, 'errors');
} else {
print $result->nbtodo;
if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')';
@@ -229,7 +229,7 @@ foreach ($accounts as $key=>$type)
{
$result=$acc->load_board($user,$acc->id);
if ($result<0) {
setEventMessage($acc->error, 'errors');
setEventMessages($acc->error, $acc->errors, 'errors');
} else {
print $result->nbtodo;
if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')';

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
@@ -104,7 +104,7 @@ if ($user->rights->banque->modifier && $action == "update")
if ($ac->courant == 2 && $_POST['value'] != 'LIQ')
{
setEventMessage($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), 'errors');
setEventMessages($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), null, 'errors');
$error++;
}
@@ -146,7 +146,7 @@ if ($user->rights->banque->modifier && $action == "update")
$result = $db->query($sql);
if ($result)
{
setEventMessage($langs->trans("RecordSaved"));
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$db->commit();
}
else
@@ -184,7 +184,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action ==
$result = $db->query($sql);
if ($result)
{
setEventMessage($langs->trans("RecordSaved"));
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$db->commit();
}
else
@@ -205,7 +205,7 @@ $form = new Form($db);
llxHeader();
// On initialise la liste des categories
// The list of categories is initialized
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ";
$sql.= " ORDER BY label";
@@ -587,7 +587,7 @@ if ($result)
if ($user->rights->banque->consolidate)
{
print '<td colspan="3">';
print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"])?($_POST["reconciled"]?' checked':''):($objp->rappro?' checked':'')).'">';
print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"])?($_POST["reconciled"]?' checked="checked"':''):($objp->rappro?' checked="checked"':'')).'">';
print '</td>';
}
else

View File

@@ -71,7 +71,7 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
$result=$bankline->update_conciliation($user,$_POST["cat"]);
if ($result < 0)
{
setEventMessage($bankline->error, 'errors');
setEventMessages($bankline->error, $bankline->errors, 'errors');
$error++;
break;
}
@@ -83,7 +83,7 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
{
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorPleaseTypeBankTransactionReportName"), 'errors');
setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors');
}
if (! $error)
@@ -186,7 +186,7 @@ if ($resql)
print '<br>';
// Show last bank receipts
$nbmax=5;
$nbmax=15; // We accept to show last 15 receipts (so we can have more than one year)
$liste="";
$sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE fk_account=".$acct->id." AND num_releve IS NOT NULL";
@@ -226,7 +226,7 @@ if ($resql)
print '<input type="hidden" name="account" value="'.$acct->id.'">';
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):$last_releve).'" size="10">';
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
print '<br>';
if ($options)
{

View File

@@ -157,6 +157,7 @@ if (empty($num))
}
print '</div>';
print '<br><br>';
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$object->id, $sortfield, $sortorder,'',$numrows);
@@ -282,10 +283,15 @@ else
$found=true;
}
$mesprevnext ="<a href=\"releve.php?rel=prev&amp;num=$num&amp;ve=$ve&amp;account=$object->id\">".img_previous()."</a> &nbsp;";
$mesprevnext.= $langs->trans("AccountStatement")." $num";
$mesprevnext.=" &nbsp; <a href=\"releve.php?rel=next&amp;num=$num&amp;ve=$ve&amp;account=$object->id\">".img_next()."</a>";
print load_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$object->getNomUrl(0),$mesprevnext, 'title_bank.png');
$mesprevnext='';
$mesprevnext.='<div class="pagination"><ul>';
$mesprevnext.='<li class="pagination"><a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?rel=prev&amp;num='.$num.'&amp;ve='.$ve.'&amp;account='.$object->id.'"><</a></li>';
//$mesprevnext.=' &nbsp; ';
$mesprevnext.='<li class="pagination"><span class="inactive">'.$langs->trans("AccountStatement")." ".$num.'</span></li>';
//$mesprevnext.=' &nbsp; ';
$mesprevnext.='<li class="pagination"><a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?rel=next&amp;num='.$num.'&amp;ve='.$ve.'&amp;account='.$object->id.'">></a></li>';
$mesprevnext.='</ul></div>';
print load_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$object->getNomUrl(0, 'receipts'), $mesprevnext, 'title_bank.png');
print '<br>';
print "<form method=\"post\" action=\"releve.php\">";

View File

@@ -179,19 +179,23 @@ if ($resql)
print '<form method="post" action="search.php" name="search_form">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
$moreforfilter = '';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('StartDate') . ' ';
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
$moreforfilter .= ' - ';
$moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
$moreforfilter .= '</div>';
if ($moreforfilter) {
if ($moreforfilter)
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>'."\n";
}
print '<table class="liste">'."\n";
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DateOperationShort'),$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -309,7 +310,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print "</td>";
print "<td>".$ref."</td>";
print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; };
print '<td align="right">'.price($solde).'</td>';
print "</tr>";

View File

@@ -113,18 +113,18 @@ if ($action == 'add')
if (! $error)
{
$mesgs = $langs->trans("TransferFromToDone","<a href=\"account.php?account=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"account.php?account=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
setEventMessage($mesgs);
setEventMessages($mesgs, null, 'mesgs');
$db->commit();
}
else
{
setEventMessage($accountfrom->error.' '.$accountto->error, 'errors');
setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors');
$db->rollback();
}
}
else
{
setEventMessage($langs->trans("ErrorFromToAccountsMustDiffers"), 'errors');
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
}
}
}
@@ -132,7 +132,7 @@ if ($action == 'add')
/*
* Affichage
* View
*/
llxHeader();

View File

@@ -85,87 +85,6 @@ if (GETPOST("mode") != 'sconly')
print "<br>";
}
// Payment Salary
if ($conf->salaries->enabled)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
$sal = new PaymentSalary($db);
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
$sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
$sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')";
}
if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
print "<td>".$obj->label."</td>\n";
print '<td align="right">'.($obj->salary?price($obj->salary):'')."</td>";
// Ref payment
$sal_static->id=$obj->rowid;
$sal_static->ref=$obj->rowid;
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
print '<td align="right">'."</td>";
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">'.price($total)."</td>";
print "</tr>";
print "</table>";
$db->free($result);
print "<br>";
}
else
{
dol_print_error($db);
}
}
}
if ($conf->tax->enabled)
{
@@ -356,7 +275,8 @@ if ($conf->tax->enabled)
}
}
}
//localtax
// Localtax
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
$j=1;
@@ -460,6 +380,91 @@ while($j<$numlt)
}
// Payment Salary
if ($conf->salaries->enabled)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
$sal = new PaymentSalary($db);
print '<br>';
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
$sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
$sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')";
}
if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
print "<td>".$obj->label."</td>\n";
print '<td align="right">'.($obj->salary?price($obj->salary):'')."</td>";
// Ref payment
$sal_static->id=$obj->rowid;
$sal_static->ref=$obj->rowid;
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
print '<td align="right">'."</td>";
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">'.price($total)."</td>";
print "</tr>";
print "</table>";
$db->free($result);
print "<br>";
}
else
{
dol_print_error($db);
}
}
}
llxFooter();
$db->close();

View File

@@ -71,7 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -89,7 +89,7 @@ else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@@ -104,7 +104,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -150,7 +150,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action='create';
}
}
@@ -190,7 +190,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
@@ -411,8 +411,8 @@ else if ($id)
}
else
{
/*
* Confirmation de la suppression du deplacement
/*
* Confirm delete trip
*/
if ($action == 'delete')
{

View File

@@ -1401,12 +1401,12 @@ if (empty($reshook))
// Margin
$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we muste keep this value
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
// Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc);
$info_bits = 0;
if ($tva_npr)
$info_bits |= 0x01;
@@ -1843,6 +1843,8 @@ if ($action == 'create')
$res = $soc->fetch($socid);
// Load objectsrc
$remise_absolue = 0;
if (! empty($origin) && ! empty($originid))
{
// Parse element/subelement (ex: project_task)
@@ -1854,6 +1856,20 @@ if ($action == 'create')
if ($element == 'project') {
$projectid = $originid;
if (!$cond_reglement_id) {
$cond_reglement_id = $soc->cond_reglement_id;
}
if (!$mode_reglement_id) {
$mode_reglement_id = $soc->mode_reglement_id;
}
if (!$remise_percent) {
$remise_percent = $soc->remise_percent;
}
if (!$dateinvoice) {
// Do not set 0 here (0 for a date is 1970)
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice);
}
} else {
// For compatibility
if ($element == 'order' || $element == 'commande') {
@@ -1898,7 +1914,6 @@ if ($action == 'create')
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
}
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : ''; // Dot not set 0 here (0 for a date is 1970)
}
else
{
@@ -1909,6 +1924,7 @@ if ($action == 'create')
$remise_absolue = 0;
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
}
$absolute_discount = $soc->getAvailableDiscounts();
if (! empty($conf->use_javascript_ajax))
@@ -1959,7 +1975,20 @@ if ($action == 'create')
else
{
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
// Option to reload page to retrieve customer informations. Note, this clear other input
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid;
});
});
</script>';
}
print '</td>';
}
print '</tr>' . "\n";
@@ -3839,6 +3868,15 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='inv'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id);
}
$formmail->withfrom = 1;
$liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) {

View File

@@ -63,6 +63,7 @@ class Facture extends CommonInvoice
var $author;
var $fk_user_author;
var $fk_user_valid;
var $date; // Date invoice
var $date_creation; // Creation date
var $date_validation; // Validation date
var $datem;
@@ -897,7 +898,7 @@ class Facture extends CommonInvoice
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
@@ -2044,8 +2045,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity
* @param double $txtva Force vat rate, -1 for auto
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service
@@ -2140,6 +2141,7 @@ class Facture extends CommonInvoice
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, $situation_percent);
@@ -2298,7 +2300,8 @@ class Facture extends CommonInvoice
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, $situation_percent);
$total_ht = $tabprice[0];
@@ -3632,23 +3635,27 @@ class Facture extends CommonInvoice
/**
* Checks if the invoice is the last in its cycle
*
* @return int 0 or 1 if OK, -1 if error
* @return bool Last of the cycle status
*
*/
function is_last_in_cycle()
{
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
$last = $res['max(situation_counter)'];
return ($last == $this->situation_counter);
if (!empty($this->situation_cycle_ref)) {
// No point in testing anything if we're not inside a cycle
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
$last = $res['max(situation_counter)'];
return ($last == $this->situation_counter);
} else {
$this->error = $this->db->lasterror();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
return false;
}
} else {
$this->error = $this->db->lasterror();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
$this->db->rollback();
return -1;
return true;
}
}

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ $object = new Facture($db);
/*
* Ajout d'un nouveau contact
* Add a new contact
*/
if ($action == 'addcontact' && $user->rights->facture->creer)
@@ -71,16 +71,16 @@ if ($action == 'addcontact' && $user->rights->facture->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
// Bascule du statut d'un contact
// Toggle the status of a contact
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
@@ -93,7 +93,7 @@ else if ($action == 'swapstatut' && $user->rights->facture->creer)
}
}
// Efface un contact
// Deletes a contact
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
@@ -124,7 +124,7 @@ $userstatic=new User($db);
/* *************************************************************************** */
/* */
/* Mode vue et edition */
/* View and edit mode */
/* */
/* *************************************************************************** */
@@ -139,7 +139,7 @@ if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill');
/*
* Facture synthese pour rappel
* Summary invoice for reminder
*/
print '<table class="border" width="100%">';

View File

@@ -70,7 +70,7 @@ if ($action == 'add')
{
if (! GETPOST('titre'))
{
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), 'errors');
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), null, 'errors');
$action = "create";
$error++;
}
@@ -88,13 +88,13 @@ if ($action == 'add')
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action = "create";
}
}
}
// Suppression
// Delete
if ($action == 'delete' && $user->rights->facture->supprimer)
{
$object->fetch($id);

View File

@@ -318,7 +318,7 @@ if ($resql)
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
if ($conf->categorie->enabled && $user->rights->produit->lire)
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';

View File

@@ -107,14 +107,14 @@ if ($action == 'presend' && GETPOST('sendmail'))
if (!isset($user->email))
{
$error++;
setEventMessage("NoSenderEmailDefined");
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
}
$countToSend = count($_POST['toSend']);
if (empty($countToSend))
{
$error++;
setEventMessage("InvoiceNotChecked","warnings");
setEventMessages($langs->trans("InvoiceNotChecked"), null, 'warnings');
}
if (! $error)
@@ -260,11 +260,11 @@ if ($action == 'presend' && GETPOST('sendmail'))
if ($nbsent)
{
$action=''; // Do not show form post if there was at least one successfull sent
setEventMessage($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent"));
setEventMessages($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent"), null, 'mesgs');
}
else
{
setEventMessage($langs->trans("NoRemindSent"), 'warnings'); // May be object has no generated PDF file
setEventMessages($langs->trans("NoRemindSent"), null, 'warnings'); // May be object has no generated PDF file
}
}
}
@@ -349,16 +349,16 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
@chmod($file, octdec($conf->global->MAIN_UMASK));
$langs->load("exports");
setEventMessage($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')));
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
}
else
{
setEventMessage($langs->trans('NoPDFAvailableForChecked'),'errors');
setEventMessages($langs->trans('NoPDFAvailableForChecked'), null, 'errors');
}
}
else
{
setEventMessage($langs->trans('InvoiceNotChecked'), 'warnings');
setEventMessages($langs->trans('InvoiceNotChecked'), null, 'warnings');
}
}
@@ -371,8 +371,8 @@ if ($action == 'remove_file')
$upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action='';
}
@@ -574,6 +574,15 @@ if ($resql)
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='inv'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id);
}
$formmail->withfrom=1;
$liste=array();
$formmail->withto=$langs->trans("AllRecipientSelectedForRemind");

View File

@@ -75,12 +75,12 @@ if ($action == "new")
{
$db->commit();
setEventMessage($langs->trans("RecordSaved"));
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessage($object->error, $object->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
$action='';

View File

@@ -580,7 +580,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<td align="center">'.$langs->trans("DateDue").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>';
print '<td>&nbsp;</td>';
print '<td align="center" width="16">&nbsp;</td>';
print '</tr>';
if ($num)
{

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -104,7 +105,7 @@ if ($_GET["action"] == 'delete')
if ($result > 0)
{
$db->commit();
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php');
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt);
exit;
}
else

View File

@@ -415,7 +415,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>';
$datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'') : $datepayment);
$form->select_date($datepayment,'','','',0,"add_paiement",1,1);
$form->select_date($datepayment,'','','',0,"add_paiement",1,1,0,0,'','',$facture->date);
print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>';

View File

@@ -3,8 +3,8 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -66,7 +66,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
@@ -86,7 +86,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
@@ -124,7 +124,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
@@ -135,11 +135,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
}
else
{
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
}
}
@@ -150,11 +150,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye);
if ($res === 0)
{
setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
}
else
{
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
}
}

View File

@@ -79,12 +79,12 @@ if ($action == 'setdate' && $user->rights->banque->cheque)
$result=$object->set_date($user,$date);
if ($result < 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -98,12 +98,12 @@ if ($action == 'setrefext' && $user->rights->banque->cheque)
$result=$object->setValueFrom('ref_ext', $ref_ext);
if ($result < 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -117,12 +117,12 @@ if ($action == 'setref' && $user->rights->banque->cheque)
$result=$object->set_number($user,$number);
if ($result < 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -154,12 +154,12 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessage($langs->trans("ErrorSelectAtLeastOne"));
setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs');
$action='new';
}
}
@@ -175,7 +175,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -190,7 +190,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c
}
else
{
setEventMessage($paiement->error, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
}
}
@@ -217,7 +217,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -230,7 +230,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban
$paiement_id = $object->rejectCheck($rejected_check, $reject_date);
if ($paiement_id > 0)
{
setEventMessage($langs->trans("CheckRejectedAndInvoicesReopened"));
setEventMessages($langs->trans("CheckRejectedAndInvoicesReopened"), null, 'mesgs');
//header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id);
//exit;
$action='';
@@ -282,8 +282,8 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque)
$file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
}
}

View File

@@ -549,7 +549,7 @@ class Tva extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called paiementtva
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called 'payment_vat'
// Call trigger
//XXX: Should be done just befor commit no ?

View File

@@ -122,6 +122,34 @@ $fieldstosearchall = array(
's.nom'=>"ThirdParty",
);
// Definition of fields for list
$arrayfields=array(
'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'p.firstname'=>array('label'=>$langs->trans("Firsname"), 'checked'=>1),
'p.poste'=>array('label'=>$langs->trans("Post"), 'checked'=>1),
'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
'p.phone'=>array('label'=>$langs->trans("PhonePro"), 'checked'=>1),
'p.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0),
'p.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>1),
'p.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>1),
'p.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
'p.skype'=>array('label'=>$langs->trans("Skype"), 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
'p.thirdparty'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
'p.priv'=>array('label'=>$langs->trans("ContactVisibility"), 'checked'=>1, 'position'=>200),
'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'p.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
/*
* Actions
@@ -386,35 +414,10 @@ if ($result)
print '</div>';
}
$arrayfields=array(
'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'p.firstname'=>array('label'=>$langs->trans("Firsname"), 'checked'=>1),
'p.poste'=>array('label'=>$langs->trans("Post"), 'checked'=>1),
'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
'p.phone'=>array('label'=>$langs->trans("PhonePro"), 'checked'=>1),
'p.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0),
'p.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>1),
'p.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>1),
'p.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
'p.skype'=>array('label'=>$langs->trans("Skype"), 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
'p.thirdparty'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
'p.priv'=>array('label'=>$langs->trans("ContactVisibility"), 'checked'=>1, 'position'=>200),
'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'p.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
// Ligne des titres
print '<tr class="liste_titre">';

View File

@@ -1260,7 +1260,8 @@ class Contrat extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@@ -1441,7 +1442,8 @@ class Contrat extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

View File

@@ -221,11 +221,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
$trackid = GETPOST('trackid','aZ');
$trackid = GETPOST('trackid','aZ09');
if($conf->dolimail->enabled)
// Feature to push mail sent into Sent folder
if (! empty($conf->dolimail->enabled))
{
$mailfromid = explode ("#", $_POST['frommail'],3);
$mailfromid = explode("#", $_POST['frommail'],3); // $_POST['frommail'] = 'aaa#Sent# <aaa@aaa.com>' // TODO Use a better way to define Sent dir.
if (count($mailfromid)==0) $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
else
{
@@ -243,7 +244,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
{
$folder=str_replace($ref, '', $mailboxconfig->folder_cache_key);
if (!$folder) $folder = "Sent";
if (!$folder) $folder = "Sent"; // Default Sent folder
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
if (FALSE === $mailboxconfig->mbox)
@@ -276,17 +277,16 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
if ($result)
{
$error=0;
if($conf->dolimail->enabled)
if (! empty($conf->dolimail->enabled))
{
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0);
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
if ($mid)
{
// set imap flag answered if it is a answered mail
// set imap flag answered if it is an answered mail
$dolimail=new DoliMail($db);
$dolimail->id = $mid;
$res=$dolimail->set_prop($user, 'answered',1);
}
}
if ($imap==1)
{
// write mail to IMAP Server

View File

@@ -50,7 +50,7 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname))
$return=array();
if (empty($showempty)) $showempty=0;
$return['value'] = $form->selectcontacts($id,'','contactid',$showempty,'','',0,'',true);
$return['value'] = $form->selectcontacts($id,'',$htmlname,$showempty,'','',0,'',true);
$return['num'] = $form->num;
$return['error'] = $form->error;

View File

@@ -94,9 +94,9 @@ if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM
{
$arrayresult['searchintosupplierorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
}
if (! empty($conf->askpricesupplier->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->askpricesupplier->lire)
if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
{
$arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/askpricesupplier/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)

View File

@@ -96,12 +96,20 @@ class box_factures_fourn_imp extends ModeleBoxes
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->date_echeance = $datelimite;
$facturestatic->statut = $objp->fk_statut;
$thirdpartytmp->id = $objp->socid;
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->code_client = $objp->code_client;
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->fournisseur = 1;
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
$thirdpartytmp->logo = $objp->logo;
$facturestatic->date_echeance = $datelimite;
$facturestatic->statut = $objp->fk_statut;
$late='';
if ($facturestatic->hasDelay()) {
@@ -118,10 +126,9 @@ class box_factures_fourn_imp extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid),
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
'asisi' => 1
);
$this->info_box_contents[$line][] = array(

View File

@@ -708,8 +708,10 @@ class CMailFile
$trackid = $this->trackid;
if ($trackid)
{
$out.= 'Message-ID: <' . time() . '.phpmail-'.$trackid.'@' . $host . ">" . $this->eol2;
$out.= 'references: <' . time() . '.phpmail-'.$trackid.'@' . $host . ">" . $this->eol2;
// References is kept in response and Message-ID is returned into In-Reply-To:
$out.= 'Message-ID: <' . time() . '.phpmail-dolibarr-'.$trackid.'@' . $host . ">" . $this->eol2; // Uppercase seems replaced by phpmail
$out.= 'References: <' . time() . '.phpmail-dolibarr-'.$trackid.'@' . $host . ">" . $this->eol2;
$out.= 'X-Dolibarr-TRACKID: '.$trackid. $this->eol2;
}
else
{

View File

@@ -2183,7 +2183,7 @@ abstract class CommonObject
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
if ($this->element == 'propal') $fieldttc='total';
if ($this->element == 'expensereport') $fieldtva='total_tva';
if ($this->element == 'askpricesupplier') $fieldttc='total';
if ($this->element == 'supplier_proposal') $fieldttc='total';
if (empty($nodatabaseupdate))
{
@@ -2394,8 +2394,8 @@ abstract class CommonObject
else if ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
else if ($objecttype == 'askpricesupplier') {
$classpath = 'comm/askpricesupplier/class';
else if ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
else if ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
@@ -2866,6 +2866,7 @@ abstract class CommonObject
}
else
{
$this->errors[] = $this->db->lasterror();
return false;
}
}
@@ -2903,6 +2904,7 @@ abstract class CommonObject
}
else
{
$this->errors[] = $this->db->lasterror();
return -1;
}
}
@@ -3044,9 +3046,9 @@ abstract class CommonObject
// Description
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
if ($this->element == 'askpricesupplier')
if ($this->element == 'supplier_proposal')
{
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("AskPriceSupplierRefFourn").'</span></td>';
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("SupplierProposalRefFourn").'</span></td>';
}
// VAT

View File

@@ -193,6 +193,7 @@ class Conf
{
$modulename=strtolower($reg[1]);
if ($modulename == 'propale') $modulename='propal';
if ($modulename == 'supplierproposal') $modulename='supplier_proposal';
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=new stdClass();
$this->$modulename->enabled=true;
$this->modules[]=$modulename; // Add this module in list of enabled modules
@@ -418,7 +419,8 @@ class Conf
// conf->mailing->email_from = email pour envoi par Dolibarr des mailings
$this->mailing->email_from=$this->email_from;
if (! empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from=$this->global->MAILING_EMAIL_FROM;
if (! isset($conf->global->MAIN_EMAIL_ADD_TRACK_ID)) $conf->global->MAIN_EMAIL_ADD_TRACK_ID=1;
// Format for date (used by default when not found or not searched in lang)
$this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
$this->format_date_short_java="dd/MM/yyyy"; // Format of day with Java tags
@@ -450,10 +452,10 @@ class Conf
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
// Define list of limited modules
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,askpricesupplier,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,supplier_proposal,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
// Enable select2
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT)) $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT == '1') $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';
// Timeouts
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;

View File

@@ -258,7 +258,7 @@ class ExtraFields
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
{
if(is_array($param) and count($param) > 0)
if(is_array($param) && count($param) > 0)
{
$params = $this->db->escape(serialize($param));
}

View File

@@ -76,7 +76,7 @@ class Form
* @param string $htmlname Name of select field ('edit' prefix will be added)
* @param string $preselected Name of Value to show/edit (not used in this function)
* @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter
* @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
* @param string $moreparam More param to add on a href URL
* @return string HTML edit field
@@ -104,11 +104,11 @@ class Form
}
else
{
$ret.='<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
$ret.=$langs->trans($text);
$ret.='</td>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</td>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&amp;id='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
$ret.='</tr></table>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</tr></table>';
}
return $ret;
@@ -3857,12 +3857,12 @@ class Form
dol_syslog(__METHOD__, LOG_DEBUG);
$sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql = "SELECT DISTINCT t.code, t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active > 0";
$sql.= " AND c.code IN (".$country_code.")";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$sql.= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
$resql=$this->db->query($sql);
if ($resql)
@@ -3873,8 +3873,9 @@ class Form
for ($i = 0; $i < $num; $i++)
{
$obj = $this->db->fetch_object($resql);
$this->cache_vatrates[$i]['code'] = $obj->code;
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%';
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
}
@@ -3897,7 +3898,7 @@ class Form
* Output an HTML select vat rate.
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
*
* @param string $htmlname Name of html select field
* @param string $htmlname Name of HTML select field
* @param float $selectedrate Force preselected vat rate. Use '' for no forcing.
* @param Societe $societe_vendeuse Thirdparty seller
* @param Societe $societe_acheteuse Thirdparty buyer
@@ -3910,10 +3911,11 @@ class Form
* Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.
* Sinon la TVA proposee par defaut=0. Fin de regle.
* @param bool $options_only Return options only (for ajax treatment)
* @param bool $options_only Return HTML options lines only (for ajax treatment)
* @param int $addcode Add code into key in select list
* @return string
*/
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false)
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $addcode=0)
{
global $langs,$conf,$mysoc;
@@ -4016,13 +4018,16 @@ class Form
$return.= '<option value="'.$rate['txtva'];
$return.= $rate['nprtva'] ? '*': '';
if ($addcode && $rate['code']) $return.=' ('.$rate['code'].')';
$return.= '"';
if ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr)
{
$return.= ' selected';
}
$return.= '>'.vatrate($rate['libtva']);
//$return.=($rate['code']?' '.$rate['code']:'');
$return.= $rate['nprtva'] ? ' *': '';
$return.= '</option>';
}
@@ -4057,10 +4062,11 @@ class Form
* @param int $disabled Disable input fields
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field.
* @param datetime $adddateof Add a link "Date of invoice" using the following date.
* @return mixed Nothing or string if nooutput is 1
* @see form_date
*/
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='')
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
{
global $conf,$langs;
@@ -4318,6 +4324,13 @@ class Form
}
}
// Add a "Plus one hour" link
if ($conf->use_javascript_ajax && $adddateof)
{
$tmparray=dol_getdate($adddateof);
$retstring.=' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof,'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$langs->trans("DateInvoice").'</a>';
}
if (! empty($nooutput)) return $retstring;
print $retstring;
@@ -4513,22 +4526,26 @@ class Form
* @param string $morecss Add more class to css styles
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
* @param string $placeholder String to use as placeholder
* @return string HTML select string.
* @param string $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
* @return string HTML select string
*/
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='')
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
{
global $langs;
global $delayedhtmlcontent;
$out = '';
$tmpplugin='select2';
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
$out='<input type="text" class="'.$htmlname.($morecss?' '.$morecss:'').'" '.($moreparam?$moreparam.' ':'').'name="'.$htmlname.'">';
// TODO Use an internal dolibarr component instead of select2
$outdelayed='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
<script type="text/javascript">
$(document).ready(function () {
'.($callurlonselect ? 'var saveRemoteData = [];':'').'
'.($callurlonselect ? 'var saveRemoteData = [];':'').'
$(".'.$htmlname.'").select2({
$(".'.$htmlname.'").select2({
ajax: {
dir: "ltr",
url: "'.$url.'",
@@ -4584,12 +4601,17 @@ class Form
});
});' : '' ) . '
});
</script>';
});
</script>';
$out.='<input type="text" class="'.$htmlname.($morecss?' '.$morecss:'').'" '.($moreparam?$moreparam.' ':'').'name="'.$htmlname.'">';
if ($acceptdelayedhtml)
{
$delayedhtmlcontent.=$outdelayed;
}
else
{
$out.=$outdelayed;
}
return $out;
}
@@ -4670,7 +4692,7 @@ class Form
foreach ($array as $key => $value)
{
$out.= '<option value="'.$key.'"';
if (is_array($selected) && ! empty($selected) && in_array($key, $selected))
if (is_array($selected) && ! empty($selected) && in_array($key, $selected) && !empty($key))
{
$out.= ' selected';
}
@@ -4811,7 +4833,7 @@ class Form
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
foreach($ways as $way)
{
$toprint[] = '<li class="select2-search-choice-dolibarr"'.($c->color?' style="background: #'.$c->color.'"':'').'>'.img_object('','category').' '.$way.'</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':'').'>'.img_object('','category').' '.$way.'</li>';
}
}
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
@@ -4873,9 +4895,9 @@ class Form
$tplpath = 'comm/'.$element;
if (empty($conf->propal->enabled)) continue; // Do not show if module disabled
}
else if ($objecttype == 'askpricesupplier') {
else if ($objecttype == 'supplier_proposal') {
$tplpath = 'comm/'.$element;
if (empty($conf->askpricesupplier->enabled)) continue; // Do not show if module disabled
if (empty($conf->supplier_proposal->enabled)) continue; // Do not show if module disabled
}
else if ($objecttype == 'shipping' || $objecttype == 'shipment') {
$tplpath = 'expedition';

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