diff --git a/.travis.yml b/.travis.yml index 54d937625ba92..5d613e1dfca06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,8 +131,9 @@ script: # - cat upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log - php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log + - cat upgrade380390.log - php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log -# - cat upgrade370380-2.log +# - cat upgrade380390-2.log - cd ../.. - date - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php diff --git a/.tx/config b/.tx/config index 06607e62894b2..78632136fb14b 100644 --- a/.tx/config +++ b/.tx/config @@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.hrm] +file_filter = htdocs/langs//hrm.lang +source_file = htdocs/langs/en_US/hrm.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.incoterm] file_filter = htdocs/langs//incoterm.lang source_file = htdocs/langs/en_US/incoterm.lang diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a603fd242ccfd..304924fe15031 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,15 +4,14 @@ How to contribute to Dolibarr Bug reports and feature requests -------------------------------- -*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum). +*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum). -**NEW** - -Issues are now managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues). +Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues). 1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem. 2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request. -3. Report with as much detail as possible ([Use screenshots or even screencasts whenever possible](https://help.github.com/articles/issue-attachments)). +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). @@ -41,9 +40,45 @@ Choose your base branch accordingly. ### General rules Please don't edit the ChangeLog file. A project manager will update it from your commit messages. -### Commits +### Commits Use clear commit messages with the following structure: +``` +[KEYWORD] [ISSUENUM] DESC + +LONGDESC +``` + +#### Keyword +In uppercase to appear in ChangeLog when generated. + +The keyword can be ommitted if your commit does not fit in any of the following categories: +- Fix: for a bug fix +- Close: for closing a referenced feature request +- New: for an unreferenced new feature (Opening a feature request and using close is prefered) + +#### Issuenum +If your commit fixes a referenced bug or feature request. + +In the form of a # followed by the GitHub issue number. + +#### Desc +A short description of the commit content. + +This should ideally be less than 50 characters. + +#### LongDesc +A long description of the commit content. + +You can really go to town here and explain in depth what you've been doing. + +Feel free to express technical details, use cases or anything relevant to the current commit. + +This section can span multiple lines. + +Try to keep lines under 72 characters. + +#### Samples
 FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. In upper case to appear into ChangeLog)
 or
@@ -57,8 +92,10 @@ Long description (Can span accross multiple lines).
 
### Pull Requests -When submitting a pull request, use same rule than Commits. With upper case keyword to appear into ChangeLog. +When submitting a pull request, use same rule as [Commits](#commits) for the message. +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. ### Resources [Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation) @@ -67,18 +104,18 @@ Translations ------------ The source language (en_US) is maintained in the repository. See the [Code](#code) section above. -All other translations are managed online at [Transifex](https://www.transifex.com/projects/p/dolibarr). +All other translations are managed online at [Transifex](https://www.transifex.com/dolibarr-association/dolibarr/). Join an existing translation team or create your own and translate into the interface. Your translations will be available in the next major release. ### Resources -[Translator documentation](http://wiki.dolibarr.org/index.php/Developer_documentation) +[Translator documentation](http://wiki.dolibarr.org/index.php/Translator_documentation) Documentation ------------- The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php). -*You need to create an account before being able to edit.* +*Note*: to help prevent spam, you need to create an account before being able to edit. diff --git a/ChangeLog b/ChangeLog index 0b6a4a5b87133..4cf2322adbb0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40. +WARNING: + +Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40. Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost. You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration. Upgrading to any other version or any other database system is abolutely required BEFORE trying @@ -11,9 +13,89 @@ make a Dolibarr upgrade. ***** ChangeLog for 3.9 compared to 3.8.* ***** -WARNING: Following changes may create regression for some external modules, but were necessary to make +WARNING: + +Following changes may create regression for some external modules, but were necessary to make Dolibarr better: -- Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use MAIN_OVERWRITE_TRANS_xx_YY instead. +- Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use table llx_overwrite_trans instead. +- Trigger LINECONTRACT_INSERT has been renamed into LINECONTRACT_CREATE to match common denomination. +- A lot hooks used into PDF generation were not correctly implemented. We had to fix this. The result si that +the following hook were set as hook of type "replace". This means if your module implement such hooks, it must +return 0 to execute standard code or 1 to replace standard code (value to output should be set into resPrints instead). +This is list of hooks modified: +'pdf_getlinenum', 'pdf_getlineref', 'pdf_getlineref_supplier', 'pdf_getlinevatrate', 'pdf_getlineupexcltax', +'pdf_getlineupwithtax', 'pdf_getlineqty', 'pdf_getlineqty_asked', 'pdf_getlineqty_shipped', 'pdf_getlineqty_keeptoship', +'pdf_getlineunit', 'pdf_getlineremisepercent', 'pdf_getlineprogress', 'pdf_getlinetotalexcltax', 'pdf_getlinetotalwithtax' + + + +***** ChangeLog for 3.8.1 compared to 3.8.0 ***** +FIX: #3521 postgresql migration error +FIX: #3524 +FIX: #3529 +FIX: #3530 +FIX: #3533 +FIX: #3533 Load categories language +FIX: #3534 +FIX: #3572 Impossible to attach project in order +FIX: #3599 Not saving legal form +FIX: #3606 +FIX: #3607 Better categories setting and unsetting +FIX: #3628 +FIX: #3630 - Wrong balance report when module salaries and donation disabled +FIX: Add a test to save life when ref of object (invoice ref, order ref, ...) was empty. The was no way to go back to a clean situation, even after vaidating again the object. +FIX: Admin fiche inter page do not take good action +FIX: Always use type send in parameters in showCategories method +FIX: avoid SQL error in getValueFrom common object when all params are not send +FIX: avoid SQL error when no sortfield send to method +FIX: bad link into project box +FIX: Bad title line in project view when using jmobile +FIX: Bad translation key for project "Overview" +FIX: Can create Proposal on close thridparty #3526 +FIX: Can't change state on a contact +FIX: Can't change the admin with default setup +FIX: Can't delete thirdparty if there is some discounts +FIX: Can't reopen a canceled invoice. +FIX: Creation of tables or keys must not be done with a random order. +FIX: debian install when module mysqli is not installed. +FIX: Description of tags was mandatory in edit mode but not in create mode. Should not be mandatory. +FIX: display error on extrafields on ficheinter +FIX: Email selector contact must not include inactive contact +FIX: error in SQL due to a previous fix +FIX: Error retrieving customer prices +FIX: Event from ical stream should not be movable into calendar view +FIX: facturestat bad sql when customer view is limited +FIX: Filter on status of thirdparty list and bad encoding of url +FIX: icon into export profile may be not correctly output +FIX: Init into bad var +FIX: Link of project must be cickable if user has permission to read all projects FIX: Missing information into the alt of project picto +FIX: List of project for user that are restrited as sale repreentative to some thirdparties. +FIX: Mass Mailing activity don't display all status +FIX: Missing contracts into list in page of Refering objects of a thirdparty. +FIX: Missing menu entry for list of thirdparties when using auguria menu manager +FIX: Missing validate button if permission are not valid. +FIX: New adherent from, always redirect on entity +FIX: not closing CSS. +FIX: not responsive part for project page +FIX: Only are showing one object linked +FIX: order ref must not be translated +FIX: Payment form for paypal and paybox was not centered. +FIX: Pb into pagination scroll widget FIX: Style of previous-next card when using dolidroid +FIX: Regression on bad use of fk_account showing the bad bank account on PDF. +FIX: Removed warnings +FIX: remove twice same test +FIX: select of project using ajax autocomplete option +FIX: sortder field was missing so manually added values were moved to begin. +FIX: Syntax error in Debian Apache configuration +FIX: The admin flag is mising. +FIX: The filter on thirdparty prices should be visible if there is at least one thirdparty price. +FIX: Thirdparty is missing on card +FIX: update2.php test res befre assign it +FIX: When delete actioncomm also delete actioncomm_resources +FIX: when editing time spent, date of line suggested was a rubbish value +FIX: When filter with empty status, by default get canceled status (-1) +FIX: When update a member login for a member linked to a user, the login of user was not sync (not updated). +FIX: Wizard for restore does not show import command ***** ChangeLog for 3.8 compared to 3.7.* ***** @@ -278,9 +360,11 @@ FIX send mail, copy sendto don't read the list of contact FIX Properly escape untrusted data to prevent HTML injection. FIX send mail, copy sendto don't read the list of contact -Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose -your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to -restore old path. +WARNING: + +Path to save photos of products was moved to match path of other attached files. If you had loose your photo +on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to 1 (home - setup - other) +to restore old path and get back working links without having to resubmit images. WARNING: @@ -453,11 +537,14 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection" Upgrading to any other version or database system is abolutely required BEFORE trying to make a Dolibarr upgrade. -WARNING: Following changes may create regression for some external modules, but was necessary to make +WARNING: + +Following changes may create regression for some external modules, but was necessary to make Dolibarr better: - Path to save photos of products was moved to match path of other attached files. If you had loose your photo - on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to restore old path. + on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to 1 (home - setup - other) + to restore old path and get back working links without having to resubmit images. - If you can't see trips and expenses records, check that you have the new permission "read all trips and expenses". - Deprecated module "oscommerce" were removed. @@ -472,6 +559,12 @@ 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 + +***** ChangeLog for 3.6.4 compared to 3.6.3 ***** +- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask ***** ChangeLog for 3.6.3 compared to 3.6.2 ***** - Fix: ref_ext was not saved when recording a customer order from web service diff --git a/README-FR.md b/README-FR.md index 3f1819f63701f..53ae1be8e8d21 100644 --- a/README-FR.md +++ b/README-FR.md @@ -77,50 +77,56 @@ Voir fichier ChangeLog. ## CE QUE DOLIBARR PEUT FAIRE -Modules principaux: +### Modules principaux (tous optionnels): + - Annuaires des prospects et/ou client et/ou fournisseurs - Gestion de catalogue de produits et services -- Gestion de stock +- Gestion des devis, propositions commerciales +- Gestion des commandes +- Gestion des factures clients/fournisseurs et paiements +- Gestion des virements bancaires SEPA - Gestion des comptes bancaires - Agenda partagé -- Gestion des commandes -- Gestion des devis, propositions commerciales -- Gestion des factures clients et fournisseurs +- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...) - Gestion de contrats de services -- Gestion des paiements -- Gestion des virements bancaires +- Gestion de stock - Gestion des expéditions - GED (Gestion Electronique de Documents) - EMailings de masse - Réalisation de sondages - Point de vente/Caisse enregistreuse +- … + +### Autres modules: -Autres modules: - Gestion de marque-pages - Gestion des promesses de dons - Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM) - Rapports - Imports/Exports des données - Connectivité LDAP -- Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) - De nombreuses autres fonctionnalités issues de modules officiels ou non (AWStats, Bittorrent, Gravatar, Google, Webcalendar...) +- … + +### Divers: -Divers: - Application multi-utilisateurs avec différents niveaux de permissions par module. +- Peux être multi-société par ajout du module externe multi-société. +- Peux-être multi-devise par ajout du module externe multi-devise. - Plusieurs gestionnaires de menus (possibilité de différencier les menus pour les utilisateurs internes ou externes comme les clients ou fournisseurs). - Application simple à utiliser. - Plusieurs thèmes visuels. - Code simple et facilement personnalisable. - Requiert PHP et Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis). - Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP ou Postgresql. +- Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) ## CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE) Voici un liste de fonctionnalites pas encore gérées par Dolibarr: -- Pas de compta analytique double-partie (uniquement gestion de trésorerie). +- Pas encore de compta analytique double-partie (uniquement gestion de trésorerie). - Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise). -- Dolibarr ne gère en standard qu'une société/institution/association mère (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. - Dolibarr ne contient pas de module de Gestion de la paie. - Les tâches du module de gestion de projets n'ont pas de dépendance entre elle. - Dolibarr ne contient pas de Webmail. diff --git a/README.md b/README.md index 8359b66cbd99c..576e3153ef99e 100644 --- a/README.md +++ b/README.md @@ -69,39 +69,22 @@ See the [ChangeLog](ChangeLog) file. ## FEATURES -### General features -- Users and groups with finely grained rights -- Localization in most major languages -- Very user friendly and easy to use -- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite)) -- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. -- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture) -- Support for country specific features: - - Spanish Tax RE and ISPF - - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) - - Canadian double taxes (federal/province) and other countries using cumulative VAT - - Tunisian tax stamp - - Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) -- ... - -### Main modules +### Main modules (all optional) - Customers, Prospects and/or Suppliers directory - Products and/or Services catalog -- Bank accounts management -- Customer and Supplier Orders management - Commercial proposals management -- Contracts management -- Invoices management +- Customer and Supplier Orders management +- Invoices and payment management +- Standing orders management (European SEPA) +- Bank accounts management +- Shared calendar +- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...) - Projects management -- Events management -- Payments management -- Standing orders management +- Contracts management - Stock management - Shipping management - Interventions management -- PDF or ODT generation for invoice, proposals, orders... - Agenda with ical and vcal export for third party tools integration - Electronic Document Management (EDM) - Foundations members management @@ -127,6 +110,25 @@ See the [ChangeLog](ChangeLog) file. - Payment platforms integration (PayBox, PayPal) - … +### Other general features +- Multi-Users and groups with finely grained rights +- Localization in most major languages +- Can manage several companies by adding external module multi-company. +- Can manage several currencies by adding external module multi-currency. +- Very user friendly and easy to use +- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) +- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite)) +- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. +- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture) +- Support for country specific features: + - Spanish Tax RE and ISPF + - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) + - Canadian double taxes (federal/province) and other countries using cumulative VAT + - Tunisian tax stamp + - Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) +- PDF or ODT generation for invoice, proposals, orders... +- … + ### Extending Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](http://www.dolistore.com). @@ -135,10 +137,7 @@ Dolibarr can be extended with a lot of other external modules from third party d These are features that Dolibarr does **not** yet fully support: -- Double-entry bookkeeping (only bank and treasury management) -- Multiple currencies -- Multiple companies - If you want to manage several companies or foundations, you must install the software several times (on same server or not) or use the MultiCompany addon module that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas) +- Double-entry bookkeeping yet (only bank and treasury management) - Tasks dependencies in projects - Payroll module - Webmail diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 813db9bb4b8ca..953e207d28dc3 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,7 +8,9 @@ This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. - Check all files are commited. -- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base 3.7.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" +- 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" - Update version number with x.y.z-w in htdocs/filefunc.inc.php - Commit all changes. @@ -28,7 +30,9 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base 3.7.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" +- 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" - Update version number with x.y.z in htdocs/filefunc.inc.php - Commit all changes. diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index aaaa1fdb33a48..32324d28e4223 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ sub script_dolibarr_author # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.7.2", "3.6.3", "3.5.6" ); +return ( "3.8.1", "3.7.1", "3.6.4", "3.5.7" ); } sub script_dolibarr_category @@ -163,7 +163,7 @@ sub script_dolibarr_commands } # script_dolibarr_install(&domain, version, &opts, &files, &upgrade-info) -# Actually installs joomla, and returns either 1 and an informational +# Actually installs dolibarr, and returns either 1 and an informational # message, or 0 and an error sub script_dolibarr_install { @@ -206,6 +206,9 @@ sub script_dolibarr_install $charset = $dbtype eq "mysql" ? $mycharset : $pgcharset; $collate = $dbtype eq "mysql" ? $mycollate : "C"; +# Install filename +local $step = $version >= 3.8 ? "step" : "etape"; + $path = &script_path_url($d, $opts); if ($path =~ /^https:/ || $d->{'ssl'}) { $url = "https://$d->{'dom'}"; @@ -224,6 +227,10 @@ sub script_dolibarr_install &set_permissions_as_domain_user($d, 0666, $cfile); &run_as_domain_user($d, "mkdir ".quotemeta($docdir)); &set_permissions_as_domain_user($d, 0777, $docdir); + if (!$version >= 3.7.2) { + &run_as_domain_user($d, "mkdir ".quotemeta($altdir)); + &set_permissions_as_domain_user($d, 0777, $altdir); + } } else { # Preserve old config file, documents and custom directory @@ -259,7 +266,7 @@ sub script_dolibarr_install [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], ); - local $err = &call_dolibarr_wizard_page(\@params, "step5", $d, $opts); + local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory. @@ -282,15 +289,15 @@ sub script_dolibarr_install [ "main_force_https", $opts->{'forcehttps'} ], [ "dolibarr_main_db_character_set", $charset ], [ "dolibarr_main_db_collation", $collate ], - [ "usealternaterootdir", "1" ], + [ "main_use_alt_dir", "1" ], [ "main_alt_dir_name", "custom" ], ); - local $err = &call_dolibarr_wizard_page(\@params, "step1", $d, $opts); + local $err = &call_dolibarr_wizard_page(\@params, $step."1", $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Second page (Populate database) local @params = ( [ "action", "set" ] ); - local $err = &call_dolibarr_wizard_page(\@params, "step2", $d, $opts); + local $err = &call_dolibarr_wizard_page(\@params, $step."2", $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Third page (Add administrator account) @@ -299,7 +306,7 @@ sub script_dolibarr_install [ "pass", $dompass ], [ "pass_verif", $dompass ], ); - local $err = &call_dolibarr_wizard_page(\@params, "step5", $d, $opts); + local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory and protect config file. @@ -324,14 +331,10 @@ sub call_dolibarr_wizard_page local $params = join("&", map { $_->[0]."=".&urlize($_->[1]) } @$params ); local $ipage = $opts->{'path'}."/install/".$page.".php"; local ($iout, $ierror); - &post_http_connection($d, $ipage, $params, \$iout, \$ierror); -print STDERR $iout; - if ($ierror) { return $ierror; } - return undef; } @@ -347,8 +350,8 @@ sub script_dolibarr_uninstall return (0, $derr) if ($derr); # Remove all llx_ tables from the database -# 4 times because of constraints -for(my $i=0; $i<4; $i++) { +# 10 times because of constraints +for(my $i=0; $i<10; $i++) { &cleanup_script_database($d, $opts->{'db'}, "llx_"); } @@ -381,9 +384,10 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", - $ver >= 3.2 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : - $ver >= 3.1 ? "dolibarr\\-(3\\.1\\.[0-9\\.]+)\\.tgz" : - $ver >= 3 ? "dolibarr\\-(3\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.8 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" : $ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" : "dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz"); return "Failed to find versions" if (!@vers); diff --git a/dev/cliparts/commons.svg b/dev/cliparts/commons.svg new file mode 100644 index 0000000000000..1abca065694d8 --- /dev/null +++ b/dev/cliparts/commons.svg @@ -0,0 +1,2058 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index 1903d6f4572d6..2d4aea97a5f71 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -231,7 +231,7 @@ public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, arra } if (!empty($sortfield)) { - $sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder; + $sql .= $this->db->order($sortfield,$sortorder); } if (!empty($limit)) { $sql .= ' ' . $this->db->plimit($limit + 1, $offset); diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 0eb3b01589c1b..c1e12c2f93c7a 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -282,7 +282,7 @@ function init_myfunc() if (! empty($moreforfilter)) { - print '
'; + print '
'; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -290,7 +290,7 @@ function init_myfunc() print '
'; } - print ''."\n"; + print '
'."\n"; // Fields title print ''; diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index a56701dada22d..d1c4ef409b471 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -76,7 +76,7 @@ $action = 'update'; if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } else if ($action == 'enable') { if ($accounting->fetch($id)) { @@ -84,7 +84,7 @@ } $action = 'update'; if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 925bf81813778..99eb49949e7ff 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -125,7 +125,7 @@ } if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 9bde2d23c14a4..c0a987ddf82d1 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -100,9 +100,9 @@ } if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 0e39776946a1c..45e69c991de7d 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -66,7 +66,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -84,12 +84,12 @@ if (empty($object->date_start) && empty($object->date_end)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if (empty($object->label)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); $error++; } @@ -110,7 +110,7 @@ { $db->rollback(); - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action='create'; } } @@ -147,7 +147,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 61e86b7df1908..7c38617d66ca5 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -76,14 +76,14 @@ $result = $accounting->create($user); if ($result > 0) { - setEventMessage($langs->trans("AccountingAccountAdd"), 'mesgs'); + setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs'); } else { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } $cpt ++; } } else { - setEventMessage($langs->trans('AccountPlanNotFoundCheckSetting'), 'errors'); + setEventMessages($langs->trans('AccountPlanNotFoundCheckSetting'), null, 'errors'); } } else { print '
' . $langs->trans("AnyLineImport") . '
'; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index af0bccdf00c59..40dff0287837f 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -111,11 +111,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -126,9 +126,9 @@ $error ++; if (! $error) { - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'mesgs'); + setEventMessages($langs->trans("Error"), null, 'mesgs'); } } @@ -138,9 +138,9 @@ if (! $res > 0) $error ++; if (! $error) { - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'mesgs'); + setEventMessages($langs->trans("Error"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php index b55728ee080af..18f01abb082e5 100644 --- a/htdocs/accountancy/admin/journal.php +++ b/htdocs/accountancy/admin/journal.php @@ -68,9 +68,9 @@ } if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index d79d14e74d171..0bea58fd75c54 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -116,7 +116,7 @@ $result=$accounting->fetch($accounting_account_id,null,1); if ($result<0) { - //setEventMessage(null, $accounting->errors,'errors'); + //setEventMessages(null, $accounting->errors, 'errors'); $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '
' . $sql . '
'; } else { diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d1bf69a8eee27..0500ac4a0a756 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -51,8 +51,8 @@ $error = 0; - if ((intval($debit) != 0) && (intval($credit) != 0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) { + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -61,7 +61,7 @@ $result = $book->fetch($id); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $book->numero_compte = $numero_compte; $book->code_tiers = $code_tiers; @@ -69,20 +69,20 @@ $book->debit = $debit; $book->credit = $credit; - if (! empty($debit)) { + if (floatval($debit)!=0.0) { $book->montant = $debit; $book->sens = 'D'; } - if (! empty($credit)) { + if (floatval($credit)!=0.0) { $book->montant = $credit; $book->sens = 'C'; } $result = $book->update(); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -93,7 +93,7 @@ $error = 0; if ((intval($debit) != 0) && (intval($credit) != 0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -124,9 +124,9 @@ $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -140,11 +140,11 @@ $piece_num = $book->piece_num; if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $result = $book->delete($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } } $action = ''; @@ -168,9 +168,9 @@ $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; $piece_num = $book->piece_num; } @@ -246,7 +246,7 @@ $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } if (! empty($book->piece_num)) { @@ -277,7 +277,7 @@ $result = $book->fetch_all_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { print load_fiche_titre($langs->trans("ListeMvts")); @@ -372,4 +372,4 @@ } llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d9b6d66b503c2..b916432903108 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -74,7 +74,7 @@ $result = $object->delete_by_importkey($import_key); Header("Location: list.php"); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } // Export @@ -86,7 +86,7 @@ $object = new BookKeeping($db); $result = $object->export_bookkeping('ebp'); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } foreach ( $object->linesexport as $line ) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 09e8b24a8ea57..a3e179c1701f5 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -54,7 +54,7 @@ dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ea37f23745565..0b8b842bb992b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -83,10 +83,10 @@ if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } @@ -346,4 +346,4 @@ print '
'; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 01f34e700cc33..a505c91c1c78a 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -109,14 +109,14 @@ $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 812acf5c92380..cd0c5d06ce50a 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; @@ -120,6 +121,7 @@ $societestatic = new Societe($db); $userstatic = new User($db); $chargestatic = new ChargeSociales($db); +$paymentdonstatic = new PaymentDonation($db); $paymentvatstatic = new TVA($db); $paymentsalstatic = new PaymentSalary($db); @@ -133,7 +135,8 @@ $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); $accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef")); $accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef")); - + $accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef")); + $tabpay = array (); $tabbq = array (); $tabtp = array (); @@ -174,95 +177,100 @@ // get_url may return -1 which is not traversable if (is_array($links)) { - - foreach ( $links as $key => $val ) - { - $tabtype[$obj->rowid] = $links[$key]['type']; - - if ($links[$key]['type'] == 'payment') - { - $paymentstatic->id = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2); - } - else if ($links[$key]['type'] == 'payment_supplier') + foreach ( $links as $key => $val ) { - $paymentsupplierstatic->id = $links[$key]['url_id']; - $paymentsupplierstatic->ref = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2); - } - else if ($links[$key]['type'] == 'company') - { - $societestatic->id = $links[$key]['url_id']; - $societestatic->name = $links[$key]['label']; - $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); - $tabtp[$obj->rowid][$compta_soc] += $obj->amount; - } - else if ($links[$key]['type'] == 'user') - { - $userstatic->id = $links[$key]['url_id']; - $userstatic->name = $links[$key]['label']; - $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30); - // $tabtp[$obj->rowid][$compta_user] += $obj->amount; - } - else if ($links[$key]['type'] == 'sc') - { - $chargestatic->id = $links[$key]['url_id']; - $chargestatic->ref = $links[$key]['url_id']; - - $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); - if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { - if ($reg[1] == 'socialcontribution') - $reg[1] = 'SocialContribution'; - $chargestatic->lib = $langs->trans($reg[1]); + $tabtype[$obj->rowid] = $links[$key]['type']; + + if ($links[$key]['type'] == 'payment') + { + $paymentstatic->id = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2); + } + else if ($links[$key]['type'] == 'payment_supplier') + { + $paymentsupplierstatic->id = $links[$key]['url_id']; + $paymentsupplierstatic->ref = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2); } - else + else if ($links[$key]['type'] == 'company') { - $chargestatic->lib = $links[$key]['label']; + $societestatic->id = $links[$key]['url_id']; + $societestatic->name = $links[$key]['label']; + $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); + $tabtp[$obj->rowid][$compta_soc] += $obj->amount; } - $chargestatic->ref = $chargestatic->lib; - $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); + else if ($links[$key]['type'] == 'user') + { + $userstatic->id = $links[$key]['url_id']; + $userstatic->name = $links[$key]['label']; + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30); + // $tabtp[$obj->rowid][$compta_user] += $obj->amount; + } + else if ($links[$key]['type'] == 'sc') + { + $chargestatic->id = $links[$key]['url_id']; + $chargestatic->ref = $links[$key]['url_id']; + + $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); + if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { + if ($reg[1] == 'socialcontribution') + $reg[1] = 'SocialContribution'; + $chargestatic->lib = $langs->trans($reg[1]); + } + else + { + $chargestatic->lib = $links[$key]['label']; + } + $chargestatic->ref = $chargestatic->lib; + $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); - $sqlmid = 'SELECT cchgsoc.accountancy_code'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc "; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; - $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; + $sqlmid = 'SELECT cchgsoc.accountancy_code'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc "; + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; + $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; - dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) + { + $objmid = $db->fetch_object($resultmid); + $tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount; + } + } + else if ($links[$key]['type'] == 'payment_donation') { - $objmid = $db->fetch_object($resultmid); - $tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount; + $paymentdonstatic->id = $links[$key]['url_id']; + $paymentdonstatic->fk_donation = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentDonation"); + $tabtp[$obj->rowid][$accountancy_account_pay_donation] += $obj->amount; } + else if ($links[$key]['type'] == 'payment_vat') + { + $paymentvatstatic->id = $links[$key]['url_id']; + $paymentvatstatic->ref = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat"); + $tabtp[$obj->rowid][$accountancy_account_pay_vat] += $obj->amount; + } + else if ($links[$key]['type'] == 'payment_salary') + { + $paymentsalstatic->id = $links[$key]['url_id']; + $paymentsalstatic->ref = $links[$key]['url_id']; + $paymentsalstatic->label = $links[$key]['label']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); + $tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount; + } + else if ($links[$key]['type'] == 'banktransfert') + { + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2); + $tabtp[$obj->rowid][$cpttva] += $obj->amount; + } + /*else { + $tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount; + }*/ } - else if ($links[$key]['type'] == 'payment_vat') - { - $paymentvatstatic->id = $links[$key]['url_id']; - $paymentvatstatic->ref = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat"); - $tabtp[$obj->rowid][$accountancy_account_pay_vat] += $obj->amount; - } - else if ($links[$key]['type'] == 'payment_salary') - { - $paymentsalstatic->id = $links[$key]['url_id']; - $paymentsalstatic->ref = $links[$key]['url_id']; - $paymentsalstatic->label = $links[$key]['label']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); - $tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount; - } - else if ($links[$key]['type'] == 'banktransfert') - { - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2); - $tabtp[$obj->rowid][$cpttva] += $obj->amount; - } - /*else { - $tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount; - }*/ - } - } $tabbq[$obj->rowid][$compta_bank] += $obj->amount; @@ -335,7 +343,7 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } // Third party @@ -412,13 +420,13 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } // Export diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 28b2dc736b6f4..538edaa471ddf 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -185,7 +185,7 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -215,7 +215,7 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -246,14 +246,14 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 4437535738aac..aaf3beea8a1ee 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -220,7 +220,7 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -250,7 +250,7 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -282,14 +282,14 @@ $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f0747c8d29cef..61b225fbc1632 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -55,7 +55,7 @@ dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 954eb60300cbb..ec18d8b1e23c1 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -79,10 +79,10 @@ if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index f475e7046ad79..e703bca6f2df3 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -115,14 +115,14 @@ $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 5827e1d22d7bd..8e265eb70f7ba 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 3d88d3bb17175..6f5d1de5c8710 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -60,11 +60,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -200,7 +200,7 @@ function initfields() print ''; print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); print ''; - print '';; + print ''; print "\n"; } diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 71106dddee6b4..77fa802296844 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -84,23 +84,24 @@ dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Reference - print ''; - print ''; - print ''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + + print '
'; + print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'id', $linkback); - print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } + // Type + print '\n"; + // Morphy print ''; /*print '';*/ print ''; - // Type - print '\n"; - // Company print ''; @@ -118,20 +116,12 @@ print ''; print ''; - // Lastname - print ''; - print ''; - - // Firstname - print ''; - - // Status - print ''; - print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().''; @@ -108,9 +109,6 @@ print '
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; print '
'; + dol_fiche_end(); + /* * Barre d'action diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index bc2dcec7f6a2f..f998c2f08a3fd 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2013 Philippe Grand + * Copyright (C) 2012-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -133,7 +133,7 @@ if ($userid != $user->id && $userid != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -169,7 +169,7 @@ $thirdparty=new Societe($db); $thirdparty->fetch($socid); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } @@ -195,12 +195,12 @@ if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($nuser->error), 'errors'); + setEventMessages($langs->trans($nuser->error), null, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->errors, $object->error, 'errors'); } } @@ -216,13 +216,13 @@ if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($company->error), 'errors'); - setEventMessage($company->errors, 'errors'); + setEventMessages($langs->trans($company->error), null, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -236,7 +236,7 @@ $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $langs->load("mails"); - setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email)); + setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); } } @@ -257,12 +257,12 @@ if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); } // Create new object @@ -352,7 +352,7 @@ $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0) { - setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } else { @@ -368,7 +368,7 @@ } else { - setEventMessage("ErrorBadImageFormat", 'errors'); + setEventMessages("ErrorBadImageFormat", null, 'errors'); } } else @@ -397,9 +397,9 @@ else { if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -485,14 +485,14 @@ // Check parameters if (empty($morphy) || $morphy == "-1") { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Nature")), null, 'errors'); } // Test si le login existe deja if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($login)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Login")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Login")), null, 'errors'); } else { $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'"; @@ -503,32 +503,32 @@ if ($num) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors'); + setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors'); } } if (empty($pass)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Password")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Password")), null, 'errors'); } } if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); } if (! ($typeid > 0)) { // Keep () before ! $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } $public=0; if (isset($public)) $public=1; @@ -554,9 +554,9 @@ $db->rollback(); if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action = 'create'; @@ -609,7 +609,7 @@ if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -617,9 +617,9 @@ { $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -654,7 +654,7 @@ if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -662,9 +662,9 @@ $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -683,7 +683,7 @@ { if (!$mailmanspip->del_to_spip($object)) { - setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } @@ -694,7 +694,7 @@ { if (!$mailmanspip->add_to_spip($object)) { - setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } @@ -802,13 +802,6 @@ function initfieldrequired() print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; } - // Moral-Physique - $morphys["phy"] = $langs->trans("Physical"); - $morphys["mor"] = $langs->trans("Moral"); - print ''.$langs->trans("Nature")."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1); - print "\n"; - // Type print ''.$langs->trans("MemberType").''; $listetype=$adht->liste_array(); @@ -820,6 +813,13 @@ function initfieldrequired() } print "\n"; + // Morphy + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + print ''.$langs->trans("Nature")."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1); + print "\n"; + // Company print ''.$langs->trans("Company").''; @@ -1050,7 +1050,7 @@ function initfieldrequired() print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; } - // Physique-Moral + // Morphy $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Morale"); print ''.$langs->trans("Nature").''; @@ -1402,37 +1402,29 @@ function initfieldrequired() if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->skype->enabled)) $rowspan++; - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - $showphoto=''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'rowid', $linkback); - print '
'; - $showphoto.=$form->showphoto('memberphoto',$object); - $showphoto.='
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; - // Photo - print $showphoto; $showphoto=''; - print ''; + print ''; } + // Type + print '\n"; + // Morphy print ''; - print $showphoto; $showphoto=''; print ''; - // Type - print '\n"; - // Company print ''; @@ -1440,16 +1432,6 @@ function initfieldrequired() print ''; print ''; - // Lastname - print ''; - print ''; - - // Firstname - print ''; - - // EMail - print ''; - // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { @@ -1463,48 +1445,26 @@ function initfieldrequired() print ''; } - // Address - print ''; - - // Zip / Town - print ''; - - // Country - print ''; - - // State - print ''; - - // Tel pro. - print ''; - - // Tel perso - print ''; - - // Tel mobile - print ''; - // Skype if (! empty($conf->skype->enabled)) { print ''; } + print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).'
'.$langs->trans("Address").''; - dol_print_address($object->address,'gmap','member',$object->id); - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'
'.$langs->trans("Country").''; - $img=picto_from_langcode($object->country_code); - if ($img) print $img.' '; - print getCountry($object->country_code); - print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans("PhonePro").''.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'; + + print ''; + print '
'; + + print '
'; + print ''; + // Birthday print ''; // Public print ''; - // Status - print ''; - // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { @@ -1592,14 +1552,34 @@ function initfieldrequired() } print ''; - print "
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
\n"; + // Date end subscription + print ''.$langs->trans("SubscriptionEndDate").''; + if ($object->datefin) + { + print dol_print_date($object->datefin,'day'); + if ($object->hasDelay()) { + print " ".img_warning($langs->trans("Late")); + } + } + else + { + print $langs->trans("SubscriptionNotReceived"); + if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } + print ''; - print "
\n"; + print "\n"; + print "
\n"; + print '
'; + dol_fiche_end(); + + /* * Hotbar */ + print '
'; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 92af9c5981e00..9d86f618618da 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -110,7 +110,7 @@ { $langs->load("errors"); $errmsg=$langs->trans($company->error); - setEventMessage($company->errors, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } else { @@ -131,7 +131,7 @@ if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -167,7 +167,7 @@ $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST('socid','int')); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } @@ -567,54 +567,155 @@ dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); - print ''; - $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + print '
'; + + print '
'; + print '
'; - // Ref - print ''; - print ''; + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''; + } - $showphoto=''; + // Type + print '\n"; - // Login - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) - { - print ''; - print $showphoto; $showphoto=''; - print ''; - } + // Morphy + print ''; + print ''; - // Morphy - print ''; - print $showphoto; $showphoto=''; - print ''; + // Company + print ''; - // Type - print '\n"; + // Civility + print ''; + print ''; - // Company - print ''; + // Password + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''; + } - // Civility - print ''; - print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } - // Lastname - print ''; - print ''; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'rowid', $linkback); - print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$form->showphoto('memberphoto',$object).'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("Password").''.preg_replace('/./i','*',$object->pass); + if ((! empty($object->pass) || ! empty($object->pass_crypted)) && empty($object->user_id)) + { + $langs->load("errors"); + $htmltext=$langs->trans("WarningPasswordSetWithNoAccount"); + print ' '.$form->textwithpicto('', $htmltext,1,'warning'); + } + print '
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Lastname").''.$object->lastname.' 
'; + + print '
'; + print '
'; + + print '
'; + print ''; + + // Birthday + print ''; + + // Public + print ''; + + // Categories + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + print ''; + print ''; + } - // Firstname - print ''; - print ''; + // Other attributes + $parameters=array('colspan'=>2); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields, 'view', $parameters); + } - // EMail - print ''; + // Third party Dolibarr + if (! empty($conf->societe->enabled)) + { + print ''; + } - // Status - print ''; + // Login Dolibarr + print ''; // Date end subscription print ''; - // Third party Dolibarr - if (! empty($conf->societe->enabled)) - { - print ''; - } - - // Login Dolibarr - print ''; - print "
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Public").''.yn($object->public).'
' . $langs->trans("Categories") . ''; + print $form->showCategories($object->id, 'member', 1); + print '
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).'
'; + print ''; + if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; + print '
'; + print $langs->trans("LinkedToDolibarrThirdParty"); + print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; + print '
'; + if ($action == 'editthirdparty') + { + $htmlname='socid'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $form->select_company($object->fk_soc,'socid','',1); + print '
'; + } + else + { + if ($object->fk_soc) + { + $company=new Societe($db); + $result=$company->fetch($object->fk_soc); + print $company->getNomUrl(1); + } + else + { + print $langs->trans("NoThirdPartyAssociatedToMember"); + } + } + print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; + print ''; + if ($action != 'editlogin' && $user->rights->adherent->creer) + { + print ''; + } + print '
'; + print $langs->trans("LinkedToDolibarrUser"); + print ''; + if ($user->rights->user->user->creer) + { + print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).''; + } + print '
'; + print '
'; + if ($action == 'editlogin') + { + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); + } + else + { + if ($object->user_id) + { + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + } + else print $langs->trans("NoDolibarrAccess"); + } + print '
'.$langs->trans("SubscriptionEndDate").''; @@ -632,83 +733,16 @@ } print '
'; - print ''; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; - print '
'; - print $langs->trans("LinkedToDolibarrThirdParty"); - print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; - print '
'; - if ($action == 'editthirdparty') - { - $htmlname='socid'; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - print $form->select_company($object->fk_soc,'socid','',1); - print '
'; - } - else - { - if ($object->fk_soc) - { - $company=new Societe($db); - $result=$company->fetch($object->fk_soc); - print $company->getNomUrl(1); - } - else - { - print $langs->trans("NoThirdPartyAssociatedToMember"); - } - } - print '
'; - print ''; - if ($action != 'editlogin' && $user->rights->adherent->creer) print ''; - print '
'; - print $langs->trans("LinkedToDolibarrUser"); - print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'
'; - print '
'; - if ($action == 'editlogin') - { - /*$include=array(); - if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only - { - $include=array($object->user_id,$user->id); - }*/ - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); - } - else - { - if ($object->user_id) - { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); - } - else print $langs->trans("NoDolibarrAccess"); - } - print '
\n"; + print "
\n"; + print '
'; + dol_fiche_end(); print ''; - dol_htmloutput_errors($errmsg,$errmsgs); - - /* * Hotbar */ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1676fdd2c691d..77437667c33fb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1575,7 +1575,7 @@ function getNomUrl($withpicto=0,$maxlen=0,$option='card') $picto='user'; - if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); + if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend; return $result; @@ -1976,12 +1976,14 @@ public function setCategories($categories) // Process foreach ($to_del as $del) { - $c->fetch($del); - $c->del_type($this, 'member'); + if ($c->fetch($del) > 0) { + $c->del_type($this, 'member'); + } } foreach ($to_add as $add) { - $c->fetch($add); - $c->add_type($this, 'member'); + if ($c->fetch($add) > 0) { + $c->add_type($this, 'member'); + } } return; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 71f1df229379b..4dd5fd9bf649d 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -83,6 +83,7 @@ * View */ +$form = new Form($db); llxHeader(); @@ -91,19 +92,7 @@ $result=$membert->fetch($object->typeid); if ($result > 0) { - /* - * Affichage onglets - */ - if (! empty($conf->notification->enabled)) - $langs->load("mails"); - - $head = member_prepare_head($object); - - $form=new Form($db); - - dol_fiche_head($head, 'document', $langs->trans("Member"),0,'user'); - - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -111,34 +100,41 @@ { $totalsize+=$file['size']; } + + if (! empty($conf->notification->enabled)) + $langs->load("mails"); + $head = member_prepare_head($object); - print ''; + dol_fiche_head($head, 'document', $langs->trans("Member"),0,'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + + print '
'; + print '
'; - // Ref - print ''; - print ''; + $linkback = ''.$langs->trans("BackToList").''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } + // Type + print '\n"; + // Morphy - print ''; + print ''; /*print '';*/ print ''; - // Type - print '\n"; - // Company print ''; @@ -146,17 +142,6 @@ print ''; print ''; - // Lastname - print ''; - print ''; - - // Firstname - print ''; - print ''; - - // Status - print ''; - // Nbre fichiers print ''; @@ -166,6 +151,8 @@ print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'rowid', $linkback); - print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$membert->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Nature").''.$object->getmorphylib().''; print $form->showphoto('memberphoto',$object); print '
'.$langs->trans("Type").''.$membert->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; print ''; + + dol_fiche_end(); $modulepart = 'member'; $permission = $user->rights->adherent->creer; diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 6f0177d4b6f03..6b980a4df1cec 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -180,18 +180,24 @@ $head[$h][2] = 'info'; $h++; - dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment'); - - print "\n"; print '
'; print ''; print ""; print ""; print "fk_bank."\">"; + + dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment'); + + print "\n"; print ''; + $linkback = ''.$langs->trans("BackToList").''; + // Ref - print ''; + print ''; + print ''; // Member $adh->ref=$adh->getFullName($langs); @@ -239,18 +245,18 @@ } } - print '
'.$langs->trans("Ref").''.$subscription->ref.' 
'.$langs->trans("Ref").''; + print $form->showrefnav($subscription, 'rowid', $linkback, 1); + print '
'; - print ''; + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; print '       '; print ''; - print ''; - - print ''; + print '
'; + print '
'; print "\n"; - - print ''; - print "\n"; } if ($rowid && $action != 'edit') @@ -355,8 +361,7 @@ print "\n"; print ''; - print "\n"; - + dol_fiche_end(); /* * Barre d'actions @@ -388,6 +393,6 @@ } -$db->close(); - llxFooter(); + +$db->close(); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index d6c17337176b4..f6bdb81345c25 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -125,29 +125,32 @@ //print ''; print '
'; +// Search contact/address +if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) +{ + $listofsearchfields['search_member']=array('text'=>'Member'); +} + +if (count($listofsearchfields)) +{ + print '
'; + print ''; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
'.$langs->trans("Search").'
:
'; + print '
'; + print '
'; +} -// Formulaire recherche adherent -print '
'; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -$var=false; -print ""; -print ''; -print ""; -print ''; -print ""; -print ''; -print "
'.$langs->trans("SearchAMember").'
'; -print ':'; -print '
'; -print ':'; -print '
'; -print ':'; -print '
"; /* @@ -156,7 +159,6 @@ if ($conf->use_javascript_ajax) { - print '
'; print ''; print ''; print ''; print ''; print ""; + + $var=!$var; + print ''; + print ''; + print ""; // Disable javascript/ajax $var=!$var; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index cd55cddbf4599..bfccacc40ac7d 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -63,7 +63,7 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -89,7 +89,7 @@ // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); + setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup")); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index d24147417e323..3af47f46aac08 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -77,7 +77,7 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -102,7 +102,7 @@ // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); + setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup")); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 765a15490384f..bba8f2109a325 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -68,7 +68,7 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -93,7 +93,7 @@ // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); + setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup")); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index ae92c8f38cda0..bd9eda149b48e 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -92,7 +92,7 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -117,7 +117,7 @@ // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); + setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } dol_fiche_head($head, 'members', $langs->trans("LDAPSetup")); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 096f844436ffb..76d3bb9dfd05c 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -78,7 +78,7 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -103,7 +103,7 @@ // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { - setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors'); + setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } dol_fiche_head($head, 'users', $langs->trans("LDAPSetup")); @@ -427,7 +427,7 @@ } else { - setEventMessage($ldap->error, 'errors'); + setEventMessages($ldap->error, $ldap->errors, 'errors'); } print "
\n"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 8949fba6d3c6d..823866f8ce6f4 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -43,7 +43,7 @@ || $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC) { $error++; - setEventMessage($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), 'errors'); + setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), null, 'errors'); } if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0 @@ -52,7 +52,7 @@ { $langs->load("errors"); $error++; - setEventMessage($langs->trans("ErrorNegativeValueNotAllowed"), 'errors'); + setEventMessages($langs->trans("ErrorNegativeValueNotAllowed"), null, 'errors'); } if ($_POST["MAIN_ROUNDING_RULE_TOT"]) @@ -61,7 +61,7 @@ { $langs->load("errors"); $error++; - setEventMessage($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), 'errors'); + setEventMessages($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), null, 'errors'); } } diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 9257aada0292c..ec00cc7233caa 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -58,11 +58,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -75,11 +75,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -117,13 +117,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -148,12 +148,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -237,7 +237,7 @@ * Livraison numbering model */ -print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules")); +print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'',''); print '
'.$langs->trans("Statistics").'
'; diff --git a/htdocs/adherents/info.php b/htdocs/adherents/info.php index 27f36e9a8430d..36ed504dd73fc 100644 --- a/htdocs/adherents/info.php +++ b/htdocs/adherents/info.php @@ -42,23 +42,34 @@ * View */ +$form = new Form($db); + llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); -$adh = new Adherent($db); -$adh->fetch($id); -$adh->info($id); +$object = new Adherent($db); +$object->fetch($id); +$object->info($id); -$head = member_prepare_head($adh); +$head = member_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Member"), 0, 'user'); -print '
'; -dol_print_object_info($adh); -print '
'; +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'rowid', $linkback); + +print '
'; + +print '
'; + +print '
'; +dol_print_object_info($object); print '
'; +dol_fiche_end(); + llxFooter(); $db->close(); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 89572525c32d9..4d9a779d57907 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -44,12 +44,11 @@ $socid = $user->societe_id; } -$adh = new Adherent($db); -$adh->id = $rowid; -$result=$adh->fetch($rowid); +$object = new Adherent($db); +$result=$object->fetch($rowid); if (! $result) { - dol_print_error($db,"Failed to get adherent: ".$adh->error); + dol_print_error($db,"Failed to get adherent: ".$object->error); exit; } @@ -65,20 +64,20 @@ $ldap=new Ldap(); $result=$ldap->connect_bind(); - $info=$adh->_load_ldap_info(); - $dn=$adh->_load_ldap_dn($info); + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro $result=$ldap->update($dn,$info,$user,$olddn); if ($result >= 0) { - setEventMessage($langs->trans("MemberSynchronized")); + setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($ldap->error, 'errors'); + setEventMessages($ldap->errors, $ldap->error, 'errors'); $db->rollback(); } } @@ -93,35 +92,27 @@ $form = new Form($db); -$head = member_prepare_head($adh); +$head = member_prepare_head($object); dol_fiche_head($head, 'ldap', $langs->trans("Member"), 0, 'user'); +$linkback = ''.$langs->trans("BackToList").''; -print ''; +dol_banner_tab($object, 'rowid', $linkback); -// Ref -print ''; -print ''; +print '
'; -// Lastname -print '
'; -print ''; - -// Firstname -print ''; -print ''; +print '
'; +print '
'.$langs->trans("Ref").''; -print $form->showrefnav($adh,'id'); -print '
'.$langs->trans("Lastname").''.$adh->lastname.' 
'.$langs->trans("Firstname").''.$adh->firstname.' 
'; // Login -print ''; +print ''; // Password not crypted if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) { print ''; - print ''; + print ''; print "\n"; } @@ -129,12 +120,12 @@ if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) { print ''; - print ''; + print ''; print "\n"; } // Type -print '\n"; +print '\n"; $langs->load("admin"); @@ -155,6 +146,8 @@ print ''; +dol_fiche_end(); + /* * Barre d'actions */ @@ -163,7 +156,7 @@ if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != 'ldap2dolibarr') { - print ''; + print ''; } print "\n"; @@ -187,9 +180,9 @@ $result=$ldap->connect_bind(); if ($result > 0) { - $info=$adh->_load_ldap_info(); - $dn=$adh->_load_ldap_dn($info,1); - $search = "(".$adh->_load_ldap_dn($info,2).")"; + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info,1); + $search = "(".$object->_load_ldap_dn($info,2).")"; if (empty($dn)) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 4ffbbf33fb66a..7d86c04869c76 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -78,6 +78,21 @@ $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'd.rowid'=>'Ref', + //'d.ref'=>'Ref', + 'd.lastname'=>'Lastname', + 'd.firstname'=>'Firstname', + 'd.societe'=>"Company", + 'd.email'=>'EMail', + 'd.address'=>'Address', + 'd.zip'=>'Zip', + 'd.town'=>'Town', + 'd.note_public'=>'NotePublic', + 'd.note_private'=>'NotePrivate', +); + /* * View @@ -111,7 +126,7 @@ if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ); if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL"; $sql.= " AND d.entity IN (".getEntity('adherent', 1).")"; -if ($sall) $sql.=natural_search(array("d.rowid", "d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall); +if ($sall) $sql.=natural_search(array_keys($fieldstosearchall), $sall); if ($type > 0) $sql.=" AND t.rowid=".$db->escape($type); if (isset($_GET["statut"]) || isset($_POST["statut"])) $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules if ($search_ref) @@ -180,28 +195,29 @@ if ($optioncss != '') $param.='&optioncss='.$optioncss; print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - if ($sall) - { - print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): "; - print ''.$sall.''; - } - print ''; if ($optioncss != '') print ''; print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + // Filter on categories $moreforfilter=''; if (! empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1); - $moreforfilter.='       '; + $moreforfilter.='
'; } if (! empty($moreforfilter)) { - print '
'; + print '
'; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -209,7 +225,7 @@ print '
'; } - print "
'.$langs->trans("Login").''.$adh->login.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").''.$adh->pass.''.$object->pass.'
'.$langs->trans("LDAPFieldPasswordCrypted").''.$adh->pass_crypted.''.$object->pass_crypted.'
'.$langs->trans("Type").''.$adh->type."
'.$langs->trans("Type").''.$object->type."
"; + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 79b7db086e6d0..a895d6cfef839 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -73,33 +73,31 @@ print ""; print ''; - print '
'; - - $linkback = ''.$langs->trans("BackToList").''; - - // Reference - print ''; - print ''; - print ''; + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + + print '
'; + print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'id', $linkback); - print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } + // Type + print '\n"; + // Morphy - print ''; + print ''; /*print '';*/ print ''; - // Type - print '\n"; - // Company print ''; @@ -107,21 +105,13 @@ print ''; print ''; - // Lastname - print ''; - print ''; - - // Firstname - print ''; - - // Status - print ''; - print "
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Nature").''.$object->getmorphylib().''; print $form->showphoto('memberphoto',$member); print '
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Status").''.$object->getLibStatut(4).'
"; + + print ''; print '
'; - $colwidth='20'; + $cssclass='titlefield'; $permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 6f5edf529d9f4..dcf77a2dbad45 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -116,7 +116,7 @@ } // Print array -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 3b2ca4c3ecd93..f8b6a54f7b72e 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -282,7 +282,7 @@ if ($mode) { // Print array / Affiche le tableau - print '
'.$langs->trans("Nature").''.$langs->trans("NbOfMembers").'
'; + print '
'; print ''; print ''; if ($label2) print ''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index a3c8fd69aad80..43b994adafeb6 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -167,8 +167,8 @@ $data = $stats->getAllByYear(); -print '
'.$label.''.$label2.'
'; -print ''; +print '
'; +print ''; print ''; print ''; print ''; @@ -176,14 +176,15 @@ print ''; $oldyear=0; +$var=false; foreach ($data as $val) { $year = $val['year']; - print $avg; while ($oldyear > $year+1) { // If we have empty year $oldyear--; - print ''; + $var=!$var; + print ''; print ''; print ''; } - print ''; + $var=!$var; + print ''; print '
'.$langs->trans("Year").''.$langs->trans("NbOfSubscriptions").''.$langs->trans("AmountTotal").'
'; print ''; print $oldyear; @@ -194,7 +195,8 @@ print '0
'; //print ''; print $year; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 75102ed9f5019..af708ef2f2013 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -168,7 +168,7 @@ print load_fiche_titre($langs->trans("MembersTypes")); - dol_fiche_head(''); + //dol_fiche_head(''); $sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; @@ -211,7 +211,7 @@ dol_print_error($db); } - dol_fiche_end(); + //dol_fiche_end(); /* * Hotbar @@ -679,7 +679,16 @@ print '

'; foreach($extrafields->attribute_label as $key=>$label) { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); + if (isset($_POST["options_" . $key])) { + if (is_array($_POST["options_" . $key])) { + // $_POST["options"] is an array but following code expects a comma separated string + $value = implode(",", $_POST["options_" . $key]); + } else { + $value = $_POST["options_" . $key]; + } + } else { + $value = $adht->array_options["options_" . $key]; + } print '\n"; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 287f2a897ebad..c11cbeff3a4cf 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -86,12 +86,12 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"),null, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9356674921e02..755d1eb23f995 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -72,7 +72,7 @@ if (! empty($src) && ! dol_is_url($src)) { - setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); + setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors'); $error++; $errorsaved++; break; @@ -104,12 +104,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index dfdac2a8f0f5d..cd2406e6fdc2e 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -54,12 +54,12 @@ if ($i >= 4) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("SaveFailed"), 'errors'); + setEventMessages($langs->trans("SaveFailed"), null, 'errors'); } } diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php index 5644605e625f2..9afcd1a8f62bb 100644 --- a/htdocs/admin/askpricesupplier.php +++ b/htdocs/admin/askpricesupplier.php @@ -6,8 +6,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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,11 +54,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -96,13 +96,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -116,11 +116,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -134,11 +134,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -150,11 +150,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -178,12 +178,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -249,7 +249,7 @@ /* * Module numerotation */ -print load_fiche_titre($langs->trans("AskPriceSupplierNumberingModules")); +print load_fiche_titre($langs->trans("AskPriceSupplierNumberingModules"),'',''); print '
'.$label.''; print $extrafields->showInputField($key,$value); print "
'; print ''; @@ -351,7 +351,7 @@ * Document templates generators */ -print load_fiche_titre($langs->trans("AskPriceSupplierPDFModules")); +print load_fiche_titre($langs->trans("AskPriceSupplierPDFModules"),'',''); // Load array def with activated templates $def = array(); @@ -513,7 +513,7 @@ * Other options * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); $var=true; print "
"; @@ -594,7 +594,7 @@ * Directory */ print '
'; -print load_fiche_titre($langs->trans("PathToDocuments")); +print load_fiche_titre($langs->trans("PathToDocuments"),'',''); print "
\n"; print "\n"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 8214755fd2b24..048e351044de0 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -56,11 +56,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 1d51e55228090..0a57508c271c5 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -97,11 +97,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'msgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -111,11 +111,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -188,7 +188,7 @@ $var=true; print '
'; -print load_fiche_titre($langs->trans("BarcodeEncodeModule")); +print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'',''); print '
'; print ''; @@ -288,7 +288,7 @@ * Autres options * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print ""; print ''; @@ -358,7 +358,7 @@ // Select barcode numbering module if ($conf->produit->enabled) { - print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")"); + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")",'',''); print '
'; print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6b1eb71fafe70..5b6d64801b5f4 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -85,7 +85,7 @@ } else { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } @@ -121,7 +121,7 @@ $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 1550c0ebef72a..30bf760c5b345 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -36,16 +36,19 @@ /* * Actions */ + if ($action == 'setvalue' && $user->admin) { - $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); - if ($result >= 0) + $result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity); + $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity); + + if ($result1 >= 0 && $result2 >= 0) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -73,13 +76,22 @@ print '
'; print ''; -print ''; +print ''; print ''; print "\n"; + +$var=!$var; +print ''; + $var=!$var; -print ''; @@ -769,7 +769,7 @@ } else { - print ''; + print ''; } print '
'.$langs->trans("Name").''.$langs->trans("Name").''.$langs->trans("Value").'
'; +print $langs->trans("ClickToDialUseTelLink").''; +print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'
'; +print '
'; +print $langs->trans("ClickToDialUseTelLinkDesc"); +print '
'; +print '
'; print $langs->trans("DefaultLink").''; -print '
'; +print 'global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'">
'; print '
'; print $langs->trans("ClickToDialUrlDesc").'
'; print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index b2d44047d7795..9e55369dac91a 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -64,11 +64,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -106,13 +106,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -137,12 +137,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,11 +214,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,9 +228,9 @@ $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); if (! $res > 0) $error++; if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -243,11 +243,28 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +// Activate ask for warehouse +else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') +{ + $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -273,7 +290,7 @@ * Orders Numbering model */ -print load_fiche_titre($langs->trans("OrdersNumberingModules")); +print load_fiche_titre($langs->trans("OrdersNumberingModules"),'',''); print ''; print ''; @@ -377,7 +394,7 @@ * Document templates generators */ -print load_fiche_titre($langs->trans("OrdersModelModule")); +print load_fiche_titre($langs->trans("OrdersModelModule"),'',''); // Load array def with activated templates $def = array(); @@ -540,7 +557,7 @@ * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; print ''; @@ -630,6 +647,36 @@ print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").''; } +// Ask for warehouse during order +if ($conf->stock->enabled) +{ + $var=!$var; + print ''; +} +else +{ + $var=!$var; + print ''; +} + print '
'.$langs->trans("Parameter").' '.$langs->trans('NotAvailable').'
'; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; + if (! empty($conf->use_javascript_ajax)) + { + print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); + } + else + { + if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } + } + print '
'; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; print '
'; @@ -638,7 +685,7 @@ * Notifications */ -print load_fiche_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications"),'',''); print ''; print ''; print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index eb78ead387b8c..e84bdf2a3fa52 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -125,19 +125,19 @@ $error++; $langs->load("errors"); $tmparray=explode(':',$result); - setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); } else { $error++; - setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } else { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } } @@ -230,7 +230,7 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); } } @@ -238,7 +238,7 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); + setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } } @@ -380,7 +380,7 @@ print ''; } } else { - print ''; + print ''; } print '
'.$langs->trans("Parameter").'
'; print '
'; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 633f88b9cfb6a..38ba28e9fa401 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -87,11 +87,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index c1eff57571a15..06e3279fa543c 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -55,12 +55,12 @@ if (empty($constname)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); $error++; } if ($constvalue == '') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors'); $error++; } @@ -68,7 +68,7 @@ { if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $constname=""; $constvalue=""; @@ -99,7 +99,7 @@ } } } - if ($nbmodified > 0) setEventMessage($langs->trans("RecordSaved")); + if ($nbmodified > 0) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=''; } @@ -122,7 +122,7 @@ } } } - if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted")); + if ($nbdeleted > 0) setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); $action=''; } @@ -131,7 +131,7 @@ { if (dolibarr_del_const($db, $rowid, $entity) >= 0) { - setEventMessage($langs->trans("RecordDeleted")); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } else { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index cf93977fc8b43..acfe7de156fde 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2014 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -59,11 +59,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,13 +101,13 @@ } else { - setEventMessage($obj->error,'errors'); + setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -132,12 +132,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -194,11 +194,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -226,7 +226,7 @@ * Contracts Numbering model */ -print load_fiche_titre($langs->trans("ContractsNumberingModules")); +print load_fiche_titre($langs->trans("ContractsNumberingModules"),'',''); print ''; print ''; @@ -329,7 +329,7 @@ * Documents models for Contracts */ -print load_fiche_titre($langs->trans("TemplatePDFContracts")); +print load_fiche_titre($langs->trans("TemplatePDFContracts"),'',''); // Defini tableau def des modeles $def = array(); @@ -494,7 +494,7 @@ print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e2f4b03754c5d..817019cc24bfc 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load("errors"); @@ -465,6 +466,9 @@ 'fichinter' => $langs->trans('InterventionCard') ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); + + complete_elementList_with_modules($elementList); + asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), @@ -544,20 +548,20 @@ if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible'; if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; - setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } } // Other checks if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { $ok=0; - setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors'); + setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } if (isset($_POST["code"])) { if ($_POST["code"]=='0') { $ok=0; - setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors'); + setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); } /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base { @@ -574,7 +578,7 @@ else { $ok=0; - setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); } } @@ -633,13 +637,13 @@ $result = $db->query($sql); if ($result) // Add is ok { - setEventMessage($langs->transnoentities("RecordSaved")); + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST=array('id'=>$id); // Clean $_POST array, we keep only } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } else { dol_print_error($db); @@ -683,7 +687,7 @@ $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->error(),'errors'); + setEventMessage($db->error(), 'errors'); } } //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition @@ -707,7 +711,7 @@ { if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } else { diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 04a46071142c3..a2b5a24c82aa3 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -61,7 +61,7 @@ } $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 9710929ee1796..555badf11d82d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -65,9 +65,9 @@ if (isset($res)) { if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -77,9 +77,9 @@ $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') @@ -88,9 +88,9 @@ $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } else if ($action == 'specimen') @@ -127,13 +127,13 @@ } else { - setEventMessage($module->error, 'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -158,12 +158,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index f1b5eeb142788..5c8fa9732e49b 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -60,11 +60,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -102,13 +102,13 @@ } else { - setEventMessage($obj->error,'errors'); - dol_syslog($obj->error, LOG_ERR); + setEventMessages($module->error, $module->errors,'errors'); + dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -133,12 +133,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,11 +214,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -244,7 +244,7 @@ // Interventions numbering model /* -print load_fiche_titre($langs->trans("FicheinterNumberingModules")); +print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'',''); print '
'.$langs->trans("Parameter").'
'; print ''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 07b00e5133ff3..dee1789d6ec3f 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -69,11 +69,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -111,13 +111,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -139,11 +139,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -200,11 +200,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -218,11 +218,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -236,11 +236,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -254,11 +254,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -272,11 +272,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -302,7 +302,7 @@ * Numbering module */ -print load_fiche_titre($langs->trans("BillsNumberingModule")); +print load_fiche_titre($langs->trans("BillsNumberingModule"),'',''); print '
'; print ''; @@ -471,7 +471,7 @@ * Document templates generators */ print '
'; -print load_fiche_titre($langs->trans("BillsPDFModules")); +print load_fiche_titre($langs->trans("BillsPDFModules"),'',''); // Load array def with activated templates $type='invoice'; @@ -631,7 +631,7 @@ * Modes de reglement */ print '
'; -print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice")); +print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); print ''; print ''; @@ -726,7 +726,7 @@ print "
"; -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; @@ -805,7 +805,7 @@ * Repertoire */ print '
'; -print load_fiche_titre($langs->trans("PathToDocuments")); +print load_fiche_titre($langs->trans("PathToDocuments"),'',''); print '
'."\n"; print ''."\n"; @@ -823,7 +823,7 @@ * Notifications */ print '
'; -print load_fiche_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications"),'',''); print '
'; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index b605da7e07b6f..b5bd4d045f69e 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -121,11 +121,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -143,7 +143,7 @@ if (empty($conf->use_javascript_ajax)) { - setEventMessage(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors'); + setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); } else { diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 865945e2e5b9c..103ba462607ea 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -60,11 +60,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -102,13 +102,13 @@ } else { - setEventMessage($obj->error,'errors'); - dol_syslog($obj->error, LOG_ERR); + setEventMessages($module->error, $module->errors, 'errors'); + dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -133,12 +133,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -192,11 +192,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -209,11 +209,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -226,11 +226,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -255,7 +255,7 @@ // Interventions numbering model -print load_fiche_titre($langs->trans("FicheinterNumberingModules")); +print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'',''); print '
'.$langs->trans("Parameter").'
'; print ''; @@ -357,7 +357,7 @@ * Documents models for Interventions */ -print load_fiche_titre($langs->trans("TemplatePDFInterventions")); +print load_fiche_titre($langs->trans("TemplatePDFInterventions"),'',''); // Defini tableau def des modeles $type='ficheinter'; @@ -511,7 +511,7 @@ * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; print ''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 5e4c9de6fd7d5..b4d379e15d13c 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -46,7 +46,7 @@ if (! $gimcdf && ! file_exists($gimcdf)) { - setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors'); + setEventMessages($langs->trans("ErrorFileNotFound",$gimcdf), null, 'errors'); $error++; } @@ -57,11 +57,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } } diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8d93dfc950cd1..6907e30f9795f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -37,6 +37,7 @@ $langs->load("products"); $langs->load("members"); $langs->load("projects"); +$langs->load("hrm"); if (! $user->admin) accessforbidden(); @@ -46,17 +47,21 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT); -$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name'); - +$searchform=array(); +if (empty($conf->use_javascript_ajax)) +{ + $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); + $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); + $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users")); + $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name'); +} 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); @@ -76,13 +81,16 @@ 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); + /* 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); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity); - + dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'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); @@ -161,19 +169,22 @@ print '
'; // Liste des zone de recherche permanantes supportees - print '
'.$langs->trans("Parameter").'
'; - print ''; - $var=True; - foreach ($searchform as $key => $value) + if (! empty($searchform)) { - $var=!$var; - print ''; + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; - print $form->selectyesno($searchform[$key],$searchformconst[$key],1); - print '
'; + print ''; + $var=True; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; + print $form->selectyesno($searchform[$key],$searchformconst[$key],1); + print '
'; + print '
'; } - print '
'; - print '
'; - + // Other print ''; print ''; @@ -204,6 +215,12 @@ print ''; print ''; + // Max size of short lists on customer card + $var=!$var; + print ''; + print ''; + print ''; + // Disable javascript and ajax $var=!$var; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("DefaultMaxSizeShortList").' 
'.$langs->trans("DisableJavascript").''; @@ -348,20 +365,23 @@ print '
'; - // Liste des zone de recherches permanentes supportees - print ''; - print ''; - $var=true; - foreach ($searchform as $key => $value) + // List of search forms to show + if (! empty($searchform)) { - $var=!$var; - print ''; - print ''; + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); - print '
'; + print ''; + $var=true; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''; + if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print '
'; + print '
'; } - print '
'; - print '
'; - // Other $var=true; @@ -385,6 +405,11 @@ print '
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . ' 
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ' 
'; print ''; @@ -340,7 +340,7 @@ * Documents Models for delivery */ print '
'; -print load_fiche_titre($langs->trans("DeliveryOrderModel")); +print load_fiche_titre($langs->trans("DeliveryOrderModel"),'',''); // Defini tableau def de modele $type="delivery"; @@ -487,7 +487,7 @@ * Autres Options */ print "
"; -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index a966b75195580..1cc55bd5a366c 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -61,11 +61,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 8c4769780fdc1..541c8aa1b2d90 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -64,12 +64,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 686da7fc68c39..27d7b59553a6b 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -65,11 +65,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -99,7 +99,7 @@ if (! isValidEmail($email)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email),'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } else { @@ -118,11 +118,11 @@ if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanCreationSuccess")); + setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } if ($action == 'testunsubscribe') @@ -131,11 +131,11 @@ if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanDeletionSuccess")); + setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } } @@ -156,12 +156,15 @@ $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $var=true; if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { + print ''; + + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -200,21 +203,30 @@ }); '; - form_constantes($constantes,1); - + form_constantes($constantes,2); + print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=img_$langs->trans("Activate") $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + + dol_fiche_end(); } -dol_fiche_end(); if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 654d85b572b6c..271605830bc7a 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -123,7 +123,7 @@ $result = dol_delete_file($pathtodelete,1); if ($result) { - setEventMessage($langs->trans("FileWasRemoved"), $filetodelete); + setEventMessages(array($langs->trans("FileWasRemoved"), $filetodelete), null, 'mesgs'); include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -169,19 +169,19 @@ if (empty($_POST["frommail"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")), null, 'errors'); $action='test'; $error++; } if (empty($sendto)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTo")), null, 'errors'); $action='test'; $error++; } if (! $error) { - // Le message est-il en html + // Is the message in HTML? $msgishtml=0; // Message is not HTML if ($action == 'sendhtml') $msgishtml=1; // Force message to HTML @@ -209,11 +209,11 @@ if ($result) { - setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2))); + setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)), null, 'mesgs'); } else { - setEventMessage($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result,'errors'); + setEventMessages($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result, null, 'errors'); } $action=''; @@ -677,7 +677,7 @@ function initfields() $errormsg .= ' - '.$mail->error; } - setEventMessage($errormsg, 'errors'); + setEventMessages($errormsg, null, 'errors'); } print '
'; } diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index c0ac9a3df8c19..f8b89c515aa58 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -102,8 +102,7 @@ else { $error++; - //TODO: Translate - setEventMessage('Failed to initialize menu '.$key.'.', 'errors'); + setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 7c22a17c553ce..b7f4b8d5b73c8 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -78,16 +78,16 @@ $result=$menu->update($user); if ($result > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } $_GET["menuId"] = $_POST['menuId']; $action = "edit"; @@ -135,37 +135,37 @@ $error=0; if (! $error && ! $_POST['menu_handler']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MenuHandler")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['type']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['url']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Url")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['titre']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); $action = 'create'; $error++; } if (! $error && $_POST['menuId'] && $_POST['type'] == 'top') { - setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors'); + setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors'); $action = 'create'; $error++; } if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left') { - setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors'); + setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; $error++; } @@ -204,7 +204,7 @@ else { $action = 'create'; - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } } @@ -222,7 +222,7 @@ $this->db->commit(); llxHeader(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); llxFooter(); exit ; } diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index c8699209268ab..7da0673b196f1 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -186,7 +186,7 @@ { $db->commit(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); exit ; @@ -359,7 +359,7 @@ else { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors'); + setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); } print '
'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index cf974990f01db..14c95aa0d2e94 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -43,6 +43,21 @@ $specialtostring=array(0=>'common', 1=>'interfaces', 2=>'other', 3=>'functional', 4=>'marketplace'); +$familyinfo=array( + 'hr'=>array('position'=>'001', 'label'=>$langs->trans("ModuleFamilyHr")), + 'crm'=>array('position'=>'006', 'label'=>$langs->trans("ModuleFamilyCrm")), + 'financial'=>array('position'=>'009', 'label'=>$langs->trans("ModuleFamilyFinancial")), + 'products'=>array('position'=>'012', 'label'=>$langs->trans("ModuleFamilyProducts")), + 'projects'=>array('position'=>'015', 'label'=>$langs->trans("ModuleFamilyProjects")), + 'ecm'=>array('position'=>'018', 'label'=>$langs->trans("ModuleFamilyECM")), + 'technic'=>array('position'=>'021', 'label'=>$langs->trans("ModuleFamilyTechnic")), + 'portal'=>array('position'=>'040', 'label'=>$langs->trans("ModuleFamilyPortal")), + 'interface'=>array('position'=>'050', 'label'=>$langs->trans("ModuleFamilyInterface")), + 'base'=>array('position'=>'060', 'label'=>$langs->trans("ModuleFamilyBase")), + 'other'=>array('position'=>'100', 'label'=>$langs->trans("ModuleFamilyOther")), +); + + /* * Actions @@ -51,7 +66,7 @@ if ($action == 'set' && $user->admin) { $result=activateModule($value); - if ($result) setEventMessage($result, 'errors'); + if ($result) setEventMessages($result, null, 'errors'); header("Location: modules.php?mode=".$mode); exit; } @@ -59,7 +74,7 @@ if ($action == 'reset' && $user->admin) { $result=unActivateModule($value); - if ($result) setEventMessage($result, 'errors'); + if ($result) setEventMessages($result, null, 'errors'); header("Location: modules.php?mode=".$mode); exit; } @@ -110,7 +125,7 @@ if (! empty($modNameLoaded[$modName])) { $mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.
"; - setEventMessage($mesg, 'warnings'); + setEventMessages($mesg, null, 'warnings'); dol_syslog($mesg, LOG_ERR); continue; } @@ -124,22 +139,20 @@ $objMod = new $modName($db); $modNameLoaded[$modName]=$dir; - if ($objMod->numero > 0) - { - $j = $objMod->numero; - } - else + if (! $objMod->numero > 0) { - $j = 1000 + $i; + dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR); } - + $j = $objMod->numero; + $modulequalified=1; // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; - // We discard modules according to property disabled + if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0; + // We discard modules according to property disabled if (! empty($objMod->hidden)) $modulequalified=false; // Define array $categ with categ with at least one qualified module @@ -147,13 +160,19 @@ { $modules[$i] = $objMod; $filename[$i]= $modName; - $orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number + + $special = $objMod->special; + $familykey = $objMod->family; + + if ($special == 1) $familykey='interface'; + + $orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$j; // Sort by family, then by module number $dirmod[$i] = $dir; // Set categ[$i] - $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; - if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev'; - if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories - else $categ[$special]=1; + $specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown'; + if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev'; + if (isset($categ[$specialstring])) $categ[$specialstring]++; // Array of all different modules categories + else $categ[$specialstring]=1; $j++; $i++; } @@ -197,9 +216,9 @@ // Start to show page if (empty($mode)) $mode='common'; if ($mode==='common') print $langs->trans("ModulesDesc")."
\n"; -if ($mode==='other') print $langs->trans("ModulesSpecialDesc")."
\n"; -if ($mode==='interfaces') print $langs->trans("ModulesInterfaceDesc")."
\n"; -if ($mode==='functional') print $langs->trans("ModulesJobDesc")."
\n"; +//if ($mode==='other') print $langs->trans("ModulesSpecialDesc")."
\n"; +//if ($mode==='interfaces') print $langs->trans("ModulesInterfaceDesc")."
\n"; +//if ($mode==='functional') print $langs->trans("ModulesJobDesc")."
\n"; if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
\n"; if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."
\n"; @@ -213,11 +232,12 @@ if (! empty($categ[$categidx])) { $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; - $head[$h][1] = $langs->trans("ModulesCommon"); + $head[$h][1] = $langs->trans("AvailableModules"); $head[$h][2] = 'common'; $h++; } +/* $categidx='other'; // Other if (! empty($categ[$categidx])) { @@ -244,6 +264,7 @@ $head[$h][2] = 'functional'; $h++; } +*/ $categidx='expdev'; if (! empty($categ[$categidx])) @@ -287,28 +308,19 @@ $oldfamily=''; - $familylib=array( - 'base'=>$langs->trans("ModuleFamilyBase"), - 'crm'=>$langs->trans("ModuleFamilyCrm"), - 'products'=>$langs->trans("ModuleFamilyProducts"), - 'hr'=>$langs->trans("ModuleFamilyHr"), - 'projects'=>$langs->trans("ModuleFamilyProjects"), - 'financial'=>$langs->trans("ModuleFamilyFinancial"), - 'ecm'=>$langs->trans("ModuleFamilyECM"), - 'technic'=>$langs->trans("ModuleFamilyTechnic"), - 'other'=>$langs->trans("ModuleFamilyOther") - ); - foreach ($orders as $key => $value) { $tab=explode('_',$value); - $family=$tab[0]; $numero=$tab[1]; + $familypos=$tab[0]; $familykey=$tab[1]; $numero=$tab[2]; $modName = $filename[$key]; $objMod = $modules[$key]; + $special = $objMod->special; + //print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."
"; - if (($mode != (isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown') && $mode != 'expdev') + //if (($mode != (isset($specialtostring[$special])?$specialtostring[$special]:'unknown') && $mode != 'expdev') + if (($special >= 4 && $mode != 'expdev') || ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental')) continue; // Discard if not for current tab if (! $objMod->getName()) @@ -329,28 +341,27 @@ } // Print a separator if we change family - //print ""; - //if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { - if ($family!=$oldfamily) + //print ""; + //if ($oldfamily && $familykey!=$oldfamily && $atleastoneforfamily) { + if ($familykey!=$oldfamily) { print ''."\n"; print '\n"; print ''."\n"; print "\n"; $atleastoneforfamily=0; - //print ""; + //print ""; } $atleastoneforfamily++; - if ($family!=$oldfamily) + if ($familykey!=$oldfamily) { - $familytext=empty($familylib[$family])?$family:$familylib[$family]; - //print $familytext; - $oldfamily=$family; + $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; + $oldfamily=$familykey; } $var=!$var; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index fca545e83cd14..a7699db429209 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -93,13 +93,13 @@ { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -132,10 +132,12 @@ print "\n"; $var=!$var; print ''; +print ''; +print ''; +print ''; print '
xx".$oldfamily."-".$family."-".$atleastoneforfamily."
xx".$oldfamily."-".$familykey."-".$atleastoneforfamily."
'; - $familytext=empty($familylib[$family])?$family:$familylib[$family]; + $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; print $familytext; print "'.$langs->trans("SetupShort").'
yy".$oldfamily."-".$family."-".$atleastoneforfamily."
yy".$oldfamily."-".$familykey."-".$atleastoneforfamily."
'; -print $langs->trans("NotificationEMailFrom").''; +print $langs->trans("NotificationEMailFrom").''; print ''; if (! empty($conf->global->NOTIFICATION_EMAIL_FROM) && ! isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) print ' '.img_warning($langs->trans("ErrorBadEMail")); -print '
'; print '
'; @@ -150,8 +152,7 @@ print ''.$langs->trans("Module").''; print ''.$langs->trans("Code").''; print ''.$langs->trans("Label").''; - print ''.$langs->trans("NbOfTargetedContacts").''; - print ''.''; + //print ''.$langs->trans("NbOfTargetedContacts").''; print "\n"; // Load array of available notifications @@ -173,10 +174,10 @@ print ''.$elementLabel.''; print ''.$notifiedevent['code'].''; print ''.$label.''; - print ''; + /*print ''; $tmparray = $notify->getNotificationsArray($notifiedevent['code'], 0); print count($tmparray); - print ''; + print '';*/ print ''; } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 1bf794d52f8b3..c9bf610bd1ba2 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -54,11 +54,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 56aa69e9943f5..f2d8c2d84dccb 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -81,12 +81,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index b9242bd0c4eec..b4f1fe67e0b60 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -59,11 +59,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,13 +101,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -121,11 +121,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -139,11 +139,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -155,11 +155,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -171,11 +171,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -199,12 +199,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -270,7 +270,7 @@ /* * Module numerotation */ -print load_fiche_titre($langs->trans("ProposalsNumberingModules")); +print load_fiche_titre($langs->trans("ProposalsNumberingModules"),'',''); print ''; print ''; @@ -374,7 +374,7 @@ * Document templates generators */ -print load_fiche_titre($langs->trans("ProposalsPDFModules")); +print load_fiche_titre($langs->trans("ProposalsPDFModules"),'',''); // Load array def with activated templates $def = array(); @@ -536,7 +536,7 @@ * Other options * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); $var=true; print "
"; @@ -643,7 +643,7 @@ * Directory */ print '
'; -print load_fiche_titre($langs->trans("PathToDocuments")); +print load_fiche_titre($langs->trans("PathToDocuments"),'',''); print "
\n"; print "\n"; @@ -658,7 +658,7 @@ * Notifications */ -print load_fiche_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications"),'',''); print '
'; print ''; print ''; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 100da221ce6d5..080dafca744b1 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -44,12 +44,12 @@ { if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) { - setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); $error++; } if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) { - setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); $error++; } @@ -68,7 +68,7 @@ if (! $error) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } } diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index bb37e73fc88d6..58e85dbf8d359 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -60,11 +60,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -83,6 +83,8 @@ print ''; print ''; +dol_fiche_head(); + /* * Params */ @@ -109,10 +111,13 @@ print ''; -print ''; print "
'.$langs->trans("Parameter").'
\n"; -print '
'; +print ''; + +dol_fiche_end(); + +print '
'; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 397b16b129986..250a7426ff873 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -135,7 +135,7 @@ } else { - setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings'); + setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings'); } } else if ($action == 'disable_encryptdbpassconf') @@ -152,7 +152,7 @@ } else { - setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings'); + setEventMessages($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass), null, 'warnings'); } } diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index a7afaf0ef0a12..d1237a8c73441 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -86,7 +86,7 @@ $res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity); $res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity); $res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity); - if ($res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully")); + if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } @@ -97,8 +97,8 @@ $langs->load("other"); $file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $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'); Header('Location: '.$_SERVER["PHP_SELF"]); exit; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 6c040e8d6d636..cd84962107d85 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -76,7 +76,7 @@ { $res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity); $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity); - if ($res1 && $res2) setEventMessage($langs->trans("RecordModifiedSuccessfully")); + if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 4b7818ecadb87..604b426b800f6 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -88,25 +88,25 @@ if (! empty($formsms->error)) { - setEventMessage($formsms->error,'errors'); + setEventMessages($formsms->error, $formsms->errors, 'errors'); $action='test'; $error++; } if (empty($body)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors'); $action='test'; $error++; } if (empty($smsfrom) || ! str_replace('+','',$smsfrom)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors'); $action='test'; $error++; } if (empty($sendto) || ! str_replace('+','',$sendto)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors'); $action='test'; $error++; } @@ -123,11 +123,11 @@ if ($result) { - setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto)); + setEventMessages($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto), null, 'mesgs'); } else { - setEventMessage($langs->trans("ResultKo"),'errors'); + setEventMessages($langs->trans("ResultKo"), null, 'errors'); } $action=''; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index e46d9b8f5b7db..241062732a4ec 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -54,28 +54,30 @@ $constname=GETPOST("constname"); $constvalue=GETPOST("constvalue"); - if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; - if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice - { - if ($constvalue) $constvalue=0; - else $constvalue=1; - } - - if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; - $consttype=$_POST["consttype"]; - $constnote=GETPOST("constnote"); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - setEventMessage($langs->trans("SetupSaved")); - } - else - { - setEventMessage($langs->trans("Error"),'errors'); - } + // Action mise a jour ou ajout d'une constante + if ($action == 'update' || $action == 'add') + { + foreach($_POST['constname'] as $key => $val) + { + $constname=$_POST["constname"][$key]; + $constvalue=$_POST["constvalue"][$key]; + $consttype=$_POST["consttype"][$key]; + $constnote=$_POST["constnote"][$key]; + + $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + + if (! $res > 0) $error++; + } + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } } // Action activation d'un sous module du module adherent @@ -115,7 +117,6 @@ $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $var=true; @@ -124,6 +125,10 @@ */ if (! empty($conf->global->ADHERENT_USE_SPIP)) { + print '
'; + + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -139,21 +144,28 @@ print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); print '
'; - form_constantes($constantes); - print '
'; + + form_constantes($constantes,2); + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=$langs->trans("Activate"); $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); + + dol_fiche_end(); } - -dol_fiche_end(); - llxFooter(); $db->close(); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 2ed2f4f869eac..98ff43360a8d2 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -96,12 +96,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -141,58 +141,75 @@ $found=0; +$var=!$var; +print ""; +print ''.$langs->trans("DeStockOnBill").''; +print ''; if (! empty($conf->facture->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("DeStockOnBill").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")); +} +print "\n\n"; +$found++; +$var=!$var; +print ""; +print ''.$langs->trans("DeStockOnValidateOrder").''; +print ''; if (! empty($conf->commande->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("DeStockOnValidateOrder").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; +} +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")); } +print "\n\n"; +$found++; +//if (! empty($conf->expedition->enabled)) +//{ +$var=!$var; +print ""; +print ''.$langs->trans("DeStockOnShipment").''; +print ''; if (! empty($conf->expedition->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("DeStockOnShipment").''; - print ''; print "
"; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); +} +print "\n\n"; +$found++; -if (! $found) +/*if (! $found) { $var=!$var; print ""; - print ''.$langs->trans("NoModueToManageStockDecrease").''; + print ''.$langs->trans("NoModuleToManageStockDecrease").''; print "\n"; -} +}*/ print ''; @@ -208,57 +225,74 @@ $found=0; +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnBill").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnBill").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; +} +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } +print "\n\n"; +$found++; + +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnValidateOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnValidateOrder").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; +} +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } +print "\n\n"; +$found++; + +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnDispatchOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnDispatchOrder").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); +} +print "\n\n"; +$found++; -if (! $found) +/*if (! $found) { $var=!$var; print ""; print ''.$langs->trans("NoModueToManageStockIncrease").''; print "\n"; -} +}*/ print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 694247e7b81ef..c1b350edfee0c 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -63,11 +63,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -106,13 +106,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -174,11 +174,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -205,7 +205,7 @@ // Supplier invoice numbering module -print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel")); +print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"),'',''); print ''; print ''; @@ -311,7 +311,7 @@ * Modeles documents for supplier invoices */ -print load_fiche_titre($langs->trans("BillsPDFModules")); +print load_fiche_titre($langs->trans("BillsPDFModules"),'',''); // Defini tableau def de modele $def = array(); @@ -453,7 +453,7 @@ print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; print ''; @@ -487,7 +487,7 @@ * Notifications */ -print load_fiche_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications"),'',''); print '
'.$langs->trans("Parameter").'
'; print ''; print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 861e94c881bdf..bc25e8efa87d7 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -64,11 +64,11 @@ if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -107,13 +107,13 @@ } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -221,7 +221,7 @@ // Supplier order numbering module -print load_fiche_titre($langs->trans("OrdersNumberingModules")); +print load_fiche_titre($langs->trans("OrdersNumberingModules"),'',''); print '
'.$langs->trans("Parameter").'
'; print ''; @@ -325,7 +325,7 @@ * Documents models for supplier orders */ -print load_fiche_titre($langs->trans("OrdersModelModule")); +print load_fiche_titre($langs->trans("OrdersModelModule"),'',''); // Defini tableau def de modele $def = array(); @@ -464,7 +464,7 @@ print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"),'',''); print '
'; print ''; print ''; @@ -512,7 +512,7 @@ * Notifications */ -print load_fiche_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications"),'',''); print '
'.$langs->trans("Parameter").'
'; print ''; print ''; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 59921dd3687d6..f3cfcff9807ec 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -119,12 +119,12 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($error, 'errors'); + setEventMessages($error, $errors, 'errors'); } @@ -140,11 +140,11 @@ if (! $res > 0) $error++; if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 737e0712ea623..e9d3f96ad555a 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -25,11 +25,15 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; $langs->load("admin"); $langs->load("help"); $langs->load("members"); +$youuselaststable = 0; + /* * View @@ -42,9 +46,54 @@ print '
'.img_picto_common('', 'dolibarr_box.png','height="120"').'
'; + + +print '
'; + print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':'; print '
    '; -print '
  • '.DOL_VERSION.' / GNU-GPL v3+
  • '; +print '
  • '.DOL_VERSION.''; + +$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); +//var_dump($result['content']); +$sfurl = simplexml_load_string($result['content']); +if ($sfurl) +{ + $title=$sfurl->channel[0]->item[0]->title; + + function word_limiter($text, $limit = 30, $chars = '0123456789.') + { + if (strlen( $text ) > $limit) + { + $words = str_word_count($text, 2, $chars); + $words = array_reverse($words, TRUE); + foreach($words as $length => $word) { + if ($length + strlen( $word ) >= $limit) + { + array_shift($words); + } else { + break; + } + } + $words = array_reverse($words); + $text = implode(" ", $words) . ''; + } + return $text; + } + + $str = word_limiter($title); + $str = preg_replace('/[^0-9\.]/', '', $str); + print ' ('.$langs->trans("LastStableVersion").': '.$str.''; + if (DOL_VERSION == $str) + { + $youuselaststable=1; + print $langs->trans("YouUseLastStableVersion"); + } + print ')'; + print ' / GNU-GPL v3+
  • '; +} + + print '
'; //print "
\n"; @@ -114,6 +163,9 @@ print ''; +print '
'; + + print $langs->trans("HelpCenter").':'; print '
    '; print '
  • '; @@ -122,6 +174,7 @@ print '
  • '; print '
'; + print $langs->trans("Foundation").':'; print '
    '; @@ -153,6 +206,33 @@ print '
'; +print '
'; +print '
'; +print '
'; + + +if ($youuselaststable) +{ + print '
'; + print '
'; + + $tmp=versiondolibarrarray(); + if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0)) + { + print $langs->trans("TitleExampleForMajorRelease").':
'; + print ''; + } + else + { + print $langs->trans("TitleExampleForMaintenanceRelease").':
'; + print ''; + } +} + llxFooter(); diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 36c2f66aa519c..b1ce8ef5dab7b 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -98,10 +98,10 @@ if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index a460f667e2a19..49d229898b8b6 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -52,8 +52,8 @@ { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - 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=''; } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 500c766ed770a..cddd42a862354 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -60,8 +60,8 @@ { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - 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=''; } @@ -357,7 +357,7 @@ //{ if ($errormsg) { - setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors'); + setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); $resultstring=''; $resultstring.='
'.$langs->trans("Error")." : ".$errormsg.'
'; @@ -368,7 +368,7 @@ { if ($what) { - setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile")); + setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs'); $resultstring='
'; $resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.
'; @@ -379,7 +379,7 @@ } else { - setEventMessage($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user)); + setEventMessages($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user), null, 'mesgs'); } } //} diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 54a6cab9cbd6b..e1166e96c3de4 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -34,7 +34,7 @@ if (! $user->admin) accessforbidden(); if (GETPOST('msg','alpha')) { - setEventMessage(GETPOST('msg','alpha'), 'errors'); + setEventMessages(GETPOST('msg','alpha'), null, 'errors'); } @@ -63,7 +63,7 @@ if (! $original_file) { $langs->load("Error"); - setEventMessage($langs->trans("ErrorFileRequired"), 'warnings'); + setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings'); $error++; } else @@ -71,7 +71,7 @@ if (! preg_match('/\.zip/i',$original_file)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors'); + setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); $error++; } } @@ -99,7 +99,7 @@ if (! empty($result['error'])) { $langs->load("errors"); - setEventMessage($langs->trans($result['error'],$original_file), 'errors'); + setEventMessages($langs->trans($result['error'],$original_file), null, 'errors'); $error++; } else @@ -116,7 +116,7 @@ //var_dump($modulenamedir); if (! dol_is_dir($modulenamedir)) { - setEventMessage($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), 'errors'); + setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); $error++; } } @@ -128,7 +128,7 @@ $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); if ($result <= 0) { - setEventMessage($langs->trans("ErrorFailedToCopy"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors'); $error++; } } @@ -142,7 +142,7 @@ if (! $error) { - setEventMessage($langs->trans("SetupIsReadyForUse")); + setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs'); } } diff --git a/htdocs/api/admin/index.html b/htdocs/api/admin/index.html new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/htdocs/api/admin/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/api/class/index.html b/htdocs/api/class/index.html new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/htdocs/api/class/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index ef4eaefe9c2da..e50a1a74a1bc9 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -73,5 +73,9 @@ dol_print_error($db,'Error'); $found = 'Error'; } +//Greek to Latin +$greek = array('α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω','ά','έ','ή','ί','ό','ύ','ώ','ϊ','ΐ','Ά','Έ','Ή','Ί','Ό','Ύ','Ώ','Ϊ'); -echo $found; +$latin = array('a','b','g','d','e','z','h','th','i','k','l','m','n','ks','o','p','r','s','s','t','u','f','ch','ps','w','A','B','G','D','E','Z','H','TH','I','K','L','M','N','KS','O','P','R','S','T','U','F','CH','PS','W','a','e','h','i','o','u','w','i','i','A','E','H','I','O','U','W','I'); + +print str_replace($greek, $latin, $found); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index e0f115e31c511..f168de78b6edc 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -112,6 +112,34 @@ function llxFooter() llxHeader(); +$sql = "SELECT s.nom as name FROM ".MAIN_DB_PREFIX."societe as s"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid"; +$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; +$sql.= " AND (s.phone='".$db->escape($called)."'"; +$sql.= " OR sp.phone='".$db->escape($called)."'"; +$sql.= " OR sp.phone_perso='".$db->escape($called)."'"; +$sql.= " OR sp.phone_mobile='".$db->escape($called)."')"; +$sql.= $db->plimit(1); + +dol_syslog('click to dial search information with phone '.$called, LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) +{ + $obj = $db->fetch_object($resql); + if ($obj) + { + $found = $obj->name; + } else { + $found = $notfound; + } + $db->free($resql); +} +else +{ + dol_print_error($db,'Error'); + $found = 'Error'; +} + $number=strtolower($called); $pos=strpos($number,"local"); if (! empty($number)) @@ -120,7 +148,7 @@ function llxFooter() { $errno=0; $errstr=0; - $strCallerId = "Dolibarr <".strtolower($caller).">"; + $strCallerId = "Dolibarr call $found <".strtolower($number).">"; $oSocket = @fsockopen($strHost, $port, $errno, $errstr, 10); if (!$oSocket) { diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 68673d9c83b53..f974bbec897b4 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -96,12 +96,12 @@ if (empty($forbarcode)) // barcode value { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("BarcodeValue")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeValue")), null, 'errors'); $error++; } if (empty($fk_barcode_type)) // barcode type = barcode encoding { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("BarcodeType")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeType")), null, 'errors'); $error++; } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 5bd73202f159e..f5921ac4d0626 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -140,7 +140,7 @@ if (! $object->label) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $action = 'create'; } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 933791db41d0a..46a48b31bf868 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -399,14 +399,13 @@ function update($user='') } else if ($reshook < 0) $error++; - $this->db->commit(); - - // Call trigger $result=$this->call_trigger('CATEGORY_MODIFY',$user); if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers + $this->db->commit(); + return 1; } else diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 836970e7a3c50..0a13c3e7fab0f 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -87,7 +87,7 @@ { $error++; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } if (! $error && empty($categorie->error)) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index daeab2ba40830..1f2f0c3b19ec2 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -191,14 +191,14 @@ { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors'); } // Initialisation objet cactioncomm @@ -206,7 +206,7 @@ { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } else { @@ -289,20 +289,20 @@ { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ActionsOwnedBy")), null, 'errors'); } if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent)))) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (! GETPOST('apyear') && ! GETPOST('adyear')) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } // Fill array 'array_options' with data from add form @@ -323,7 +323,7 @@ unset($_SESSION['assignedtouser']); $moreparam=''; - if ($user->id != $object->ownerid) $moreparam="usertodo=-1"; // We force to remove filter so created record is visible when going back to per user view. + if ($user->id != $object->userownerid) $moreparam="usertodo=-1"; // We force to remove filter so created record is visible when going back to per user view. $db->commit(); if (! empty($backtopage)) @@ -450,7 +450,7 @@ { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } else { @@ -460,7 +460,7 @@ { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ActionsOwnedBy")), null, 'errors'); } // Fill array 'array_options' with data from add form @@ -1304,7 +1304,16 @@ function init_repeat() print '

'.$langs->trans("Parameter").'
'; foreach($extrafields->attribute_label as $key=>$label) { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); + if (isset($_POST["options_" . $key])) { + if (is_array($_POST["options_" . $key])) { + // $_POST["options"] is an array but following code expects a comma separated string + $value = implode(",", $_POST["options_" . $key]); + } else { + $value = $_POST["options_" . $key]; + } + } else { + $value = $object->array_options["options_" . $key]; + } print '\n"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9b61da3e19651..acee9c383743e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -220,7 +220,7 @@ function add($user,$notrigger=0) $this->userassigned[$tmpid]=array('id'=>$tmpid); } - if (is_object($this->contact) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated + if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated $userownerid=$this->userownerid; diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php index 5821d721314c5..f57cb16e0e03c 100644 --- a/htdocs/comm/askpricesupplier/card.php +++ b/htdocs/comm/askpricesupplier/card.php @@ -219,7 +219,7 @@ $date_delivery = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action = 'create'; $error ++; } @@ -434,7 +434,7 @@ // Close proposal else if ($action == 'setstatut' && $user->rights->askpricesupplier->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -525,17 +525,17 @@ } 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 == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 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 ++; } @@ -783,7 +783,7 @@ // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } diff --git a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php index 971b53a3534dc..26d412e87eabd 100644 --- a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php +++ b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php @@ -1264,12 +1264,12 @@ function valid($user, $notrigger=0) $soc->fetch($this->socid); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); } else - { + { $num = $this->ref; } $this->newref = $num; diff --git a/htdocs/comm/askpricesupplier/list.php b/htdocs/comm/askpricesupplier/list.php index 2e78045b3085c..ae7ed58b29c49 100644 --- a/htdocs/comm/askpricesupplier/list.php +++ b/htdocs/comm/askpricesupplier/list.php @@ -242,7 +242,6 @@ print ''; $i = 0; - print '
'.$label.''; print $extrafields->showOutputField($key,$value); print "
'; $moreforfilter=''; @@ -250,25 +249,32 @@ if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); + $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='       '; + $moreforfilter.='
'; } // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { + $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; $moreforfilter.=$form->select_dolusers($search_user,'search_user',1); + $moreforfilter.='
'; } - if (! empty($moreforfilter)) - { - print ''; - print ''; - } - - print ''; + if (! empty($moreforfilter)) + { + print '
'; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; + } + + + print '
'; - print $moreforfilter; - print '
'; + print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AskPriceSupplierDate'),$_SERVER["PHP_SELF"],'p.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a916467671620..b874eeefde5ef 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -184,7 +184,7 @@ llxHeader('',$title,$help_url); - +/* if ($mode == 'search') { if ($modesearch == 'soc') @@ -209,7 +209,7 @@ $db->free($resql); } } - +*/ if ($id > 0) { @@ -218,17 +218,15 @@ dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"),0,'company'); + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + print '
'; - + print '
'; print '
'; - print ''; - // Alias name (commercial, trademark or alias name) - print '"; @@ -264,39 +262,6 @@ print ''; } - // Address - print '"; - - // Zip / Town - print ''; - print '"; - print ''; - - // Country - print ''; - - // EMail - print ''; - - // Web - print ''; - - // Phone - print ''; - - // Fax - print ''; - // Skype if (! empty($conf->skype->enabled)) { @@ -411,17 +376,6 @@ $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); - // display amount and link to unpaid bill - $outstandingBills = $object->get_OutstandingBill(); - print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency); - if ($object->outstanding_limit != '') - { - if ($outstandingBills > $object->outstanding_limit) - print img_warning($langs->trans("OutstandingBillReached")); - //print ' / ' . price($soc->outstanding_limit); - } - print ')'; print ''; print ''; @@ -526,14 +480,24 @@ // Nbre max d'elements des petites listes - $MAXLIST=4; - $tableaushown=1; + $MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT; // Lien recap + $outstandingBills = $object->get_OutstandingBill(); + $warn = ''; + if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingBills) + { + $warn = img_warning($langs->trans("OutstandingBillReached")); + } + print '
'.$langs->trans("ThirdPartyName").''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','',''); - print '
'.$langs->trans('AliasNameShort').''; + print '
'.$langs->trans('AliasNames').''; print $object->name_alias; print "
'.$langs->trans('Address').''; - dol_print_address($object->address,'gmap','thirdparty',$object->id); - print "
'.$langs->trans('Zip').' / '.$langs->trans('Town').''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town."
'.$langs->trans("Country").''; - if (! empty($object->country_code)) - { - //$img=picto_from_langcode($object->country_code); - $img=''; - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; - } - print '
'.$langs->trans('EMail').''.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'
'.$langs->trans("Web").''.dol_print_url($object->url,'_blank').'
'.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print '
'; - print '
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'.$langs->trans("CurrentOutstandingBill").''.price($outstandingBills).$warn.'
'; print '
'; @@ -719,7 +683,6 @@ if ($num > 0) { print ''; - $tableaushown=1; print ''; print ''; + + // Employee + print ''; + print ''; // Position/Job @@ -1190,60 +1156,24 @@ { dol_fiche_head($head, 'user', $title, 0, 'user'); - $rowspan=19; - - print '
'; print ''; @@ -903,7 +866,6 @@ { print '
'.$langs->trans("LastSendings",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSendings").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; - $tableaushown=1; print ''; print ''; +print ''; -// Phone / Fax -print ''; -print ''; +dol_fiche_end(); -print '
'; print ''; @@ -1059,6 +1021,7 @@ // List of done actions show_actions_done($conf,$langs,$db,$object); } + } else { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 37e4ee61cedc9..86f48d1081741 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -32,6 +32,7 @@ if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! $user->rights->societe->lire) accessforbidden(); @@ -65,6 +66,7 @@ $companystatic=new Societe($db); if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db); if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db); +if (! empty($conf->fournisseur->enabled)) $supplierorderstatic=new CommandeFournisseur($db); llxHeader(); @@ -75,89 +77,58 @@ // Search proposal if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { - $var=false; - print ''; - print ''; - print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchAProposal").'
:
:
\n"; - print "
\n"; + $listofsearchfields['search_proposal']=array('text'=>'Proposal'); } - // Search customer order if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { - $var=false; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchACustomerOrder").'
'; - print ':
:

\n"; + $listofsearchfields['search_customer_order']=array('text'=>'CustomerOrder'); } - // Search supplier order if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) { - $var=false; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchASupplierOrder").'
'; - print ':
:

\n"; + $listofsearchfields['search_supplier_order']=array('text'=>'SupplierOrder'); +} +// Search intervention +if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) +{ + $listofsearchfields['search_intervention']=array('text'=>'Intervention'); } - // Search contract if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $var=false; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchAContract").'
:
:
\n"; - print "
"; + $listofsearchfields['search_contract']=array('text'=>'Contrat'); } -// Search contract -if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) +if (count($listofsearchfields)) { - $var=false; - print '
'; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchAnIntervention").'
:
:
\n"; - print "
"; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
'.$langs->trans("Search").'
:
'; + print ''; + print '
'; } + + /* * Draft proposals */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { + $langs->load("propal"); + $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -172,12 +143,13 @@ $resql=$db->query($sql); if ($resql) { + $total = 0; + $num = $db->num_rows($resql); + print ''; print ''; - print ''; + print ''; - $total = 0; - $num = $db->num_rows($resql); if ($num > 0) { $i = 0; @@ -214,6 +186,10 @@ print '"; } } + else + { + print ''; + } print "
'.$langs->trans("ProposalsDraft").'
'.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoProposal").'

"; $db->free($resql); @@ -246,12 +222,13 @@ $resql = $db->query($sql); if ($resql) { + $total = 0; + $num = $db->num_rows($resql); + print ''; print ''; - print ''; + print ''; - $total = 0; - $num = $db->num_rows($resql); if ($num) { $i = 0; @@ -288,10 +265,96 @@ print '"; } } + else + { + print ''; + } print "
'.$langs->trans("DraftOrders").'
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoOrder").'

"; $db->free($resql); } + else + { + dol_print_error($db); + } +} + + +/* + * Draft suppliers orders + */ +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) +{ + $langs->load("orders"); + + $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; + $sql.= ", s.code_client"; + $sql.= ", s.code_fournisseur"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE cf.fk_soc = s.rowid"; + $sql.= " AND cf.fk_statut = 0"; + $sql.= " AND cf.entity IN (".getEntity('supplier_order', 1).")"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND cf.fk_soc = ".$socid; + + $resql = $db->query($sql); + if ($resql) + { + $total = 0; + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; + + if ($num) + { + $i = 0; + $var = true; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + $i++; + $total += $obj->total_ttc; + } + if ($total>0) + { + $var=!$var; + print '"; + } + } + else + { + print ''; + } + print "
'.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').'
'; + $supplierorderstatic->id=$obj->rowid; + $supplierorderstatic->ref=$obj->ref; + $supplierorderstatic->ref_supplier=$obj->ref_suppliert; + $supplierorderstatic->total_ht = $obj->total_ht; + $supplierorderstatic->total_tva = $obj->total_tva; + $supplierorderstatic->total_ttc = $obj->total_ttc; + print $supplierorderstatic->getNomUrl(1); + print ''; + $companystatic->id=$obj->socid; + $companystatic->name=$obj->name; + $companystatic->client=$obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1,'customer',16); + print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoSupplierOrder").'

"; + + $db->free($resql); + } else { + dol_print_error($db); + } } @@ -329,7 +392,11 @@ print ''; print ''; - print ''; + print ''; print ''; print ''; if ($num) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php deleted file mode 100644 index 91f30d30887f5..0000000000000 --- a/htdocs/comm/list.php +++ /dev/null @@ -1,345 +0,0 @@ - - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013-2015 Florian Henry - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Marcos García - * - * This program is freei software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/comm/list.php - * \ingroup commercial societe - * \brief List of customers - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -$langs->load("companies"); -$langs->load("customers"); -$langs->load("suppliers"); -$langs->load("commercial"); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user,'societe',$socid,''); - -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page=GETPOST('page','int'); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; - -$search_company = GETPOST("search_company"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_code = GETPOST("search_code"); -$search_compta = GETPOST("search_compta"); -$search_status = GETPOST("search_status",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); -$optioncss = GETPOST('optioncss','alpha'); - -// Load sale and categ filters -$search_sale = GETPOST("search_sale",'int'); -$search_categ = GETPOST("search_categ",'int'); -$catid = GETPOST("catid",'int'); -// If the internal user must only see his customers, force searching by him -if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('customerlist')); -$extrafields = new ExtraFields($db); - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $search_sale=""; - $search_categ=""; - $catid=""; - $search_company=""; - $search_zipcode=""; - $search_town=""; - $search_code=''; - $search_compta=''; - $search_status=''; - $search_country=""; - $search_type_thirdparty=''; -} - -if ($search_status=='') $search_status=1; // always display activ customer first - - -/* - * view - */ - -$formother=new FormOther($db); -$form = new Form($db); -$thirdpartystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - -$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; -$sql.= " s.datec, s.canvas"; -$sql.= ",s.fk_pays"; -$sql.= ",typent.code as typent_code"; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) -// Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale -$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.client IN (1, 3)"; -$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale -if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_company) $sql.= natural_search(array('s.nom', 's.name_alias'), $search_company); -if ($search_zipcode) $sql.= natural_search("s.zip", $search_zipcode); -if ($search_town) $sql.= natural_search('s.town', $search_town); -if ($search_code) $sql.= natural_search("s.code_client", $search_code); -if ($search_compta) $sql.= natural_search("s.code_compta", $search_compta); -if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status); -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -if ($search_sale > 0) $sql.= " AND sc.fk_user = ".$search_sale; -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; - -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} - -$sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($conf->liste_limit +1, $offset); - -dol_syslog('comm/list.php:', LOG_DEBUG); -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - - $param = "&search_company=".htmlspecialchars($search_company); - $param.="&search_code=".htmlspecialchars($search_code); - $param.="&search_zipcode=".htmlspecialchars($search_zipcode); - $param.="&search_town=".htmlspecialchars($search_town); - if ($search_categ != '') $param.='&search_categ='.htmlspecialchars($search_categ); - if ($search_sale > 0) $param.='&search_sale='.htmlspecialchars($search_sale); - if ($search_status != '') $param.='&search_status='.htmlspecialchars($search_status); - if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png'); - - $i = 0; - - print '
'."\n"; - if ($optioncss != '') print ''; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); - $moreforfilter.='       '; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - } - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print '
'.$langs->trans("BoxTitleLastCustomersOrProspects",$max).''; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max); + else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max); + else print $langs->trans("BoxTitleLastModifiedCustomers",$max); + print ''.$langs->trans("DateModificationShort").'
'."\n"; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder); - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print ''."\n"; - - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($result); - - $var=!$var; - - print ""; - print ''; - print ''; - print ''; - //Country - print ''; - //Type ent - print ''; - print ''; - print ''; - print ''; - - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - $db->free($result); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print "
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->select_country($search_country,'search_country'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - print ''; - print ''; - print ' '; - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print '
'; - $thirdpartystatic->id=$obj->rowid; - $thirdpartystatic->name=$obj->name; - $thirdpartystatic->client=$obj->client; - $thirdpartystatic->code_client=$obj->code_client; - $thirdpartystatic->canvas=$obj->canvas; - $thirdpartystatic->status=$obj->status; - $thirdpartystatic->name_alias=$obj->name_alias; - print $thirdpartystatic->getNomUrl(1); - print ''.$obj->zip.''.$obj->town.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.$obj->code_client.''.$obj->code_compta.''.dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3); - print '
\n"; - print "\n"; -} -else -{ - dol_print_error($db); -} - -llxFooter(); -$db->close(); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index fde56efb25ee3..8ab7fc9123307 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -403,7 +403,7 @@ $object->sendto = $_POST["sendto"]; if (! $object->sendto) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("MailTo")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("MailTo")), null, 'errors'); $error++; } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 974ef427c29bc..08d4e31ec6b28 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -129,7 +129,7 @@ // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') { - if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) + if (! GETPOST('socid', 3)) { setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); } @@ -141,7 +141,7 @@ header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result); exit(); } else { - setEventMessage($object->error, 'errors'); + if (count($object->errors) > 0) setEventMessage($object->errors, 'errors'); $action = ''; } } @@ -222,7 +222,7 @@ if (empty($datep)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) { @@ -267,18 +267,19 @@ $duration = GETPOST('duree_validite'); if (empty($datep)) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; $error ++; } if (empty($duration)) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ValidityDuration")), null, 'errors'); $action = 'create'; $error ++; } if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); + $action = 'create'; $error ++; } @@ -575,7 +576,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -621,7 +622,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -710,17 +711,17 @@ } 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 == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 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 ++; } @@ -999,7 +1000,7 @@ // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } @@ -2180,7 +2181,7 @@ } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES)) + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { print ''; } diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 87281e7ea6321..cdeacefafe189 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -47,8 +47,9 @@ * View Mode */ -llxHeader(); +$form = new Form($db); +llxHeader(); if ($id > 0 || ! empty($ref)) { @@ -68,10 +69,12 @@ */ print ''; - // Ref - print ''; - print ''; - print ''; + $linkback = '' . $langs->trans("BackToList") . ''; + + // Ref + print ''; // Ref client print ''; @@ -144,7 +147,7 @@ print "
'.$langs->trans('Ref').''.$object->ref.'
' . $langs->trans('Ref') . ''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
'.$langs->trans('RefCustomer').'
\n"; // Conversion du PDF en image png si fichier png non existant - if (! file_exists($fileimage) && ! file_exists($fileimagebis)) + if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) { if (class_exists("Imagick")) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d18620c9de5c3..4d632a84c54aa 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -438,7 +438,8 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0 $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, '', $localtaxes_type); + $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]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -1039,7 +1040,7 @@ function createFromClone($socid=0) { global $db, $user,$langs,$conf,$hookmanager; - dol_include_once('/projet/class.project.class.php'); + dol_include_once('/projet/class/project.class.php'); $this->context['createfromclone']='createfromclone'; @@ -1052,44 +1053,42 @@ function createFromClone($socid=0) foreach($this->lines as $line) $line->fetch_optionals($line->rowid); - // Load source object - $objFrom = clone $this; + // Load dest object + $clonedObj = clone $this; $objsoc=new Societe($this->db); // Change socid if needed - if (! empty($socid) && $socid != $this->socid) + if (! empty($socid) && $socid != $clonedObj->socid) { if ($objsoc->fetch($socid) > 0) { - $this->socid = $objsoc->id; - $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - - $project = new Project($db); - - if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) { - if($project->socid <= 0) $this->fk_project = $objFrom->fk_project; - else $this->fk_project = ''; + $clonedObj->socid = $objsoc->id; + $clonedObj->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + $clonedObj->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + $clonedObj->fk_delivery_address = ''; + + $project = new Project($db); + if ($this->fk_project > 0 && $project->fetch($this->fk_project)) { + if ($project->socid <= 0) $clonedObj->fk_project = $this->fk_project; + else $clonedObj->fk_project = ''; } else { - $this->fk_project = ''; + $clonedObj->fk_project = ''; } - - $this->fk_delivery_address = ''; } // reset ref_client - $this->ref_client = ''; + $clonedObj->ref_client = ''; // TODO Change product price if multi-prices } else { - $objsoc->fetch($this->socid); + $objsoc->fetch($clonedObj->socid); } - $this->id=0; - $this->statut=self::STATUS_DRAFT; + $clonedObj->id=0; + $clonedObj->statut=self::STATUS_DRAFT; if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { @@ -1098,32 +1097,32 @@ function createFromClone($socid=0) } // Clear fields - $this->user_author = $user->id; - $this->user_valid = ''; - $this->date = $now; - $this->datep = $now; // deprecated - $this->fin_validite = $this->date + ($this->duree_validite * 24 * 3600); - if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $this->ref_client = ''; + $clonedObj->user_author = $user->id; + $clonedObj->user_valid = ''; + $clonedObj->date = $now; + $clonedObj->datep = $now; // deprecated + $clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600); + if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = ''; // Set ref require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php'; $obj = $conf->global->PROPALE_ADDON; $modPropale = new $obj; - $this->ref = $modPropale->getNextValue($objsoc,$this); + $clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj); // Create clone - $result=$this->create($user); + $result=$clonedObj->create($user); if ($result < 0) $error++; else { // copy internal contacts - if ($this->copy_linked_contact($objFrom, 'internal') < 0) + if ($clonedObj->copy_linked_contact($this, 'internal') < 0) $error++; // copy external contacts if same company - elseif ($objFrom->socid == $this->socid) + elseif ($this->socid == $clonedObj->socid) { - if ($this->copy_linked_contact($objFrom, 'external') < 0) + if ($clonedObj->copy_linked_contact($this, 'external') < 0) $error++; } } @@ -1133,9 +1132,9 @@ function createFromClone($socid=0) // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters=array('objFrom'=>$objFrom); + $parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj); $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$clonedObj,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } @@ -1151,7 +1150,7 @@ function createFromClone($socid=0) if (! $error) { $this->db->commit(); - return $this->id; + return $clonedObj->id; } else { @@ -1457,12 +1456,12 @@ function valid($user, $notrigger=0) $soc->fetch($this->socid); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); } else - { + { $num = $this->ref; } $this->newref = $num; @@ -2100,26 +2099,26 @@ function InvoiceArrayList($id) $this->fetchObjectLinked($id,$this->element); foreach($this->linkedObjectsIds as $objecttype => $objectid) { - $numi=count($objectid); - for ($i=0;$i<$numi;$i++) + // Nouveau système du comon object renvoi des rowid et non un id linéaire de 1 à n + // On parcourt donc une liste d'objets en tant qu'objet unique + foreach($objectid as $key => $object) { // Cas des factures liees directement if ($objecttype == 'facture') { - $linkedInvoices[] = $objectid[$i]; + $linkedInvoices[] = $object; } // Cas des factures liees par un autre objet (ex: commande) else { - $this->fetchObjectLinked($objectid[$i],$objecttype); + $this->fetchObjectLinked($object,$objecttype); foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) { - $numj=count($subobjectid); - for ($j=0;$j<$numj;$j++) + foreach($subobjectid as $subkey => $subobject) { if ($subobjecttype == 'facture') { - $linkedInvoices[] = $subobjectid[$j]; + $linkedInvoices[] = $subobject; } } } diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 1bcbec9723d6b..4b03cb48429af 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -66,11 +66,9 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +print $langs->trans("Proposal").':'; print "
'.$langs->trans("SearchPropal").'
'.$langs->trans("Search").'
'; -print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index f595ad8aec0d4..c623069cd8535 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -108,6 +108,15 @@ // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('propallist')); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.ref'=>'Ref', + 'p.ref_client'=>'CustomerRef', + 'pd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'p.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate"; /* @@ -192,7 +201,7 @@ $sql.= natural_search("p.total_ht", $search_montant_ht, 1); } if ($sall) { - $sql .= natural_search(array('s.nom', 'p.note_private', 'p.note_public', 'pd.description'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; @@ -262,10 +271,20 @@ // Lignes des champs de filtre print '
'; - if ($optioncss != '') print ''; - + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + //sort($fieldstosearchall); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + $i = 0; - print ''; $moreforfilter=''; @@ -298,12 +317,13 @@ } if (! empty($moreforfilter)) { - print ''; - print ''; + print ''; } + print '
'; + print '
'; print $moreforfilter; - print '
'; + print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index e99c7122a10dc..5b45020b7e1a4 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -234,7 +234,7 @@ // Show filter box print ''; print ''; - print '
'; + print '
'; print ''; // Company print ''; } else print ''; @@ -403,7 +403,7 @@ array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); } } else @@ -429,7 +429,7 @@ $sql.= " , ".MAIN_DB_PREFIX."facturedet as fc"; $sql.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql.= " WHERE rc.fk_soc =". $objsoc->id; + $sql.= " WHERE rc.fk_soc =". $object->id; $sql.= " AND rc.fk_facture_line = fc.rowid"; $sql.= " AND fc.fk_facture = f.rowid"; $sql.= " AND rc.fk_user = u.rowid"; @@ -446,7 +446,7 @@ $sql2.= " , ".MAIN_DB_PREFIX."user as u"; $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql2.= " WHERE rc.fk_soc =". $objsoc->id; + $sql2.= " WHERE rc.fk_soc =". $object->id; $sql2.= " AND rc.fk_facture = f.rowid"; $sql2.= " AND rc.fk_user = u.rowid"; diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index f3d83b837dde4..1ec3a0533cc28 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -47,6 +47,8 @@ * View Mode */ +$form = new Form($db); + llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); if ($id > 0 || ! empty($ref)) @@ -64,9 +66,12 @@ print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -262,8 +262,8 @@ print '

'; //} -print ''; -print ''; +print '
'; +print ''; print ''; print ''; print ''; @@ -274,13 +274,15 @@ print ''; $oldyear=0; +$var=true; foreach ($data as $val) { $year = $val['year']; while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - print ''; + $var=!$var; + print ''; print ''; print ''; print ''; @@ -290,7 +292,7 @@ print ''; print ''; } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php deleted file mode 100644 index f629aafef2904..0000000000000 --- a/htdocs/comm/prospect/list.php +++ /dev/null @@ -1,610 +0,0 @@ - - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013-2015 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2015 Marcos García - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/comm/prospect/list.php - * \ingroup prospect - * \brief Page to list prospects - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -$langs->load("propal"); -$langs->load("companies"); - -// Security check -$socid = GETPOST("socid",'int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'societe',$socid,''); - -$action = GETPOST('action','alpha'); -$socname = GETPOST("socname",'alpha'); -$stcomm = GETPOST("stcomm",'alpha'); // code -$search_stcomm = GETPOST("search_stcomm",'int'); -$search_nom = GETPOST("search_nom"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_state = GETPOST("search_state"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST("search_categ",'int'); -$search_status = GETPOST("search_status",'int'); -$catid = GETPOST("catid",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; - -$search_level_from = GETPOST("search_level_from","alpha"); -$search_level_to = GETPOST("search_level_to","alpha"); - -// If both parameters are set, search for everything BETWEEN them -if ($search_level_from != '' && $search_level_to != '') -{ - // Ensure that these parameters are numbers - $search_level_from = (int) $search_level_from; - $search_level_to = (int) $search_level_to; - - // If from is greater than to, reverse orders - if ($search_level_from > $search_level_to) - { - $tmp = $search_level_to; - $search_level_to = $search_level_from; - $search_level_from = $tmp; - } - - // Generate the SQL request - $sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range'; -} -// If only "from" parameter is set, search for everything GREATER THAN it -else if ($search_level_from != '') -{ - // Ensure that this parameter is a number - $search_level_from = (int) $search_level_from; - - // Generate the SQL request - $sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range'; -} -// If only "to" parameter is set, search for everything LOWER THAN it -else if ($search_level_to != '') -{ - // Ensure that this parameter is a number - $search_level_to = (int) $search_level_to; - - // Generate the SQL request - $sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range'; -} -// If no parameters are set, dont search for anything -else -{ - $sortwhere = '0 as is_in_range'; -} - -// Select every potentiels, and note each potentiels which fit in search parameters -dol_syslog('prospects::prospects_prospect_level',LOG_DEBUG); -$sql = "SELECT code, label, sortorder, ".$sortwhere; -$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; -$sql.= " WHERE active > 0"; -$sql.= " ORDER BY sortorder"; - -$resql = $db->query($sql); -if ($resql) -{ - $tab_level = array(); - $search_levels = array(); - - while ($obj = $db->fetch_object($resql)) - { - // Compute level text - $level=$langs->trans($obj->code); - if ($level == $obj->code) $level=$langs->trans($obj->label); - - // Put it in the array sorted by sortorder - $tab_level[$obj->sortorder] = $level; - - // If this potentiel fit in parameters, add its code to the $search_levels array - if ($obj->is_in_range == 1) - { - $search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"'; - } - } - - // Implode the $search_levels array so that it can be use in a "IN (...)" where clause. - // If no paramters was set, $search_levels will be empty - $search_levels = implode(',', $search_levels); -} -else dol_print_error($db); - -// Load sale and categ filters -$search_sale = GETPOST('search_sale','int'); -$search_categ = GETPOST('search_categ','int'); -// If the internal user must only see his prospect, force searching by him -if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; - -// List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) -$sts = array(-1,0,1,2,3); - - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('prospectlist')); -$extrafields = new ExtraFields($db); - -// fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('thirdparty'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); - -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $socname=""; - $stcomm=""; - $search_stcomm=""; - $search_nom=""; - $search_zipcode=""; - $search_town=""; - $search_state=""; - $search_datec=""; - $search_categ=""; - $search_status=""; - $search_country=""; - $search_type_thirdparty=""; - $search_array_options=array(); -} - -if ($search_status=='') $search_status=1; // always display active customer first - - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - -if (empty($reshook)) -{ - if ($action == 'setstcomm') - { - $object = new Client($db); - $result=$object->fetch($socid); - $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'); - - $action=''; $socid=0; - } -} - - -/* - * View - */ - -$formother=new FormOther($db); -$form=new Form($db); -$formcompany=new FormCompany($db); -$prospectstatic=new Client($db); -$prospectstatic->client=2; -$prospectstatic->loadCacheOfProspStatus(); - -$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,"; -$sql.= " s.prefix_comm, s.fk_prospectlevel, s.fk_stcomm as stcomm_id,"; -$sql.= " st.libelle as stcomm_label,"; -$sql.= " d.nom as departement"; -$sql.= " ,s.fk_pays"; -$sql.= " ,typent.code as typent_code"; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) -// Add fields for extrafields -if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.client IN (2, 3)"; -$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql.= " AND s.rowid = " .$socid; -if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); -if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) $sql .= natural_search(array('s.nom','s.name_alias'), $search_nom); -if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'"; -if ($search_town) $sql .= natural_search('s.town', $search_town); -if ($search_state) $sql .= natural_search('d.nom', $search_state); -if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; -if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); -// Insert levels filters -if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -// Insert sale filter -if ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); -if ($socname) -{ - $sql .= natural_search('s.nom', $search_nom); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -// Extra fields -foreach ($search_array_options as $key => $val) -{ - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } -} -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} -$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC"; -$sql.= $db->plimit($conf->liste_limit+1, $offset); -//print $sql; - -dol_syslog('comm/prospect/list.php', LOG_DEBUG); -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - - if ($num == 1 && $socname) - { - $obj = $db->fetch_object($resql); - header("Location: card.php?socid=".$obj->socid); - exit; - } - else - { - $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; - llxHeader('',$langs->trans("ThirdParty"),$help_url); - } - - $param='&search_stcomm='.$search_stcomm; - $param.='&search_nom='.urlencode($search_nom); - $param.='&search_zipcode='.urlencode($search_zipcode); - $param.='&search_town='.urlencode($search_town); - // Store the status filter in the URL - if (isSet($search_setstcomm)) - { - foreach ($search_setstcomm as $key => $value) - { - if ($value == 'true') - $param.='&search_setstcomm['.((int) $key).']=true'; - else - $param.='&search_setstcomm['.((int) $key).']=false'; - } - } - if ($search_level_from != '') $param.='&search_level_from='.$search_level_from; - if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; - if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ); - if ($search_sale > 0) $param.='&search_sale='.$search_sale; - if ($search_status != '') $param.='&search_status='.$search_status; - if ($search_country != '') $param.='&search_country='.$search_country; - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.$search_type_thirdparty; - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } - // $param and $urladd should have the same value - $urladd = $param; - - print_barre_liste($langs->trans("ListOfProspects"), $page, $_SERVER["PHP_SELF"], $param, $sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png'); - - - // Print the search-by-sale and search-by-categ filters - print ''; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1); - $moreforfilter.='       '; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - } - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print '
'.$langs->trans("Year").''.$langs->trans("NbOfProposals").'%
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).'
'; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("State"),$_SERVER["PHP_SELF"],"s.fk_departement","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre(''); - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder); - } - } - } - // Hook fields - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Prospect level - print ''; - - // Prospect status - print ''; - - print ''; - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - $crit=$search_array_options['search_options_'.$key]; - print ''; - } - } - } - // Hook fields - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Status - print ''; - - // Print the search button - print '\n"; - - print "\n"; - - $i = 0; - $var=true; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - - $var=!$var; - - print ''; - print ''; - print ""; - print ""; - print ''; - //Country - print ''; - //Type ent - print ''; - // Creation date - print ''; - // Level - print '"; - // Statut - print '"; - - print ''; - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - print ''; - } - } - } - // Hook fields - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - - if ($num > $conf->liste_limit || $page > 0) print_barre_liste('', $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - - print "
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->select_country($search_country,'search_country'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - $options_from = ''; // Generate in $options_from the list of each option sorted - foreach ($tab_level as $tab_level_sortorder => $tab_level_label) - { - $options_from .= ''; - } - array_reverse($tab_level, true); // Reverse the list - $options_to = ''; // Generate in $options_to the list of each option sorted in the reversed order - foreach ($tab_level as $tab_level_sortorder => $tab_level_label) - { - $options_to .= ''; - } - - // Print these two select - print $langs->trans("From").' '; - print ' '; - print $langs->trans("to").' '; - - print ''; - $arraystcomm=array(); - foreach($prospectstatic->cacheprospectstatus as $key => $val) - { - $arraystcomm[$val['id']]=$val['label']; - } - print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); - print ''; - print ' '; - print ''; - print $extrafields->showInputField($key, $crit, '', '', 'search_', 4); - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print "
'; - $prospectstatic->id=$obj->socid; - $prospectstatic->name=$obj->name; - $prospectstatic->status=$obj->status; - $prospectstatic->code_client=$obj->code_client; - $prospectstatic->client=$obj->client; - $prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel; - $prospectstatic->name_alias=$obj->name_alias; - print $prospectstatic->getNomUrl(1,'prospect'); - print '".$obj->zip."".$obj->town."'.$obj->departement.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.dol_print_date($db->jdate($obj->datec)).''; - print $prospectstatic->getLibProspLevel(); - print "'; - print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); - print "'; - foreach($prospectstatic->cacheprospectstatus as $key => $val) - { - $titlealt='default'; - if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; - if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; - } - print ''; - $paramkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$paramkey); - print ''; - print $prospectstatic->LibStatut($prospectstatic->status,5); - print '
"; - - print ""; - - $db->free($resql); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -} -else -{ - dol_print_error($db); -} - - -llxFooter(); -$db->close(); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index ea9e1382d4065..0edcdcd0c1d05 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -52,9 +52,9 @@ if (GETPOST("action") == 'setremise') { - $soc = New Societe($db); - $soc->fetch($_GET["id"]); - $result=$soc->set_remise_client($_POST["remise"],$_POST["note"],$user); + $object = new Societe($db); + $object->fetch($_GET["id"]); + $result=$object->set_remise_client($_POST["remise"],$_POST["note"],$user); if ($result > 0) { @@ -71,7 +71,7 @@ } else { - setEventMessage($soc->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -93,51 +93,50 @@ if ($socid > 0) { // On recupere les donnees societes par l'objet - $objsoc = new Societe($db); - $objsoc->id=$socid; - $objsoc->fetch($socid); + $object = new Societe($db); + $object->fetch($socid); - $head = societe_prepare_head($objsoc); + $head = societe_prepare_head($object); - print '
'; + print ''; print ''; print ''; print ''; dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company'); - - print ''; - - // Name - print ''; - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
'; + + print '
'; + print '
'.$langs->trans('Name').''; - print $form->showrefnav($objsoc,'id','',1,'rowid','nom'); - print '
'; // Remise - print '"; + print '"; print '
'; - print $langs->trans("CustomerRelativeDiscount").''.price2num($objsoc->remise_percent)."%
'; + print $langs->trans("CustomerRelativeDiscount").''.price2num($object->remise_percent)."%
'; print '
'; print load_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); - print ''; + print '
'; // Nouvelle valeur - print ''; + print ''; // Motif/Note - print ''; + print ''; print "
'; - print $langs->trans("NewValue").'%
'; + print $langs->trans("NewValue").'%
'; - print $langs->trans("NoteReason").'
'; + print $langs->trans("NoteReason").'
"; + print ''; + dol_fiche_end(); print '
'; @@ -160,7 +159,7 @@ $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE rc.fk_soc =". $objsoc->id; + $sql.= " WHERE rc.fk_soc =". $object->id; $sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " ORDER BY rc.datec DESC"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 957f109268abf..e472c5fb8481f 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -36,7 +36,7 @@ $backtopage=GETPOST('backtopage','alpha'); // Security check -$socid = GETPOST('id','int'); +$socid = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); if ($user->societe_id > 0) { $socid = $user->societe_id; @@ -140,7 +140,7 @@ $error=0; if (empty($_POST["desc"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("ReasonDiscount")), null, 'errors'); $error++; } @@ -212,36 +212,34 @@ if ($socid > 0) { // On recupere les donnees societes par l'objet - $objsoc = new Societe($db); - $objsoc->id=$socid; - $objsoc->fetch($socid); + $object = new Societe($db); + $object->fetch($socid); /* * Affichage onglets */ - $head = societe_prepare_head($objsoc); + $head = societe_prepare_head($object); - print ''; + print ''; print ''; print ''; print ''; dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company'); - print ''; - - // Name - print ''; - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
'; + + print '
'; + print '
'.$langs->trans('Name').''; - print $form->showrefnav($objsoc,'id','',1,'rowid','nom'); - print '
'; // Calcul avoirs en cours $remise_all=$remise_user=0; $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; - $sql.= " WHERE rc.fk_soc =". $objsoc->id; + $sql.= " WHERE rc.fk_soc =". $object->id; $sql.= " AND (fk_facture_line IS NULL AND fk_facture IS NULL)"; $sql.= " GROUP BY rc.fk_user"; $resql=$db->query($sql); @@ -256,7 +254,7 @@ dol_print_error($db); } - print ''; + print ''; print ''; print ''; @@ -271,13 +269,15 @@ print ' '.$langs->trans("Currency".$conf->currency).''; print ''; print ''; print ''; print ''; print "
'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'
'.$langs->trans("CustomerAbsoluteDiscountAllUsers").''.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'
'.$langs->trans("CustomerAbsoluteDiscountMy").'
'.$langs->trans("VAT").''; - print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc); + print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$object); print '
'.$langs->trans("NoteReason").'
"; + print '
'; + dol_fiche_end(); print '
'; @@ -296,7 +296,7 @@ if ($_GET['action'] == 'remove') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); } /* @@ -309,7 +309,7 @@ $sql.= " fa.facnumber as ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql.= " WHERE rc.fk_soc =". $objsoc->id; + $sql.= " WHERE rc.fk_soc =". $object->id; $sql.= " AND u.rowid = rc.fk_user"; $sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)"; $sql.= " ORDER BY rc.datec DESC"; @@ -375,9 +375,9 @@ if ($user->rights->societe->creer || $user->rights->facture->creer) { print '
'; - print 'rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').''; + print 'rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').''; print '   '; - print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; + print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; print ' 
'; - // Ref - print '"; - print ''; + //$linkback = '' . $langs->trans("BackToList") . ''; + + // Ref + print ''; // Ref cde client print ''; @@ -142,7 +147,7 @@ print "
'.$langs->trans("Ref")."'.$object->ref.'
' . $langs->trans('Ref') . ''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
'.$langs->trans('RefCustomer').'
\n"; // Conversion du PDF en image png si fichier png non existant - if (! file_exists($fileimage) && ! file_exists($fileimagebis)) + if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) { if (class_exists("Imagick")) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36c6786a91e23..4d7456af1fd32 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -151,7 +151,7 @@ // Reopen a closed order else if ($action == 'reopen' && $user->rights->commande->creer) { - if ($object->statut == STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED) + if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED) { $result = $object->set_reopen($user); if ($result > 0) @@ -166,7 +166,7 @@ } } - // Suppression de la commande + // Remove order else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer) { $result = $object->delete($user); @@ -231,7 +231,7 @@ } if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action = 'create'; $error++; } @@ -595,7 +595,7 @@ } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } if ($qty == '') { @@ -875,7 +875,7 @@ // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 36b716abca223..d43314a8816a3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -227,14 +227,14 @@ function valid($user, $idwarehouse=0, $notrigger=0) // Protection if ($this->statut == self::STATUS_VALIDATED) { - dol_syslog(get_class($this)."::valid no draft status", LOG_WARNING); + dol_syslog(get_class($this)."::valid action abandonned: no draft status", LOG_WARNING); return 0; } if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))) { - $this->error='Permission denied'; + $this->error='ErrorPermissionDenied'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; } @@ -251,7 +251,7 @@ function valid($user, $idwarehouse=0, $notrigger=0) $result=$soc->set_as_client(); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); } @@ -702,6 +702,7 @@ function create($user, $notrigger=0) $sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int"; $sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address"; $sql.= ", fk_shipping_method"; + $sql.= ", fk_warehouse"; $sql.= ", remise_absolue, remise_percent"; $sql.= ", fk_incoterms, location_incoterms"; $sql.= ", entity"; @@ -724,6 +725,7 @@ function create($user, $notrigger=0) $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:'NULL'); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); + $sql.= ", ".($this->warehouse_id>0?$this->warehouse_id:'NULL'); $sql.= ", ".($this->remise_absolue>0?$this->db->escape($this->remise_absolue):'NULL'); $sql.= ", ".($this->remise_percent>0?$this->db->escape($this->remise_percent):0); $sql.= ", ".(int) $this->fk_incoterms; @@ -1009,116 +1011,113 @@ function createFromProposal($object) $error=0; - // Signed proposal - if ($object->statut == 2) - { - $this->date_commande = dol_now(); - $this->source = 0; + + $this->date_commande = dol_now(); + $this->source = 0; - $num=count($object->lines); - for ($i = 0; $i < $num; $i++) - { - $line = new OrderLine($this->db); - - $line->libelle = $object->lines[$i]->libelle; - $line->label = $object->lines[$i]->label; - $line->desc = $object->lines[$i]->desc; - $line->price = $object->lines[$i]->price; - $line->subprice = $object->lines[$i]->subprice; - $line->tva_tx = $object->lines[$i]->tva_tx; - $line->localtax1_tx = $object->lines[$i]->localtax1_tx; - $line->localtax2_tx = $object->lines[$i]->localtax2_tx; - $line->qty = $object->lines[$i]->qty; - $line->fk_remise_except = $object->lines[$i]->fk_remise_except; - $line->remise_percent = $object->lines[$i]->remise_percent; - $line->fk_product = $object->lines[$i]->fk_product; - $line->info_bits = $object->lines[$i]->info_bits; - $line->product_type = $object->lines[$i]->product_type; - $line->rang = $object->lines[$i]->rang; - $line->special_code = $object->lines[$i]->special_code; - $line->fk_parent_line = $object->lines[$i]->fk_parent_line; - $line->fk_unit = $object->lines[$i]->fk_unit; - - $line->date_start = $object->lines[$i]->date_start; - $line->date_end = $object->lines[$i]->date_end; - - $line->fk_fournprice = $object->lines[$i]->fk_fournprice; - $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); - $line->pa_ht = $marginInfos[0]; - $line->marge_tx = $marginInfos[1]; - $line->marque_tx = $marginInfos[2]; - - // get extrafields from original line - $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); - foreach($object->lines[$i]->array_options as $options_key => $value) - $line->array_options[$options_key] = $value; - - $this->lines[$i] = $line; - } + $num=count($object->lines); + for ($i = 0; $i < $num; $i++) + { + $line = new OrderLine($this->db); - $this->socid = $object->socid; - $this->fk_project = $object->fk_project; - $this->cond_reglement_id = $object->cond_reglement_id; - $this->mode_reglement_id = $object->mode_reglement_id; - $this->fk_account = $object->fk_account; - $this->availability_id = $object->availability_id; - $this->demand_reason_id = $object->demand_reason_id; - $this->date_livraison = $object->date_livraison; - $this->shipping_method_id = $object->shipping_method_id; - $this->fk_delivery_address = $object->fk_delivery_address; - $this->contact_id = $object->contactid; - $this->ref_client = $object->ref_client; - $this->note_private = $object->note_private; - $this->note_public = $object->note_public; - - $this->origin = $object->element; - $this->origin_id = $object->id; + $line->libelle = $object->lines[$i]->libelle; + $line->label = $object->lines[$i]->label; + $line->desc = $object->lines[$i]->desc; + $line->price = $object->lines[$i]->price; + $line->subprice = $object->lines[$i]->subprice; + $line->tva_tx = $object->lines[$i]->tva_tx; + $line->localtax1_tx = $object->lines[$i]->localtax1_tx; + $line->localtax2_tx = $object->lines[$i]->localtax2_tx; + $line->qty = $object->lines[$i]->qty; + $line->fk_remise_except = $object->lines[$i]->fk_remise_except; + $line->remise_percent = $object->lines[$i]->remise_percent; + $line->fk_product = $object->lines[$i]->fk_product; + $line->info_bits = $object->lines[$i]->info_bits; + $line->product_type = $object->lines[$i]->product_type; + $line->rang = $object->lines[$i]->rang; + $line->special_code = $object->lines[$i]->special_code; + $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->fk_unit = $object->lines[$i]->fk_unit; + + $line->date_start = $object->lines[$i]->date_start; + $line->date_end = $object->lines[$i]->date_end; + + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; // get extrafields from original line - $object->fetch_optionals($object->id); - - $e = new ExtraFields($db); - $element_extrafields = $e->fetch_name_optionals_label($this->element); - - foreach($object->array_options as $options_key => $value) { - if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){ - $this->array_options[$options_key] = $value; - } + $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); + foreach($object->lines[$i]->array_options as $options_key => $value) + $line->array_options[$options_key] = $value; + + $this->lines[$i] = $line; + } + + $this->socid = $object->socid; + $this->fk_project = $object->fk_project; + $this->cond_reglement_id = $object->cond_reglement_id; + $this->mode_reglement_id = $object->mode_reglement_id; + $this->fk_account = $object->fk_account; + $this->availability_id = $object->availability_id; + $this->demand_reason_id = $object->demand_reason_id; + $this->date_livraison = $object->date_livraison; + $this->shipping_method_id = $object->shipping_method_id; + $this->warehouse_id = $object->warehouse_id; + $this->fk_delivery_address = $object->fk_delivery_address; + $this->contact_id = $object->contactid; + $this->ref_client = $object->ref_client; + $this->note_private = $object->note_private; + $this->note_public = $object->note_public; + + $this->origin = $object->element; + $this->origin_id = $object->id; + + // get extrafields from original line + $object->fetch_optionals($object->id); + + $e = new ExtraFields($db); + $element_extrafields = $e->fetch_name_optionals_label($this->element); + + foreach($object->array_options as $options_key => $value) { + if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){ + $this->array_options[$options_key] = $value; } - // Possibility to add external linked objects with hooks - $this->linked_objects[$this->origin] = $this->origin_id; - if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) - { - $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); - } + } + // Possibility to add external linked objects with hooks + $this->linked_objects[$this->origin] = $this->origin_id; + if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) + { + $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); + } - $ret = $this->create($user); + $ret = $this->create($user); - if ($ret > 0) - { - // Actions hooked (by external module) - $hookmanager->initHooks(array('orderdao')); + if ($ret > 0) + { + // Actions hooked (by external module) + $hookmanager->initHooks(array('orderdao')); - $parameters=array('objFrom'=>$object); - $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; + $parameters=array('objFrom'=>$object); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - if (! $error) + if (! $error) + { + // Ne pas passer par la commande provisoire + if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1) { - // Ne pas passer par la commande provisoire - if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1) - { - $this->fetch($ret); - $this->valid($user); - } - return $ret; + $this->fetch($ret); + $this->valid($user); } - else return -1; + return $ret; } else return -1; } - else return 0; + else return -1; } @@ -1146,7 +1145,7 @@ function createFromProposal($object) * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param array $array_options extrafields array + * @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) * @param string $fk_unit Code of the unit to use. Null to use the default one * @return int >0 if OK, <0 if KO * @@ -1436,6 +1435,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='') $sql.= ', c.date_commande'; $sql.= ', c.date_livraison'; $sql.= ', c.fk_shipping_method'; + $sql.= ', c.fk_warehouse'; $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; $sql.= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_delivery_address, c.extraparams'; $sql.= ', c.fk_incoterms, c.location_incoterms'; @@ -1503,6 +1503,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='') $this->demand_reason_code = $obj->demand_reason_code; $this->date_livraison = $this->db->jdate($obj->date_livraison); $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; + $this->warehouse_id = ($obj->fk_warehouse>0)?$obj->fk_warehouse:null; $this->fk_delivery_address = $obj->fk_delivery_address; //Incoterms diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index f9fe17ac1c277..8aa5ce64655fe 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -67,11 +67,9 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +print $langs->trans("CustomerOrder").':'; print "
'.$langs->trans("SearchOrder").'
'.$langs->trans("Search").'
'; -print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index dfe5fab121795..46ee8687fbb71 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -76,7 +76,7 @@ $viewstatut=GETPOST('viewstatut'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_categ=''; $search_user=''; @@ -95,6 +95,17 @@ // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('orderlist')); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'c.ref'=>'Ref', + 'c.ref_client'=>'RefCustomerOrder', + 'pd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'c.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; + + /* * Actions */ @@ -139,7 +150,7 @@ if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($search_ref) $sql .= natural_search('c.ref', $search_ref); -if ($sall) $sql .= natural_search(array('c.ref', 'c.note_private'), $sall); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($viewstatut <> '') { if ($viewstatut < 4 && $viewstatut > -3) @@ -259,11 +270,19 @@ // Lignes des champs de filtre print '
'; - if ($optioncss != '') print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; - + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + $moreforfilter=''; // If the user can view prospects other than his' @@ -275,15 +294,15 @@ $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); $moreforfilter.=''; } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) + // If the user can view other users + if ($user->rights->user->user->lire) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); $moreforfilter.='
'; } - // If the user can view prospects other than his' + // If the user can view categories or products if ($conf->categorie->enabled && $user->rights->produit->lire) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -295,7 +314,7 @@ } if (! empty($moreforfilter)) { - print '
'; + print '
'; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -303,12 +322,13 @@ print '
'; } + print '
'; print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); + if (empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)) print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -331,11 +351,15 @@ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); - print ''; + if (empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)) + { + print ''; + } print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index c4d48d8f72e05..04cfad1732df6 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -250,7 +250,7 @@ // Show filter box print ''; print ''; - print '
'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); + print ''; print ''; print '
'; + print '
'; print ''; // Company print ' diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 898348d047e18..5551d848b5f4c 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -93,7 +93,7 @@ function init_typeoffields(type) diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 59c4c86a77e73..84b869cd8138c 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -28,7 +28,7 @@ if ($action == 'delete') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles - $ret = $form->formconfirm( + $ret = $form->form_confirm( $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 5773d7ce9d872..46e7d154533c5 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -21,7 +21,7 @@ $note_public = 'note_public'; $note_private = 'note_private'; -$colwidth=(isset($colwidth)?$colwidth:25); +$colwidth=(isset($colwidth)?$colwidth:(empty($cssclass)?'25':'')); $permission=(isset($permission)?$permission:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)); // If already defined by caller page $moreparam=(isset($moreparam)?$moreparam:''); @@ -50,7 +50,7 @@ // Special cases if ($module == 'propal') { $permission=$user->rights->propale->creer;} -elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;} +elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;} elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer;} elseif ($module == 'project') { $permission=$user->rights->projet->creer;} elseif ($module == 'project_task') { $permission=$user->rights->projet->creer;} @@ -69,12 +69,12 @@
-
>editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?>
+
>editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?>
editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
societe_id)) { ?>
-
>editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?>
+
>editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?>
editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 938a615ea77f0..e8bacede84a5d 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -49,36 +49,36 @@
- global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + element == 'askpricesupplier') { ?> - + trans('AskPriceSupplierRefFourn'); ?> - - + + - + - + global->PRODUCT_USE_UNITS) { - print ''; } ?> - + situation_cycle_ref) { - print ''; + print ''; } if (! empty($usemargins)) { ?> - rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''; - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''; } ?> - + > @@ -102,7 +102,7 @@ $coldisplay=0; } ?> - element == 'askpricesupplier') { ?> - + - - - - global->PRODUCT_USE_UNITS) { - print ''; } ?> - + situation_cycle_ref) { $coldisplay++; @@ -246,7 +246,7 @@ if (! empty($usemargins)) { ?> - 0 // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) var defaultbuyprice = 'global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1')?'bestsupplierprice':''); ?>'; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 0ca056cfbb486..7cf7f40020d25 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -50,9 +50,9 @@ > global->MAIN_VIEW_LINE_NUMBER)) { ?> - + - element == 'askpricesupplier') { ?> - + - + - + - + - - + situation_cycle_ref) { $coldisplay++; - print ''; + print ''; } if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> - + global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> - + special_code == 3) { ?> - + - + statut == 0 && ($object_rights->creer)) { ?> - - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref)) { ?> - - + diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index fd4d59538f388..84f67660c4134 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -167,7 +167,7 @@ class InterfaceDemo extends DolibarrTriggers case 'CONTRACT_CANCEL': case 'CONTRACT_CLOSE': case 'CONTRACT_DELETE': - case 'LINECONTRACT_CREATE': + case 'LINECONTRACT_INSERT': case 'LINECONTRACT_UPDATE': case 'LINECONTRACT_DELETE': diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 1f4e5126ed04d..dd02db53bc89c 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -197,9 +197,7 @@ print ''; print ''; @@ -294,7 +292,7 @@ print yn($line->status); print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -275,8 +275,8 @@ print '

'; //} -print ''; -print ''; +print '
'; +print ''; print ''; print ''; print ''; @@ -287,13 +287,15 @@ print ''; $oldyear=0; +$var=true; foreach ($data as $val) { $year = $val['year']; while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - print ''; + $var=!$var; + print ''; print ''; print ''; @@ -305,7 +307,8 @@ print ''; } - print ''; + $var=!$var; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index deed3b1b97ad5..e3bc2a3fc2ca5 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -135,15 +135,15 @@ if (! $dateop) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } if (! $operation) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Type")), null, 'errors'); } if (! $amount) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); } if (! $error) @@ -952,7 +952,7 @@ if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''; - print ''; + print ''; print ''; print ''; } else { @@ -961,9 +961,9 @@ if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("Total"); print ' '.$object->currency_code.''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 2290edd8cc51c..0b588fa64d025 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -200,7 +200,7 @@ * Confirmation suppression fichier */ if ($action == 'delete') { - $ret = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), + $ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 45a87fea87c62..f1bb4eb9a622e 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -166,7 +166,7 @@ // Check parameters if ($rappro && empty($num_rel)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountStatement")), null, 'errors'); $error++; } diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 80befe3d433e0..b585f48565f80 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -186,12 +186,12 @@ if ($moreforfilter) { - print '
'; + print '
'; print $moreforfilter; print '
'."\n"; } - print '
'.$langs->trans("Year").''.$langs->trans("NbOfOrders").'%
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total).' 
'.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).''.price($total_deb*-1).''.price($total_cred).''.price($total_cred-($total_deb*-1)).' 
'."\n"; + print '
'."\n"; print ''; 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); diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 3a64d0cc3d107..56071d61f9b62 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -54,22 +54,22 @@ if (! $label) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors'); } if (! $amount) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); } if (! GETPOST('account_from','int')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferFrom")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors'); } if (! GETPOST('account_to','int')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors'); } if (! $error) { diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index d4858d5ab2935..bc18d379a8790 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -125,17 +125,17 @@ if (! $object->date) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if ($object->type == '-1') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; } if (! ($object->fk_user > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Person")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Person")), null, 'errors'); $error++; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 5c19e054fd092..983331bd412e9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -277,7 +277,7 @@ $date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']); if (empty($date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); exit; } @@ -550,7 +550,7 @@ $result = $object->set_paid($user, $close_code, $close_note); if ($result<0) setEventMessage($object->error,'errors'); } else { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); } } // Classify "abandoned" else if ($action == 'confirm_canceled' && $confirm == 'yes') { @@ -561,7 +561,7 @@ $result = $object->set_canceled($user, $close_code, $close_note); if ($result<0) setEventMessage($object->error,'errors'); } else { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); } } @@ -671,12 +671,12 @@ if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! ($_POST['fac_replacement'] > 0)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } if (! $error) { @@ -716,14 +716,14 @@ if (! ($_POST['fac_avoir'] > 0)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } if (! $error) @@ -815,7 +815,7 @@ if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) @@ -843,14 +843,14 @@ if (GETPOST('socid', 'int') < 1) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) @@ -1245,7 +1245,7 @@ } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error ++; } if ($qty == '') { @@ -1283,7 +1283,8 @@ // Ecrase $txtva par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (! empty($idprod)) { + if (! empty($idprod)) + { $prod = new Product($db); $prod->fetch($idprod); @@ -1304,8 +1305,11 @@ $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + } } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -1318,26 +1322,30 @@ $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; } } } - // if price ht is forced (ie: calculated by margin rate and cost price) - if (! empty($price_ht)) { + // if price ht was forced (ie: from gui when calculated by margin rate and cost price) + if (! empty($price_ht)) + { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } - // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - elseif ($tva_tx != $prod->tva_tx) { - if ($price_base_type != 'HT') { + elseif ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); - } else { + } + else + { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } } @@ -1555,7 +1563,7 @@ // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } @@ -1790,6 +1798,9 @@ dol_print_error($db); } } + + if ($error) + $action = 'edit_extras'; } } @@ -1867,7 +1878,7 @@ $objectsrc->fetch_lines(); $objectsrc->fetch_thirdparty(); - $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); + $projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project); $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); @@ -2247,9 +2258,6 @@ // Project if (! empty($conf->projet->enabled) && $socid > 0) { - $projectid = GETPOST('projectid')?GETPOST('projectid'):0; - if ($origin == 'project') $projectid = ($originid ? $originid : 0); - $langs->load('projects'); print ''; + // Ref customer + print ''; + print ''; + // Ref supplier print ''; print ''; - // Customer + // Thirdparty print ''; - print ''; - if($socid>0) + print ''; + if ($socid>0) { print ''; } print ''."\n"; @@ -1206,6 +1241,14 @@ } print ''; + print ''; + print ''; + + print ''; print '\n"; - print ''; - // Name - Position - print ''; - - // Address / Phone - print ''; - - // Email - print ''; - - // Status - print ''; - - // Add to agenda - if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) - { - $colspan++; - print ''; - } - - // Edit - print ''; - - print ""; - - $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut "; $sql .= ", p.civility as civility_id, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; @@ -681,18 +655,50 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $num = $db->num_rows($result); $var=true; - if ($num) + if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x'))) { + print ''; + // Name - Position + print ''; + + // Address / Phone + print ''; + + // Email + print ''; + + // Status + print ''; + + // Add to agenda + if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) + { + $colspan++; + print ''; + } + + // Edit + print ''; + + print ""; + $i=0; while ($i < $num) { $obj = $db->fetch_object($result); $var = !$var; - print ""; - - print '"; + + print ''; - $country_code = getCountry($obj->country_id, 'all'); - // Address and phone print ''; // Status @@ -887,13 +872,13 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') /** * Show html area with actions to do * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Object db - * @param Adherent|Societe $object Object third party or member - * @param Contact $objcon Object contact - * @param int $noprint Return string but does not output it - * @return mixed Return html part or void if noprint is 1 + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Object db + * @param Adherent|Societe $object Object third party or member + * @param Contact $objcon Object contact + * @param int $noprint Return string but does not output it + * @return mixed Return html part or void if noprint is 1 */ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2f49b37f71611..d6cadaaadec0a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -921,7 +921,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists) * * @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory) * @param string $destfile Destination file (can't be a directory. use native php @rename() to move a directory) - * @param integer $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) + * @param integer $newmask Mask in octal string for new file (0 by default means $conf->global->MAIN_UMASK) * @param int $overwriteifexists Overwrite file if exists (1 by default) * @return boolean True if OK, false if KO */ @@ -949,8 +949,12 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) } else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING); } - if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; - @chmod($newpathofdestfile, octdec($newmask)); + if (empty($newmask)) $newmask=empty($conf->global->MAIN_UMASK)?'0755':$conf->global->MAIN_UMASK; + $newmaskdec=octdec($newmask); + // Currently method is restricted to files (dol_delete_files previously used is for files, and mask usage if for files too) + // to allow mask usage for dir, we shoul introduce a new param "isdir" to 1 to complete newmask like this + // if ($isdir) $newmaskdec |= octdec('0111'); // Set x bit required for directories + @chmod($newpathofdestfile, $newmaskdec); } return $result; @@ -1502,7 +1506,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio else { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("File")), 'warnings'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("File")), null, 'errors'); } } @@ -1516,7 +1520,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio * @param int $donotdeletefile 1=Do not delete physically file * @return void */ -function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=0) +function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=1) { global $db,$user,$conf,$langs,$_FILES; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 81f1468338385..5b990ac509c5d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -732,7 +732,8 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD); $displaytab=0; $nbintab=0; - + $popuptab=0; + for ($i = 0 ; $i <= $maxkey ; $i++) { if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) @@ -745,7 +746,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi else $isactive=false; - if ($i <= $limittoshow || $isactive ) + if ($i <= $limittoshow || $isactive) { $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') @@ -775,7 +776,13 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi } else { - $outmore.='
'; + // The popup with the other tabs + if (! $popuptab) + { + $popuptab=1; + $outmore.='
'; + } + $outmore.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) @@ -788,16 +795,18 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $outmore.=''.$links[$i][1].''."\n"; $outmore.='
'; + $nbintab++; } $displaytab=$i; } - + if ($popuptab) $outmore.='
'; + if ($displaytab > $limittoshow) { $tabsname=str_replace("@", "", $picto); $out.='
'; - $out.=''.$langs->trans("More").' '.$nbintab.''; + $out.=''.$langs->trans("More").'... ('.$nbintab.')'; $out.='
'.$outmore.'
'; $out.="
\n"; @@ -840,6 +849,58 @@ function dol_get_fiche_end($notab=0) else return ''; } +/** + * Show tab footer of a card + * + * @param object $object Object to show + * @param string $paramid Name of parameter to use to name the id into the URL link + * @param string $morehtml More html content to output just before the nav bar + * @param int $shownav Show Condition (navigation is shown if value is 1) + * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field) + * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous + * @param string $morehtmlref More html to show after ref + * @param string $moreparam More param to add in nav link url. + * @param int $nodbprefix Do not include DB prefix to forge table name + * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlright More html code to show before navigation arrows + * @return void + */ +function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='') +{ + global $conf, $form, $user, $langs; + + //$showlogo=$object->logo; + $showlogo=1; + $showbarcode=empty($conf->barcode->enabled)?0:($object->barcode?1:0); + if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; + $modulepart='societe'; + if ($object->element == 'contact') $modulepart='contact'; + if ($object->element == 'member') $modulepart='memberphoto'; + if ($object->element == 'user') $modulepart='userphoto'; + + print '
'; + if ($showlogo) $morehtmlleft.='
'.$form->showphoto($modulepart,$object,0,0,0,'photoref').'
'; + if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; + if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } else { + $morehtmlright.=$object->getLibStatut(2); + } + if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; + $morehtmlref.='
'; + $morehtmlref.=$object->getBannerAddress('refaddress',$object); + $morehtmlref.='
'; + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member'))) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("TechnicalID").': '.$object->id; + $morehtmlref.='
'; + } + print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); + print '
'; + print '
'; +} + /** * Show a string with the label tag dedicated to the HTML edit field. * @@ -915,7 +976,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') else if (in_array($object->country_code,array('ES','TR'))) // ES: title firstname name \n address lines \n zip town \n state \n country { $ret .= ($ret ? $sep : '' ).$object->zip; - $ret .= ($object->town?' '.$object->town:''); + $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); if ($object->state && in_array($object->country_code,$countriesusingstate)) { $ret.="\n".$object->state; @@ -924,11 +985,11 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') else // Other: title firstname name \n address lines \n zip town \n country { - $ret .= ($ret ? $sep : '' ).$object->zip; - $ret .= ($object->town?' '.$object->town:''); + $ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : ''; + $ret .= ($object->town?(($object->zip?' ':$sep).$object->town):''); if ($object->state && in_array($object->country_code,$countriesusingstate)) { - $ret.=", ".$object->state; + $ret.=($ret?", ":'').$object->state; } } if (! is_object($outputlangs)) $outputlangs=$langs; @@ -1315,20 +1376,25 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0) * @param string $url Url to show * @param string $target Target for link * @param int $max Max number of characters to show + * @param int $withpicto With picto * @return string HTML Link */ -function dol_print_url($url,$target='_blank',$max=32) +function dol_print_url($url,$target='_blank',$max=32,$withpicto=0) { + global $langs; + if (empty($url)) return ''; $link=''; + $link.='"'; + if ($target) $link.=' target="'.$target.'"'; + $link.='>'; if (! preg_match('/^http/i',$url)) $link.='http://'; $link.=dol_trunc($url,$max); $link.=''; - return $link; + return '
'.($withpicto?img_picto($langs->trans("Url"), 'object_globe.png').' ':'').$link.'
'; } /** @@ -1431,29 +1497,30 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) /** * Format phone numbers according to country * - * @param string $phone Phone number to format - * @param string $country Country code to use for formatting - * @param int $cid Id of contact if known - * @param int $socid Id of third party if known - * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) - * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx - * @param string $withpicto Show picto - * @return string Formated phone number + * @param string $phone Phone number to format + * @param string $countrycode Country code to use for formatting + * @param int $cid Id of contact if known + * @param int $socid Id of third party if known + * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) + * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx + * @param string $withpicto Show picto + * @param string $titlealt Text to show on alt + * @return string Formated phone number */ -function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" ",$withpicto='') +function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$separ=" ",$withpicto='',$titlealt='') { global $conf,$user,$langs,$mysoc; // Clean phone parameter $phone = preg_replace("/[\s.-]/","",trim($phone)); if (empty($phone)) { return ''; } - if (empty($country)) $country=$mysoc->country_code; + if (empty($countrycode)) $countrycode=$mysoc->country_code; // Short format for small screens if ($conf->dol_optimize_smallscreen) $separ=''; $newphone=$phone; - if (strtoupper($country) == "FR") + if (strtoupper($countrycode) == "FR") { // France if (dol_strlen($phone) == 10) { @@ -1477,9 +1544,9 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" } } - if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set) + if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) { - if (! empty($conf->browser->phone)) // If phone, we use link of phone + if (! empty($conf->browser->phone) || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone { $newphone =''; @@ -1520,7 +1587,11 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" } } - return '
'.($withpicto?img_picto(($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")), 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'
'; + if (empty($titlealt)) + { + $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); + } + return '
'.($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'
'; } /** @@ -1591,47 +1662,54 @@ function dol_user_country() /** * Format address string * - * @param string $address Address - * @param int $htmlid Html ID (for example 'gmap') - * @param int $mode thirdparty|contact|member|other - * @param int $id Id of object - * @return void + * @param string $address Address + * @param int $htmlid Html ID (for example 'gmap') + * @param int $mode thirdparty|contact|member|other + * @param int $id Id of object + * @param int $noprint No output. Result is the function return + * @return string|void Nothing if noprint is 0, formatted address if noprint is 1 * @see dol_format_address */ -function dol_print_address($address, $htmlid, $mode, $id) +function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) { global $conf, $user, $langs, $hookmanager; + $out = ''; + if ($address) { if ($hookmanager) { $parameters = array('element' => $mode, 'id' => $id); $reshook = $hookmanager->executeHooks('printAddress', $parameters, $address); - print $hookmanager->resPrint; + $out.=$hookmanager->resPrint; } - if (empty($reshook)) { - print nl2br($address); + if (empty($reshook)) + { + $out.=nl2br($address); $showgmap=$showomap=0; - if ($mode=='thirdparty' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; + + // TODO Add a hook here + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; if ($mode=='contact' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) $showgmap=1; if ($mode=='member' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) $showgmap=1; - if ($mode=='thirdparty' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; if ($mode=='contact' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) $showomap=1; if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1; - // TODO Add a hook here if ($showgmap) { $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); - print '
'; + $out.=' '; } if ($showomap) { $url=dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id,1); - print ' '; + $out.=' '; } } } + if ($noprint) return $out; + else print $out; } @@ -2669,7 +2747,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m $sortorder=strtoupper($sortorder); $out=''; - + $sortimg=''; + $tag='th'; if ($thead==2) $tag='div'; @@ -2678,25 +2757,33 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '. $moreattrib.'>'; else $out.= '<'.$tag.' class="'.$prefix.'liste_titre" '. $moreattrib.'>'; - if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field + if (empty($thead) && $field) // If this is a sort field { $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); $options=preg_replace('/&+/i','&',$options); if (! preg_match('/^&/',$options)) $options='&'.$options; - if ($sortorder == 'DESC' ) $out.= ''; - if ($sortorder == 'ASC' ) $out.= ''; + if ($field != $sortfield) + { + if ($sortorder == 'DESC') $out.= ''; + if ($sortorder == 'ASC' || ! $sortorder) $out.= ''; + } + else + { + if ($sortorder == 'DESC' || ! $sortorder) $out.= ''; + if ($sortorder == 'ASC') $out.= ''; + } } $out.=$name; - if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field + if (empty($thead) && $field) // If this is a sort field { $out.=''; } - if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field + if (empty($thead) && $field) // If this is a sort field { $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); @@ -2704,27 +2791,33 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m if (! preg_match('/^&/',$options)) $options='&'.$options; //print " "; - $out.= ''; + $sortimg.= ''; + $sortimg.= ''; if (! $sortorder || $field != $sortfield) { - $out.= ''.img_down("A-Z",0).''; - $out.= ''.img_up("Z-A",0).''; + //$out.= ''.img_down("A-Z",0).''; + //$out.= ''.img_up("Z-A",0).''; } else { if ($sortorder == 'DESC' ) { - $out.= ''.img_down("A-Z",0).''; - $out.= ''.img_up("Z-A",1).''; + //$out.= ''.img_down("A-Z",0).''; + //$out.= ''.img_up("Z-A",1).''; + $sortimg.= img_up("Z-A",0); } if ($sortorder == 'ASC' ) { - $out.= ''.img_down("A-Z",1).''; - $out.= ''.img_up("Z-A",0).''; + //$out.= ''.img_down("A-Z",1).''; + //$out.= ''.img_up("Z-A",0).''; + $sortimg.= img_down("A-Z",0); } } - $out.= ''; + $sortimg.= ''; } + + $out.=$sortimg; + $out.=''; return $out; @@ -4291,7 +4384,7 @@ function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $wit * * @param string $firstname Firstname * @param string $lastname Lastname - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname * @return string Firstname + lastname or Lastname + firstname */ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) @@ -5130,3 +5223,32 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } +/** + * Return the filename of file to get the thumbs + * + * @param string $file Original filename + * @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini') + * @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image. + * @return string New file name + */ +function getImageFileNameForSize($file, $extName, $extImgTarget='') +{ + $dirName = dirname($file); + if ($dirName == '.') $dirName=''; + + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse + $fileName = basename($fileName); + + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':''); + + if (! $extImgTarget) return $file; + + $subdir=''; + if ($extName) $subdir = 'thumbs/'; + + return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb +} diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php new file mode 100644 index 0000000000000..f7f3ed11bd834 --- /dev/null +++ b/htdocs/core/lib/hrm.lib.php @@ -0,0 +1,120 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/lib/hrm.lib.php + * \ingroup HRM + * \brief Library for hrm + */ +$langs->load('hrm'); + +/** + * Return head table for employee tabs screen + * + * @param object $object contact + * @return array head table of tabs + */ +function employee_prepare_head($object) { + global $langs, $conf, $user; + + $h = 0; + $head = array (); + + $head [$h] [0] = DOL_URL_ROOT.'/hrm/employee/card.php?id=' . $object->id; + $head [$h] [1] = $langs->trans("Card"); + $head [$h] [2] = 'card'; + $h ++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'employee'); + + $head [$h] [0] = DOL_URL_ROOT.'/hrm/employee/info.php?id=' . $object->id; + $head [$h] [1] = $langs->trans("Info"); + $head [$h] [2] = 'info'; + $h ++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'employee', 'remove'); + + return $head; +} + +/** + * Return head table for establishment tabs screen + * + * @param Establishment $object Object related to tabs + * @return array Array of tabs to show + */ +function establishment_prepare_head($object) +{ + global $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id=' . $object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment'); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id=' . $object->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment','remove'); + + return $head; +} + +/** + * Return array head with list of tabs to view object informations + * + * @return array head + */ +function hrm_admin_prepare_head() +{ + global $langs, $conf, $user; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php'; + $head[$h][1] = $langs->trans("Parameters"); + $head[$h][2] = 'parameters'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; + $head[$h][1] = $langs->trans("Establishments"); + $head[$h][2] = 'establishments'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab + complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin'); + + complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin','remove'); + + return $head; +} + diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 7e47f755a7e31..e61dc22eeb0c6 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -483,7 +483,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ break; case IMAGETYPE_JPEG: // 2 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); - $extImgTarget = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); + $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'.jpg'); $newquality=$quality; break; case IMAGETYPE_PNG: // 3 @@ -512,7 +512,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse $fileName = basename($fileName); - $imgThumbName = $dirthumb.'/'.$fileName.$extName.$extImgTarget; // Chemin complet du fichier de la vignette + $imgThumbName = $dirthumb.'/'.getImageFileNameForSize($file, $extName, $extImgTarget); // Chemin complet du fichier de la vignette // Check if permission are ok //$fp = fopen($imgThumbName, "w"); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e2aabec427a94..0d7f18e1c753d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -303,12 +303,10 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) $pdf->startTransaction(); // store starting values $start_y = $pdf->GetY(); - var_dump($start_y); + //var_dump($start_y); $start_page = $pdf->getPage(); - // call your printing functions with your parameters - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // call printing functions with content $pdf->writeHTMLCell(0, 0, 0, $start_y, $htmlcontent, 0, 1, false, true, 'J',true); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // get the new Y $end_y = $pdf->GetY(); $end_page = $pdf->getPage(); @@ -386,7 +384,6 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($mode == 'source' && ! is_object($sourcecompany)) return -1; if ($mode == 'target' && ! is_object($targetcompany)) return -1; - if ($mode == 'delivery' && ! is_object($deliverycompany)) return -1; if (! empty($sourcecompany->state_id) && empty($sourcecompany->departement)) $sourcecompany->departement=getState($sourcecompany->state_id); //TODO: Deprecated if (! empty($sourcecompany->state_id) && empty($sourcecompany->state)) $sourcecompany->state=getState($sourcecompany->state_id); @@ -1035,20 +1032,23 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al * @param int $hideref Hide reference * @param int $hidedesc Hide description * @param int $issupplierline Is it a line for a supplier object ? - * @return string|null + * @return string */ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0) { global $db, $conf, $langs, $hookmanager; $reshook=0; - if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code); $action=''; $reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } if (empty($reshook)) { @@ -1057,6 +1057,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide $pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1, false, true, 'J',true); return $labelproductservice; } + return ''; } /** @@ -1253,22 +1254,25 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->num); } + return ''; } @@ -1279,22 +1283,25 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->product_ref); } + return ''; } /** @@ -1304,22 +1311,25 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->ref_supplier); } + return ''; } /** @@ -1335,7 +1345,9 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1343,13 +1355,13 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) $action=''; $reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); } + return ''; } /** @@ -1368,7 +1380,9 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) $sign=1; if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1376,13 +1390,13 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) $action=''; $reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; + if (!empty($hookmanager->resPrint)) print $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->subprice, 0, $outputlangs); } + return ''; } /** @@ -1392,25 +1406,29 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) - * @return void + * @return string */ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - foreach($object->hooks as $modules) - { - if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails); - } + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineupwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) print $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); } + return ''; } /** @@ -1426,25 +1444,25 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; + } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty; } + return ''; } /** @@ -1460,24 +1478,24 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_asked; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_asked; } + return ''; } /** @@ -1493,24 +1511,24 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_shipped; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_shipped; } + return ''; } /** @@ -1520,30 +1538,30 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return void + * @return string */ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return ($object->lines[$i]->qty_asked - $object->lines[$i]->qty_shipped); - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return ($object->lines[$i]->qty_asked - $object->lines[$i]->qty_shipped); } + return ''; } /** @@ -1559,31 +1577,32 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false) { global $langs; - if ($object->lines[$i]->special_code != 3) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) { - $special_code = $object->lines[$i]->special_code; - if (!empty($object->lines[$i]->fk_parent_line)) { - $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - } - $parameters = array( - 'i' => $i, - 'outputlangs' => $outputlangs, - 'hidedetails' => $hidedetails, - 'special_code' => $special_code - ); - $action = ''; - $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - - } else { - if (empty($hidedetails) || $hidedetails > 1) { - return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); - } - } + + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + { + $special_code = $object->lines[$i]->special_code; + if (!empty($object->lines[$i]->fk_parent_line)) { + $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + } + $parameters = array( + 'i' => $i, + 'outputlangs' => $outputlangs, + 'hidedetails' => $hidedetails, + 'special_code' => $special_code + ); + $action = ''; + $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); + } + return ''; } @@ -1602,24 +1621,24 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return dol_print_reduction($object->lines[$i]->remise_percent,$outputlangs); - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return dol_print_reduction($object->lines[$i]->remise_percent,$outputlangs); + } + return ''; } /** @@ -1630,24 +1649,28 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param HookManager $hookmanager Hook manager instance - * @return void + * @return string */ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) { - if ($object->lines[$i]->special_code != 3) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) { - $special_code = $object->lines[$i]->special_code; - if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); - $action = ''; - $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } else { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; - } + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + { + $special_code = $object->lines[$i]->special_code; + if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); + $action = ''; + $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; } + return ''; } /** @@ -1666,27 +1689,25 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0) $sign=1; if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; - if ($object->lines[$i]->special_code == 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - return $outputlangs->transnoentities("Option"); + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code, 'sign'=>$sign); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->total_ht, 0, $outputlangs); - } + if ($object->lines[$i]->special_code == 3) + { + return $outputlangs->transnoentities("Option"); + } + if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->total_ht, 0, $outputlangs); } return ''; } @@ -1704,27 +1725,25 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code == 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - return $outputlangs->transnoentities("Option"); + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); - } + if ($object->lines[$i]->special_code == 3) + { + return $outputlangs->transnoentities("Option"); + } + if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); } return ''; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 89d658fa01a08..94b2de526ddf1 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -53,7 +53,7 @@ function project_prepare_head($object) || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id; - $head[$h][1] = $langs->trans("Overview"); + $head[$h][1] = $langs->trans("ProjectOverview"); $head[$h][2] = 'element'; $h++; } @@ -348,7 +348,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $projectstatic->id=$lines[$i]->fk_project; $projectstatic->ref=$lines[$i]->projectref; $projectstatic->public=$lines[$i]->public; - if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId)) print $projectstatic->getNomUrl(1); + if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId) || ! empty($user->rights->projet->all->lire)) print $projectstatic->getNomUrl(1); else print $projectstatic->getNomUrl(1,'nolink'); if ($showlineingray) print ''; print ""; @@ -896,16 +896,6 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]); print '
' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0); @@ -2344,8 +2352,8 @@ } print '
' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); - //We check if Origin document has already an invoice attached to it - $objectsrc->fetchObjectLinked($originid,'','','facture'); + // We check if Origin document (id and type is known) has already at least one invoice attached to it + $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); $cntinvoice=count($objectsrc->linkedObjects['facture']); if ($cntinvoice>=1) { @@ -2973,16 +2981,16 @@ print ''; - print ''; + print '
'; // List of payments already done print ''; - print ''; - print ''; + print ''; + print ''; if (! empty($conf->banque->enabled)) - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $var = true; @@ -3033,7 +3041,7 @@ $i ++; } } else { - print ''; + print ''; } // } $db->free($result); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index fa2c3ba3a1e23..627ff82ae41b2 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -65,8 +65,8 @@ llxHeader('',$langs->trans("BillsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; + print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); -print '
'; $head = invoice_admin_prepare_head(); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 50749f89ab16b..d7fd3367b67dd 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -66,8 +66,8 @@ llxHeader('',$langs->trans("BillsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; + print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); -print '
'; $head = invoice_admin_prepare_head(); diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 340df8172dcb8..1172769e95a12 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -29,6 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -79,10 +80,21 @@ */ print '
' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '' . $langs->trans('Type') . '' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '' . $langs->trans('Type') . '' . $langs->trans('BankAccount') . '' . $langs->trans('Amount') . ' ' . $langs->trans('BankAccount') . '' . $langs->trans('Amount') . ' 
' . $langs->trans("None") . '
' . $langs->trans("None") . '
'; - // Ref - print ''; - print ''; - print ''; + $linkback = '' . $langs->trans("BackToList") . ''; + + // Ref + print ''; // Ref customer print ''; @@ -280,7 +292,7 @@ print "
'.$langs->trans('Ref').''.$object->ref.'
' . $langs->trans('Ref') . ''; + $morehtmlref = ''; + $discount = new DiscountAbsolute($db); + $result = $discount->fetch(0, $object->id); + if ($result > 0) { + $morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')'; + } + if ($result < 0) { + dol_print_error('', $discount->error); + } + print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref); + print '
'.$langs->trans('RefCustomer').'
\n"; // Conversion du PDF en image png si fichier png non existant - if (! file_exists($fileimage) && ! file_exists($fileimagebis)) + if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) { if (class_exists("Imagick")) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 51549704880e6..bd3e2dac6f01b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -122,6 +122,64 @@ class Facture extends CommonInvoice */ public $situation_final; + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; + + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; + + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; + + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; + + /** + * Proforma invoice (should not be used. a proforma is an order) + */ + const TYPE_PROFORMA = 4; + + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; + + /** + * Draft + */ + const STATUS_DRAFT = 0; + + /** + * Validated (need to be paid) + */ + const STATUS_VALIDATED = 1; + + /** + * Classified paid. + * If paid partially, $this->close_code can be: + * - CLOSECODE_DISCOUNTVAT + * - CLOSECODE_BADDEBT + * If paid completelly, this->close_code will be null + */ + const STATUS_CLOSED = 2; + + /** + * Classified abandoned and no payment done. + * $this->close_code can be: + * - CLOSECODE_BADDEBT + * - CLOSECODE_ABANDONED + * - CLOSECODE_REPLACED + */ + const STATUS_ABANDONED = 3; + const CLOSECODE_DISCOUNTVAT = 'discount_vat'; const CLOSECODE_BADDEBT = 'badcustomer'; const CLOSECODE_ABANDONED = 'abandon'; @@ -1732,7 +1790,7 @@ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0) { $num = $force_number; } - else if (preg_match('/^[\(]?PROV/i', $this->ref)) + else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b507f5284dde7..43160b68f99c7 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -107,6 +107,16 @@ $now=dol_now(); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'f.facnumber'=>'Ref', + 'f.ref_client'=>'RefCustomer', + 'fd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'f.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate"; + /* * Actions @@ -134,6 +144,7 @@ $month=''; } + /* * View @@ -232,7 +243,7 @@ } else { - $sql .= natural_search(array('s.nom', 'f.facnumber', 'f.note_public', 'fd.description'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } $sql.= ' ORDER BY '; $listfield=explode(',',$sortfield); @@ -270,13 +281,24 @@ if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; - if ($search_status > 0) $param.='&search_status='.$search_status; + if ($search_status != '') $param.='&search_status='.$search_status; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png'); $i = 0; print ''."\n"; - print ''; - + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) @@ -308,12 +330,16 @@ if ($moreforfilter) { - print ''; - print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; } + print '
'; + print '
'; print $moreforfilter; - print '
'; + print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder); diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index 72276b7706926..e0b821683ce5d 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -49,7 +49,7 @@ $month = GETPOST("month","int"); $year = GETPOST("year","int"); $filter = GETPOST("filtre"); -if (GETPOST('button_search')) +if (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x')) { $filter=GETPOST('filtre',2); //if ($filter != 'payed:0') $option=''; @@ -417,6 +417,7 @@ $search_paymentmode = GETPOST("search_paymentmode"); $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); +$search_status = GETPOST("search_status"); $late = GETPOST("late"); // Do we click on purge search criteria ? @@ -428,6 +429,7 @@ $search_paymentmode=''; $search_montant_ht=''; $search_montant_ttc=''; + $search_status=''; } $sortfield = GETPOST("sortfield",'alpha'); @@ -483,6 +485,7 @@ if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; +if ($search_status) $sql .= " AND f.fk_statut = ".$search_status; if ($month > 0) { if ($year > 0) @@ -528,6 +531,7 @@ if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_status) $param.='&search_status='.urlencode($search_status); if ($late) $param.='&late='.urlencode($late); if ($mode) $param.='&mode='.urlencode($mode); $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; @@ -616,32 +620,38 @@ } $i = 0; - print '
'; // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); + $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='       '; + $moreforfilter.='
'; } // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { + $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; $moreforfilter.=$form->select_dolusers($search_user,'search_user',1); + $moreforfilter.='
'; } - if ($moreforfilter) + if (! empty($moreforfilter)) { - print ''; - print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; } - print ''; + print '
'; + print '
'; print $moreforfilter; - print '
'; + + print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index f61e92687f681..2b7e17d936968 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -234,7 +234,7 @@ // Show filter box print ''; print ''; - print '
'; + print '
'; print ''; // Company print ''; + print_liste_field_titre(''); } print_liste_field_titre( $langs->trans("AmountTTC"), diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 7b9cfdd791379..dade07fd0e387 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -350,7 +350,7 @@ $sortorder ); } else { - print ''; + print_liste_field_titre(''); } print_liste_field_titre( $langs->trans("AmountTTC"), diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 688f88759c4d1..5c362fda9942d 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -81,22 +81,22 @@ if (empty($tva->datev)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateValue")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateValue")), null, 'errors'); $error++; } if (empty($tva->datep)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DatePayment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")), null, 'errors'); $error++; } if (empty($tva->type_payment) || $tva->type_payment < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } if (empty($tva->amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 2db5523c5bdb1..22220db68329d 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -4,10 +4,10 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -411,8 +411,10 @@ */ +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname; $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ContactsAddresses"),$help_url); +llxHeader('', $title, $help_url); $form = new Form($db); $formcompany = new FormCompany($db); @@ -773,11 +775,14 @@ print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -259,8 +259,8 @@ print '

'; //} -print ''; -print ''; +print '
'; +print ''; print ''; print ''; print ''; @@ -271,13 +271,15 @@ print ''; $oldyear=0; +$var=true; foreach ($data as $val) { $year = $val['year']; while ($year && $oldyear > $year+1) { // If we have empty year $oldyear--; - print ''; + $var=!$var; + print ''; print ''; print ''; print ''; @@ -287,7 +289,8 @@ print ''; print ''; } - print ''; + $var=!$var; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/hrm.php b/htdocs/compta/hrm.php index 12b410e29af60..4122f8507234c 100644 --- a/htdocs/compta/hrm.php +++ b/htdocs/compta/hrm.php @@ -71,37 +71,40 @@ print '
'; -/* - * Search expenses - */ + +if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) +{ + $langs->load("holiday"); + $listofsearchfields['search_holiday']=array('text'=>'TitreRequestCP'); +} if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { $langs->load("trips"); - print ''; - print ''; - print '
'.$langs->trans("Year").''.$langs->trans("NumberOfBills").'%
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).'
'; - print ''; - print ""; - print "'; - print ''; - //print "'; - print ''; - print "
'.$langs->trans("SearchATripAndExpense").'
:
:

"; + $listofsearchfields['search_deplacement']=array('text'=>'ExpenseReport'); } - if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { $langs->load("trips"); - print '
'; - print ''; - print ''; - print ''; - print ""; - print "'; - print ''; - //print "'; - print ''; - print "
'.$langs->trans("SearchATripAndExpense").'
:
:

"; + $listofsearchfields['search_expensereport']=array('text'=>'ExpenseReport'); +} +if (count($listofsearchfields)) +{ + print '
'; + print ''; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
'.$langs->trans("Search").'
:
'; + print '
'; + print '
'; } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 59ed9afc50426..fea0708e2a8d7 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -90,56 +90,40 @@ $max=3; -/* - * Search invoices - */ +// Search customer invoices if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - print '
'; - print ''; - print ''; - print ""; - print ''; - print "'; - print ''; - print "'; - print ''; - print "
'.$langs->trans("SearchACustomerInvoice").'
:
:

"; + $listofsearchfields['search_invoice']=array('text'=>'CustomerInvoice'); } - -/* - * Search supplier invoices - */ +// Search supplier invoices if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { - print '
'; - print ''; - print ''; - print ''; - print ""; - print "'; - print ''; - print "'; - print ''; - print "
'.$langs->trans("SearchASupplierInvoice").'
:
:

"; + $listofsearchfields['search_supplier_invoice']=array('text'=>'SupplierInvoice'); } - -/* - * Search donations - */ if (! empty($conf->don->enabled) && $user->rights->don->lire) { $langs->load("donations"); - print '
'; - print ''; - print ''; - print ''; - print ""; - print "'; - print ''; - //print "'; - print ''; - print "
'.$langs->trans("SearchADonation").'
:
:

"; + $listofsearchfields['search_donation']=array('text'=>'Donation'); +} + +if (count($listofsearchfields)) +{ + print '
'; + print ''; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
'.$langs->trans("Search").'
:
'; + print '
'; + print '
'; } /** diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index d44aef51dceda..c322863efc1ac 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -117,7 +117,7 @@ print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num); print '
'; - print ''; + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$params,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"dp","",$params,'align="center"',$sortfield,$sortorder); @@ -148,42 +148,52 @@ print ''; print "\n"; - $var=true; - while ($i < min($num,$limit)) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ""; - - // Num ref cheque - print ''; - - // Date - print ''; // TODO Use date hour - - // Bank - print ''; - - // Number of cheques - print ''; - - // Amount - print ''; - - // Statut - print '\n"; - $i++; - } + if ($num > 0) + { + $var=true; + while ($i < min($num,$limit)) + { + $objp = $db->fetch_object($resql); + $var=!$var; + print ""; + + // Num ref cheque + print ''; + + // Date + print ''; // TODO Use date hour + + // Bank + print ''; + + // Number of cheques + print ''; + + // Amount + print ''; + + // Statut + print '\n"; + $i++; + } + } + else + { + $var=!$var; + print ""; + print '"; + print ''; + } print "
'; - $checkdepositstatic->id=$objp->rowid; - $checkdepositstatic->ref=($objp->ref?$objp->ref:$objp->rowid); - $checkdepositstatic->statut=$objp->statut; - print $checkdepositstatic->getNomUrl(1); - print ''.dol_print_date($db->jdate($objp->dp),'day').''; - if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.''; - else print ' '; - print ''.$objp->nbcheque.''.price($objp->amount).''; - print $checkdepositstatic->LibStatut($objp->statut,5); - print "
'; + $checkdepositstatic->id=$objp->rowid; + $checkdepositstatic->ref=($objp->ref?$objp->ref:$objp->rowid); + $checkdepositstatic->statut=$objp->statut; + print $checkdepositstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->dp),'day').''; + if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.''; + else print ' '; + print ''.$objp->nbcheque.''.price($objp->amount).''; + print $checkdepositstatic->LibStatut($objp->statut,5); + print "
'.$langs->trans("None")."
"; print "
\n"; } @@ -192,6 +202,6 @@ dol_print_error($db); } -$db->close(); llxFooter(); +$db->close(); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 45c9d0b526b3b..35d0f838ff957 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -906,7 +906,7 @@ function getNomUrl($withpicto=0,$option='') if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->ref.$linkend; + if ($withpicto != 2) $result.=$link.($this->ref?$this->ref:$this->id).$linkend; return $result; } diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 8231f607ef7a7..6e3d31364ce92 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -305,6 +305,5 @@ dol_print_error($db); } -$db->close(); - llxFooter(); +$db->close(); diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 7907a55fda022..fa01e9c5e9e8e 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -61,7 +61,7 @@ if (empty($daterej)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } elseif ($daterej > dol_now()) @@ -74,7 +74,7 @@ if (GETPOST('motif','alpha') == 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefusedReason")), null, 'errors'); } if ( ! $error ) diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index cfcd0a6f746d0..920419a87691c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; $langs->load("companies"); if (! empty($conf->facture->enabled)) $langs->load("bills"); @@ -43,6 +44,7 @@ * View */ +$form = new Form($db); $userstatic=new User($db); llxHeader(); @@ -58,28 +60,7 @@ $head = societe_prepare_head($societe); dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); - - print "\n"; - print '
'; - - print ''; - - // Name - print ''; - - // Prefix - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - - print "
'.$langs->trans("Name").''.$societe->name.'
'.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print '
"; - - print "
\n"; - - print ''; + dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { @@ -87,6 +68,18 @@ print load_fiche_titre($langs->trans("CustomerPreview")); print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $TData = array(); + $TDataSort = array(); $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,"; $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; @@ -95,7 +88,7 @@ $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.fk_user_valid = u.rowid"; - $sql.= " ORDER BY f.datef DESC"; + $sql.= " ORDER BY f.datef ASC"; $resql=$db->query($sql); if ($resql) @@ -103,23 +96,6 @@ $var=true; $num = $db->num_rows($resql); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - if (! $num > 0) - { - print ''; - } - - $solde = 0; - // Boucle sur chaque facture for ($i = 0 ; $i < $num ; $i++) { @@ -133,29 +109,18 @@ continue; } $totalpaye = $fac->getSommePaiement(); - - $var=!$var; - print ""; - - print "\n"; - print '\n"; - - print ''; - print '\n"; - if (($fac->statut == Facture::STATUS_ABANDONED ) || ($fac->statut == Facture::STATUS_CLOSED && ! $fact->close_code) ) $solde = $solde = $solde + $totalpaye; - else $solde = $solde + $fac->total_ttc; - - print ''; - print '\n"; - - // Author + $userstatic->id=$objf->userid; $userstatic->login=$objf->login; - print ''; - - print "\n"; + + $TData[] = array( + 'date' => $fac->date, + 'link' => $fac->getNomUrl(1), + 'status' => $fac->getLibStatut(2,$totalpaye), + 'amount' => $fac->total_ttc, + 'author' => $userstatic->getLoginUrl(1) + ); + $TDataSort[] = $fac->date; // Paiements $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,"; @@ -166,6 +131,7 @@ $sql.= " WHERE pf.fk_paiement = p.rowid"; $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND pf.fk_facture = ".$fac->id; + $sql.= " ORDER BY p.datep ASC"; $resqlp = $db->query($sql); if ($resqlp) @@ -176,26 +142,21 @@ while ($j < $nump) { $objp = $db->fetch_object($resqlp); - //$var=!$var; - print ""; - print '\n"; - print ''; - print "\n"; - print "\n"; - print ''; - $solde = $solde - $objp->amount; - print '\n"; - - // Author + + $paymentstatic = new Paiement($db); + $paymentstatic->id = $objp->rowid; + $userstatic->id=$objp->userid; $userstatic->login=$objp->login; - print ''; - - print ''; + + $TData[] = array( + 'date' => $db->jdate($objp->dp), + 'link' => $langs->trans("Payment") .' '. $paymentstatic->getNomUrl(1), + 'status' => '', + 'amount' => -$objp->amount, + 'author' => $userstatic->getLoginUrl(1) + ); + $TDataSort[] = $db->jdate($objp->dp); $j++; } @@ -212,9 +173,63 @@ { dol_print_error($db); } + + if(empty($TData)) { + print ''; + } else { + + // Sort array by date + asort($TDataSort); + array_multisort($TData,$TDataSort); + + // Balance calculation + foreach($TData as &$data1) { + $balance += $data1['amount']; + $data1['balance'] += $balance; + } + + // Reverse array to have last elements on top + $TData = array_reverse($TData); + + $totalDebit = 0; + $totalCredit = 0; + + // Display array + foreach($TData as $data) { + $var=!$var; + print ""; + + print "\n"; + print '\n"; + + print ''; + print '\n"; + $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; + print '\n"; + $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); + print '\n"; + + // Author + print ''; + + print "\n"; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + print "
'.$langs->trans("Date").''.$langs->trans("Element").''.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").''.$langs->trans("Author").'
'.$langs->trans("Date").' '.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
'.$langs->trans("NoInvoice").'
".dol_print_date($fac->date,'day')."'.img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2,$totalpaye).''.price($fac->total_ttc)." '.price($solde)."'; - print $userstatic->getLoginUrl(1); - print '
'.dol_print_date($db->jdate($objp->dp),'day')."'; - print '      '; // Decalage - print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'  '.price($objp->amount).''.price($solde)."'; - print $userstatic->getLoginUrl(1); - print '
'.$langs->trans("NoInvoice").'
".dol_print_date($data['date'],'day')."'.$data['link']."'.$data['status'].''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.price($data['balance'])."'; + print $data['author']; + print '
 '.price($totalDebit).''.price($totalCredit).' 
"; print "
"; } + + print ''; } else { diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 04fc8db5b286c..e658633e7b004 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -92,27 +92,27 @@ if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if (empty($object->fk_user) || $object->fk_user < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Employee")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Employee")), null, 'errors'); $error++; } if (empty($object->type_payment) || $object->type_payment < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } if (empty($object->amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } if (! empty($conf->banque->enabled) && ! $object->accountid > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Account")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); $error++; } diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 29606fa6a9aac..780598fc0732a 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -79,26 +79,26 @@ { $dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear')); $dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear')); - $amount=GETPOST('amount'); + $amount=price2num(GETPOST('amount')); $actioncode=GETPOST('actioncode'); if (! $dateech) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); $action = 'create'; } elseif (! $dateperiod) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'create'; } elseif (! $actioncode > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); $action = 'create'; } elseif (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } elseif (! is_numeric($amount)) @@ -114,7 +114,7 @@ $chargesociales->lib=GETPOST('label'); $chargesociales->date_ech=$dateech; $chargesociales->periode=$dateperiod; - $chargesociales->amount=price2num($amount); + $chargesociales->amount=$amount; $id=$chargesociales->create($user); if ($id <= 0) @@ -130,23 +130,28 @@ { $dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear')); $dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear')); - $amount=GETPOST('amount'); + $amount=price2num(GETPOST('amount')); if (! $dateech) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); $action = 'edit'; } elseif (! $dateperiod) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'edit'; } elseif (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'edit'; } - else + elseif (! is_numeric($amount)) + { + setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors'); + $action = 'create'; + } + else { $chargesociales=new ChargeSociales($db); $result=$chargesociales->fetch($id); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 385ac1f140c94..cb8151cf33c33 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -280,7 +280,7 @@ $sortorder ); } else { - print '
'; - // Ref - print ''; - + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + } + // Lastname print ''; print ''; @@ -1040,23 +1045,32 @@ } - print '
'.$langs->trans("Ref").''; - print $object->ref; - print '
'.$langs->trans("ID").''; + print $object->ref; + print '
lastname).'" autofocus="autofocus">
'; - $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
'; + print '
'; + + print '
'; + print '
'; + // Ref - print ''; // Name print ''; print ''; - + */ + // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''; } - + */ + print ''; // Civility - print ''; // Role - print ''; + print ''; // Address + /* print ''; @@ -1112,68 +1129,72 @@ // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; - } + print ''; + }*/ // Phone + /* print ''; print ''; print ''; print ''; - + */ + // Email - print ''; + //print ''; if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; - print ''; + print ''; + print ''; } - else - { - print ''; - } - print ''; // Instant message and no email - print ''; + print ''; if (!empty($conf->mailing->enabled)) { - print ''; + print ''; } - else - { - print ''; - } - print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; } - print ''; // Note Public - print ''; // Note Private - print ''; + print ''; + */ + + print '
'.$langs->trans("Ref").''; + /*print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'id', $linkback); print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("ThirdParty").''; + print '
'.$langs->trans("ThirdParty").''; if ($object->socid > 0) { $objsoc->fetch($object->socid); @@ -1070,6 +1084,7 @@ } // Photo + /* if ($object->photo) { print ''; @@ -1080,18 +1095,20 @@ print ' '; print '
'.$langs->trans("UserTitle").''; + print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print '
'.$langs->trans("PostOrFunction").''.$object->poste.'
'.$langs->trans("PostOrFunction").''.$object->poste.'
'.$langs->trans("Address").''; dol_print_address($object->address,'gmap','contact',$object->id); print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans('State').''.$object->state.'
'.$langs->trans("PhonePro").''.dol_print_phone($object->phone_pro,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->country_code,$object->id,$object->socid,'AC_TEL').'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->country_code,$object->id,$object->socid,'AC_FAX').'
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'
'.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().'
'.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().'
 
'.$langs->trans("IM").''.$object->jabberid.'
'.$langs->trans("IM").''.$object->jabberid.'
'.$langs->trans("No_Email").''.yn($object->no_email).'
'.$langs->trans("No_Email").''.yn($object->no_email).'
 
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("ContactVisibility").''; + print '
'.$langs->trans("ContactVisibility").''; print $object->LibPubPriv($object->priv); print '
'.$langs->trans("NotePublic").''; + /* + print '
'.$langs->trans("NotePublic").''; print nl2br($object->note_public); print '
'.$langs->trans("NotePrivate").''; + print '
'.$langs->trans("NotePrivate").''; print nl2br($object->note_private); - - // Statut - print '
'.$langs->trans("Status").'
'; + + print ''; + print '
'; + + print '
'; + print ''; + + // Statut + /*print ''; print ''; print ''."\n"; - + */ + // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { print ''; @@ -1240,7 +1261,10 @@ print ''; print "
'.$langs->trans("Status").''; print $object->getLibStatut(4); print '
' . $langs->trans( "Categories" ) . '
"; - + + print '
'; + print '
'; + print dol_fiche_end(); // Barre d'actions diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 33864376ac386..723784d9a5d7c 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -908,7 +908,7 @@ function getNbOfEMailings() */ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') { - global $langs; + global $conf, $langs; $result=''; $label = '' . $langs->trans("ShowContact") . ''; @@ -923,7 +923,14 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist); $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs); - $link = ''; + $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowContact"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip">'; $linkend=''; if ($option == 'xxx') @@ -1144,12 +1151,14 @@ public function setCategories($categories) // Process foreach ($to_del as $del) { - $c->fetch($del); - $c->del_type($this, 'contact'); + if ($c->fetch($del) > 0) { + $c->del_type($this, 'contact'); + } } foreach ($to_add as $add) { - $c->fetch($add); - $c->add_type($this, 'contact'); + if ($c->fetch($add) > 0) { + $c->add_type($this, 'contact'); + } } return; diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 81f9b2a29be48..6cf3daf5caddb 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -74,8 +74,10 @@ $form = new Form($db); +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname; $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader("",$langs->trans("Contact"), $helpurl); +llxHeader('', $title, $helpurl); if ($object->id) { @@ -93,16 +95,14 @@ $totalsize+=$file['size']; } - print ''; - - // Ref - print ''; - - // Name - print ''; - print ''; + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback); - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) @@ -123,12 +123,19 @@ } } + // Civility + print ''; + print ''; print ''; print '
'.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; print ''; + dol_fiche_end(); + $modulepart = 'contact'; $permission = $user->rights->societe->contact->creer; $param = '&id=' . $object->id; diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index 3ad4f0779af2f..0250691e88ddf 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -32,36 +32,50 @@ // Security check -$contactid = GETPOST("id",'int'); +$id = GETPOST("id",'int'); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); -$contact = new Contact($db); +$object = new Contact($db); /* * View */ + +$form=new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -if ($contactid > 0) +if ($id > 0) { - $result = $contact->fetch($contactid, $user); + $result = $object->fetch($id, $user); - $contact->info($contactid); + $object->info($id); - $head = contact_prepare_head($contact); + $head = contact_prepare_head($object); dol_fiche_head($head, 'info', $title, 0, 'contact'); - // TODO Put here ref of card + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
'; + + print '
'; - dol_print_object_info($contact); + print '
'; + + dol_print_object_info($object); + print '
'; + dol_fiche_end(); } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 9a8fde8e14f21..2ec187eafc6e3 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -39,10 +39,10 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); -$contact = new Contact($db); +$object = new Contact($db); if ($id > 0) { - $contact->fetch($id, $user); + $object->fetch($id, $user); } @@ -57,8 +57,8 @@ $ldap=new Ldap(); $result=$ldap->connect_bind(); - $info=$contact->_load_ldap_info(); - $dn=$contact->_load_ldap_dn($info); + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro $result=$ldap->update($dn,$info,$user,$olddn); @@ -86,40 +86,35 @@ $form = new Form($db); -$head = contact_prepare_head($contact); +$head = contact_prepare_head($object); dol_fiche_head($head, 'ldap', $title, 0, 'contact'); +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + +print '
'; -print ''; - -// Ref -print ''; - -// Name -print ''; -print ''; +print '
'; +print '
'.$langs->trans("Ref").''; -print $form->showrefnav($contact,'id'); -print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$contact->lastname.''.$langs->trans("Firstname").''.$contact->firstname.'
'; // Company -if ($contact->socid > 0) +if ($object->socid > 0) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + $thirdparty = new Societe($db); + $thirdparty->fetch($object->socid); - print ''; + print ''; } else { - print ''; } // Civility -print ''; // LDAP DN @@ -135,6 +130,8 @@ print '
'.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).'
'.$langs->trans("ThirdParty").''.$thirdparty->getNomUrl(1).'
'.$langs->trans("ThirdParty").''; + print '
'.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print '
'.$langs->trans("UserTitle").''; -print $contact->getCivilityLabel(); +print '
'.$langs->trans("UserTitle").''; +print $object->getCivilityLabel(); print '
'; +print '
'; + dol_fiche_end(); @@ -146,7 +143,7 @@ if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') { - print ''.$langs->trans("ForceSynchronize").''; + print ''.$langs->trans("ForceSynchronize").''; } print "\n"; @@ -170,9 +167,9 @@ $result=$ldap->connect_bind(); if ($result > 0) { - $info=$contact->_load_ldap_info(); - $dn=$contact->_load_ldap_dn($info,1); - $search = "(".$contact->_load_ldap_dn($info,2).")"; + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info,1); + $search = "(".$object->_load_ldap_dn($info,2).")"; $records=$ldap->getAttribute($dn,$search); //var_dump($records); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 300a06acca6e9..2a1163111ed4e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -40,6 +40,7 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $contactid,''); +$sall=GETPOST("sall"); $search_firstlast_only=GETPOST("search_firstlast_only"); $search_lastname=GETPOST("search_lastname"); $search_firstname=GETPOST("search_firstname"); @@ -56,13 +57,13 @@ $search_categ=GETPOST("search_categ",'int'); $search_status=GETPOST("search_status",'int'); if ($search_status=='') $search_status=1; // always display activ customer first + $optioncss = GETPOST('optioncss','alpha'); $type=GETPOST("type"); $view=GETPOST("view"); -$sall=GETPOST("contactname"); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -98,8 +99,9 @@ $urlfiche=""; } -if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter')) // Both tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter')) // All tests are required to be compatible with all browsers { + $sall=""; $search_firstlast_only=""; $search_lastname=""; $search_firstname=""; @@ -113,11 +115,17 @@ $search_email=""; $search_skype=""; $search_priv=""; - $sall=""; $seach_status=1; } if ($search_priv < 0) $search_priv=''; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.lastname'=>'Lastname', + 'p.firstname'=>'Firstname', + 'p.email'=>'EMail', + 's.nom'=>"ThirdParty", +); /* @@ -225,7 +233,7 @@ } if ($sall) { - $sql .= natural_search(array('p.lastname', 'p.firstname', 'p.email', 's.nom'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if (! empty($socid)) { @@ -241,13 +249,13 @@ // Add order and limit if($view == "recent") { - $sql.= " ORDER BY p.datec DESC "; - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); + $sql.= $db->order("p.datec","DESC"); + $sql.= $db->plimit($conf->liste_limit+1, $offset); } else { - $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); + $sql.= $db->order($sortfield,$sortorder); + $sql.= $db->plimit($conf->liste_limit+1, $offset); } //print $sql; @@ -276,29 +284,32 @@ print ''; print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + if ($search_firstlast_only) + { + print $langs->trans("FilterOnInto", $search_firstlast_only, $langs->trans("Lastname").", ".$langs->trans("Firstname")); + } + if (! empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1); - $moreforfilter.='       '; + $moreforfilter.='
'; } if ($moreforfilter) { - print '
'; + print '
'; print $moreforfilter; print '
'; } - if ($sall) - { - print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("ThirdParty")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; - } - if ($search_firstlast_only) - { - print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")."): ".$search_firstlast_only; - } - print ''; + print '
'; // Ligne des titres print ''; diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 457f794438ec8..761efcfa84061 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -55,12 +55,14 @@ * View */ +$now=dol_now(); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $form = new Form($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$title,$help_url); +llxHeader('', $title, $help_url); if ($id > 0) { @@ -77,18 +79,16 @@ print ''; print ''; - print '
'; - + $linkback = ''.$langs->trans("BackToList").''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + print '
'; + + print '
'; + print '
'; - // Ref - print ''; - - // Name - print ''; - print ''; + $linkback = ''.$langs->trans("BackToList").''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) @@ -110,7 +110,7 @@ } // Civility - print ''; @@ -120,7 +120,7 @@ { include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback); - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("UserTitle").''; + print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print '
'.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); + print ''.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); print '   '; //var_dump($birthdatearray); @@ -144,9 +144,11 @@ print "
"; + print '
'; + print '
'; - $colwidth='20'; + $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 8f4e97e690de4..8bebb6f0cfb13 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -70,8 +70,9 @@ $now=dol_now(); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); - -llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname; +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $helpurl); $form = new Form($db); @@ -155,21 +156,17 @@ } else { - /* - * Fiche en mode visu - */ - print ''; - + // View mode + $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Name - print ''; - print ''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback); - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) @@ -191,7 +188,7 @@ } // Civility - print ''; @@ -225,6 +222,7 @@ print "
'.$langs->trans("UserTitle").''; + print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print '
"; + print '
'; } dol_fiche_end(); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5615eaf76a4da..4ef6556a6dd5f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -125,7 +125,7 @@ if (! GETPOST('dateend')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (! $error) { @@ -206,13 +206,13 @@ if (empty($datecontrat)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action='create'; } if ($socid<1) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action='create'; $error++; } @@ -237,6 +237,7 @@ $object->fk_project = GETPOST('projectid','int'); $object->remise_percent = GETPOST('remise_percent','alpha'); $object->ref = GETPOST('ref','alpha'); + $object->ref_customer = GETPOST('ref_customer','alpha'); $object->ref_supplier = GETPOST('ref_supplier','alpha'); // If creation from another object of another module (Example: origin=propal, originid=1) @@ -418,12 +419,12 @@ 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++; } @@ -745,9 +746,11 @@ } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } - } else if ($action == 'update_extras') { + } + else if ($action == 'update_extras') + { // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); @@ -767,9 +770,10 @@ $action = 'edit_extras'; setEventMessage($object->error,'errors'); } - } elseif ($action=='setref_supplier') { + } + elseif ($action=='setref_supplier') + { $cancelbutton = GETPOST('cancel'); - if (!$cancelbutton) { $result = $object->fetch($id); @@ -790,7 +794,34 @@ header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); exit; } - } elseif ($action=='setref') { + } + elseif ($action=='setref_customer') + { + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) + { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + + $result = $object->setValueFrom('ref_customer',GETPOST('ref_customer','alpha')); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref_customer'; + } else { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } + } + elseif ($action=='setref') + { $cancelbutton = GETPOST('cancel'); if (!$cancelbutton) { @@ -1001,14 +1032,18 @@ } print '
'.$langs->trans('Ref').''.$tmpcode.'
'.$langs->trans('RefCustomer').'
'.$langs->trans('RefSupplier').'
'.$langs->trans('Customer').''.$langs->trans('Thirdparty').''; print $soc->getNomUrl(1); @@ -1018,7 +1053,7 @@ else { print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); + print $form->select_company('','socid','',1); print '
'; + print $form->editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer); + print ''; + print $form->editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer); + print '
'; print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer); print ''; @@ -1407,26 +1450,19 @@ print ''; if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) { - print ''; + print ''; print img_picto($langs->trans("MoveToAnotherContract"),'uparrow'); print ''; } - else { - print ' '; - } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } - else { - print ' '; - } if ( $user->rights->contrat->creer && ($object->statut >= 0)) { - print ' '; - print ''; + print ''; print img_delete(); print ''; } @@ -1599,7 +1635,7 @@ 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); print '
'; } @@ -1611,7 +1647,7 @@ $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $comment = GETPOST('comment'); - $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); print '
'; } @@ -1623,7 +1659,7 @@ $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $comment = GETPOST('comment'); - $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); print '
'; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 6fa4e5c46a868..1d2bd9f418127 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -50,6 +50,12 @@ class Contrat extends CommonObject */ protected $table_ref_field = 'ref'; + /** + * Customer reference of the contract + * @var string + */ + var $ref_customer; + /** * Supplier reference of the contract * @var string @@ -369,7 +375,7 @@ function validate($user, $force_number='', $notrigger=0) $result=$this->thirdparty->set_as_client(); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->thirdparty); } @@ -476,13 +482,13 @@ function validate($user, $force_number='', $notrigger=0) function fetch($id,$ref='') { $sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,"; + $sql.= " ref_supplier, ref_customer,"; + $sql.= " ref_ext,"; $sql.= " fk_user_mise_en_service, date_contrat as datecontrat,"; $sql.= " fk_user_author,"; $sql.= " fk_projet,"; $sql.= " fk_commercial_signature, fk_commercial_suivi,"; $sql.= " note_private, note_public, model_pdf, extraparams"; - $sql.= " ,ref_supplier"; - $sql.= " ,ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat"; if ($ref) { @@ -501,6 +507,7 @@ function fetch($id,$ref='') { $this->id = $result["rowid"]; $this->ref = (!isset($result["ref"]) || !$result["ref"]) ? $result["rowid"] : $result["ref"]; + $this->ref_customer = $result["ref_customer"]; $this->ref_supplier = $result["ref_supplier"]; $this->ref_ext = $result["ref_ext"]; $this->statut = $result["statut"]; @@ -839,7 +846,7 @@ function create($user) // Insert contract $sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,"; $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; - $sql.= " ref, entity, note_private, note_public, ref_supplier, ref_ext)"; + $sql.= " ref, entity, note_private, note_public, ref_customer, ref_supplier, ref_ext)"; $sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id; $sql.= ", '".$this->db->idate($this->date_contrat)."'"; $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); @@ -849,6 +856,7 @@ function create($user) $sql.= ", ".$conf->entity; $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); + $sql.= ", ".(!empty($this->ref_customer)?("'".$this->db->escape($this->ref_customer)."'"):"NULL"); $sql.= ", ".(!empty($this->ref_supplier)?("'".$this->db->escape($this->ref_supplier)."'"):"NULL"); $sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL"); $sql.= ")"; @@ -1101,6 +1109,7 @@ function update($user=null, $notrigger=0) // Clean parameters if (isset($this->ref)) $this->ref=trim($this->ref); + if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer); if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier); if (isset($this->ref_ext)) $this->ref_ext=trim($this->ref_ext); if (isset($this->entity)) $this->entity=trim($this->entity); @@ -1125,6 +1134,7 @@ function update($user=null, $notrigger=0) $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET"; $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " ref_customer=".(isset($this->ref_customer)?"'".$this->db->escape($this->ref_customer)."'":"null").","; $sql.= " ref_supplier=".(isset($this->ref_supplier)?"'".$this->db->escape($this->ref_supplier)."'":"null").","; $sql.= " ref_ext=".(isset($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null").","; $sql.= " entity=".$conf->entity.","; @@ -1251,7 +1261,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_pr $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,'', $localtaxes_type); + $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]; $total_ttc = $tabprice[2]; @@ -1332,7 +1342,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_pr if (empty($error)) { // Call trigger - $result=$this->call_trigger('LINECONTRACT_CREATE',$user); + $result=$this->call_trigger('LINECONTRACT_INSERT',$user); if ($result < 0) { $this->db->rollback(); @@ -1424,7 +1434,7 @@ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $dat $localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type); + $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]; $total_ttc = $tabprice[2]; @@ -2024,6 +2034,8 @@ function initAsSpecimen() $this->specimen=1; $this->ref = 'SPECIMEN'; + $this->ref_customer = 'SPECIMENCUST'; + $this->ref_supplier = 'SPECIMENSUPP'; $this->socid = 1; $this->statut= 0; $this->date_contrat = dol_now(); @@ -2416,7 +2428,7 @@ function fetch($id, $ref='') */ function update($user, $notrigger=0) { - global $conf, $langs; + global $conf, $langs, $mysoc; $error=0; @@ -2458,7 +2470,9 @@ function update($user, $notrigger=0) // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1); + $localtaxes_type = getLocalTaxesFromRate($this->txtva, 0, $this->societe, $mysoc); + + $tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1, $mysoc, $localtaxes_type); $this->total_ht = $tabprice[0]; $this->total_tva = $tabprice[1]; $this->total_ttc = $tabprice[2]; @@ -2644,7 +2658,7 @@ public function insert($notrigger = 0) if (!$notrigger) { // Call trigger - $result = $this->call_trigger('LINECONTRACT_CREATE', $user); + $result = $this->call_trigger('LINECONTRACT_INSERT', $user); if ($result < 0) { $this->db->rollback(); return -1; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 3a7b5667db5b8..c3972bab2f77a 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -79,12 +79,10 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; print "
'.$langs->trans("SearchAContract").'
'.$langs->trans("Search").'
'.$langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Contract").':
\n"; print "
"; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 97d20e2acb18a..3751906d9fefe 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,11 +1,11 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,8 +49,10 @@ $sall=GETPOST('sall'); $search_status=GETPOST('search_status'); $socid=GETPOST('socid'); +$search_user=GETPOST('search_user','int'); +$search_sale=GETPOST('search_sale','int'); +$search_product_category=GETPOST('search_product_category','int'); -$search_sale = GETPOST('search_sale','int'); $optioncss = GETPOST('optioncss','alpha'); if (! $sortfield) $sortfield="c.rowid"; @@ -69,26 +71,40 @@ $search_name=""; $search_contract=""; $search_ref_supplier=""; - $search_sale=""; + $search_user=''; + $search_sale=''; + $search_product_category=''; $sall=""; $search_status=""; } if ($search_status == '') $search_status=1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'c.ref'=>'Ref', + 'c.ref_customer'=>'RefCustomer', + 'c.ref_supplier'=>'RefSupplier', + 's.nom'=>"ThirdParty", + 'cd.description'=>'Description', + 'c.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; + /* * View */ $now=dol_now(); +$form=new Form($db); $formother = new FormOther($db); $socstatic = new Societe($db); llxHeader(); $sql = 'SELECT'; -$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,"; +$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; @@ -99,8 +115,15 @@ if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; +if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; +if ($search_user > 0) +{ + $sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; + $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; +} $sql.= " WHERE c.fk_soc = s.rowid "; -$sql.= " AND c.entity = ".$conf->entity; +$sql.= ' AND c.entity IN ('.getEntity('contract', 1).')'; +if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -120,8 +143,9 @@ } if ($sall) { - $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } +if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit + 1, $offset); @@ -136,26 +160,57 @@ print '
'; if ($optioncss != '') print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); + $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='       '; + $moreforfilter.='
'; } - - if ($moreforfilter) + // If the user can view other users + if ($user->rights->user->user->lire) + { + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.='
'; + } + // If the user can view categories of products + if ($conf->categorie->enabled && $user->rights->produit->lire) + { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.='
'; + } + + if (! empty($moreforfilter)) { - print ''; - print ''; + print '
'; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; } + print '
'; - print $moreforfilter; - print '
'; print ''; $param='&search_contract='.$search_contract; @@ -165,16 +220,18 @@ if ($optioncss != '') $param.='&optioncss='.$optioncss; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SalesRepresentative"), $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder); - print ''; - print ''; - print ''; - print ''; + print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"'); + print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; print ''; @@ -183,14 +240,18 @@ print ''; print ''; print ''; + print ''; print ''; print ''; //print ''; - print ''; + print '\n"; @@ -204,6 +265,7 @@ print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .''; if ($obj->nb_late) print img_warning($langs->trans("Late")); print ''; + print ''; print ''; print ''; //print ''; @@ -230,9 +292,10 @@ $userstatic->id=$val['id']; $userstatic->lastname=$val['lastname']; $userstatic->firstname=$val['firstname']; - print $userstatic->getNomUrl(1); + print '
'.$userstatic->getNomUrl(1); $j++; - if ($j < $nbofsalesrepresentative) print '
'; + if ($j < $nbofsalesrepresentative) print ', '; + print '
'; } } else print $langs->trans("NoSalesRepresentativeAffected"); @@ -250,6 +313,7 @@ print ''; print ''; print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/core/actions_changeselectedfields.inc.php b/htdocs/core/actions_changeselectedfields.inc.php new file mode 100644 index 0000000000000..11884f812249c --- /dev/null +++ b/htdocs/core/actions_changeselectedfields.inc.php @@ -0,0 +1,48 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_changeselectedfields.inc.php + * \brief Code for actions when we change list of fields on a list page + */ + + +// $action must be defined +// $db must be defined +// $conf must be defined +// $object must be defined (object is loaded in this file with fetch) + +// Save selection +if (GETPOST('formfilteraction') == 'listafterchangingselectedfields') +{ + $tabparam=array(); + + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + + if (GETPOST("selectedfields")) $tabparam["MAIN_SELECTEDFIELDS_".$varpage]=GETPOST("selectedfields"); + else $tabparam["MAIN_SELECTEDFIELDS_".$varpage]=''; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + $result=dol_set_user_param($db, $conf, $user, $tabparam); + + //$action='list'; + //var_dump($tabparam);exit; +} + + diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 67458fd401d7a..a4e83a0fd59cb 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -56,7 +56,7 @@ $upload_dir_tmp = $vardir.'/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); + dol_remove_file_process(GETPOST('removedfile','alpha'),0); $action='presend'; } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 1783c4794b5eb..f4db125ca7859 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -37,12 +37,103 @@ $search_boxvalue=GETPOST('q'); -$arrayresult=array('a'=>'aaaa', 'b'=>'bbbb'); +$arrayresult=array(); -if ($conf->projet->enabled) +// Define $searchform +if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { - $arrayresult['searchintoproject']=$langs->trans("SearchIntoProject", $search_boxvalue); + $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } + +if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) +{ + $arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); +} + +if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) +&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) +{ + $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) +{ + $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); +} + +if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) +{ + $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire) +{ + $arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) +{ + $arrayresult['searchintoinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) +{ + $arrayresult['searchintoorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) +{ + $arrayresult['searchintopropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire) +{ + $arrayresult['searchintosupplierinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue)); +} +if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire) +{ + $arrayresult['searchintosupplierorder']=array('text'=>img_picto('','object_propal').' '.$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) +{ + $arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/askpricesupplier/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) +{ + $arrayresult['searchintointervention']=array('text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); +} +if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) +{ + $arrayresult['searchintocontract']=array('text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); +} + + +/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag +if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) +{ + $langs->load("hrm"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); +} +*/ + +// Execute hook addSearchEntry +$parameters=array(); +$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters); +if (empty($reshook)) +{ + $arrayresult=array_merge($arrayresult, $hookmanager->resArray); +} +else $arrayresult=$hookmanager->resArray; + + + + + + + + + print json_encode($arrayresult); if (is_object($db)) $db->close(); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 18a09af6ace01..a1fc2768ba165 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -63,8 +63,9 @@ function loadBox($max=5) if ($user->rights->societe->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; - $sql.= ", s.nom as socname"; - $sql.= ", s.code_client"; + $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile"; + $sql.= ", s.nom as socname, s.name_alias"; + $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -93,10 +94,21 @@ function loadBox($max=5) $contactstatic->firstname=$objp->firstname; $contactstatic->civility_id=$objp->civility_id; $contactstatic->statut=$objp->status; - $societestatic->id = $objp->fk_soc; - $societestatic->code_client = $objp->code_client; + $contactstatic->phone_pro = $objp->phone; + $contactstatic->phone_perso = $objp->phone_perso; + $contactstatic->phone_mobile = $objp->phone_mobile; + $contactstatic->address = $objp->address; + $contactstatic->zip = $objp->zip; + $contactstatic->town = $objp->town; + + $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname; - + $societestatic->name_alias = $objp->name_alias; + $societestatic->code_client = $objp->code_client; + $societestatic->code_fournisseur = $objp->code_fournisseur; + $societestatic->client = $objp->client; + $societestatic->fournisseur = $objp->fournisseur; + $this->info_box_contents[$line][] = array( 'td' => 'align="left"', 'text' => $contactstatic->getNomUrl(1), diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 703d35b408be8..771547686ea97 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -104,7 +104,7 @@ function loadBox($max=5) 'td' => 'align="left"', 'text' => $objp->ref, 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid, + 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid, ); $this->info_box_contents[$i][2] = array( diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index d6a65884ffb5b..97767dd15d189 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -82,52 +82,51 @@ function loadBox($max=5) $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; - $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' "; + $sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'"; $sql.= " AND pt.rowid = ptt.fk_task"; $sql.= " GROUP BY pt.fk_statut "; $sql.= " ORDER BY pt.fk_statut DESC"; $sql.= $db->plimit($max, 0); $result = $db->query($sql); - - if ($result) { + if ($result) + { $num = $db->num_rows($result); $i = 0; - while ($i < $num) { - $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask'); - + while ($i < $num) + { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), + 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => $objp->nb." ".$langs->trans("Tasks"), 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut, ); $totalnb += $objp->nb; - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); $totalplannedtot += $objp->plannedtot; - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); $totaldurationtot += $objp->durationtot; - $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); + $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); $i++; } } + else dol_print_error($this->db); } // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); - $this->info_box_contents[$i][1] = array('td' => '', 'text' => ""); - $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); - $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); - $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); - $this->info_box_contents[$i][5] = array('td' => '', 'text' => ""); + $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => '', 'text' => ""); } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 41ae45ef638d4..24c2fe34a93f9 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -388,11 +388,16 @@ function get_substitutionarray_object($object,$outputlangs,$array_key='object') // Add vat by rates foreach ($object->lines as $line) { + // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); + // $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example) + $vatformated=vatrate($line->tva_tx); + if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; + $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; + $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); } - // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bfa1595197e3b..d5dac206e15ea 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -434,6 +434,109 @@ function getFullAddress($withcountry=0,$sep="\n") } + /** + * Return full address of contact + * + * @param string $htmlkey HTML id to make banner content unique + * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) + * @return string Full address string + */ + function getBannerAddress($htmlkey, $object) + { + global $conf, $langs; + + $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); + + $contactid=0; + $thirdpartyid=0; + if ($this->element == 'societe') + { + $thirdpartyid=$this->id; + } + if ($this->element == 'contact') + { + $contactid=$this->id; + $thirdpartyid=$object->fk_soc; + } + if ($this->element == 'user') + { + $contactid=$this->contact_id; + $thirdpartyid=$object->fk_soc; + } + + $out=''; + + $outdone=0; + $coords = $this->getFullAddress(1,', '); + if ($coords) + { + if (! empty($conf->use_javascript_ajax)) + { + $namecoords = $this->getFullName($langs,1).'
'.$coords; + // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile + $out.=''; + $out.=img_picto($langs->trans("Address"), 'object_address.png'); + $out.=' '; + } + $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++; + $outdone++; + } + + if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) + && ! empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) + { + $out.=($outdone?'
':'').$this->state; + $outdone++; + } + + if (! empty($this->phone_pro) || ! empty($this->phone_mobile) || ! empty($this->phone_perso) || ! empty($this->fax) || ! empty($this->office_phone) || ! empty($this->user_mobile) || ! empty($this->office_fax)) $out.=($outdone?'
':''); + if (! empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone + $out.=dol_print_phone($this->phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + } + if (! empty($this->phone_pro)) { + $out.=dol_print_phone($this->phone_pro,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + } + if (! empty($this->phone_mobile)) { + $out.=dol_print_phone($this->phone_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; + } + if (! empty($this->phone_perso)) { + $out.=dol_print_phone($this->phone_perso,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePerso")); $outdone++; + } + if (! empty($this->fax)) { + $out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; + } + if (! empty($this->office_phone)) { + $out.=dol_print_phone($this->office_phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + } + if (! empty($this->user_mobile)) { + $out.=dol_print_phone($this->user_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; + } + if (! empty($this->office_fax)) { + $out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; + } + + $out.='
'; + $outdone=0; + if (! empty($this->email)) + { + $out.=dol_print_email($this->email,$this->id,$object->id,'AC_EMAIL',0,0,1); + $outdone++; + } + if (! empty($this->url)) + { + $out.=dol_print_url($this->url,'',0,1); + $outdone++; + } + if (! empty($conf->skype->enabled)) + { + if ($this->skype) $out.=($outdone?'
':'').dol_print_skype($this->skype,$this->id,$object->id,'AC_SKYPE'); + } + + $out.=''; + + return $out; + } + /** * Add a link between element $this->element and a contact * @@ -1404,6 +1507,36 @@ function setShippingMethod($shipping_method_id) } + /** + * Change the warehouse + * + * @param int $warehouse_id Id of warehouse + * @return int 1 if OK, 0 if KO + */ + function setWarehouse($warehouse_id) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setWarehouse was called on objet with property table_element not defined",LOG_ERR); + return -1; + } + if ($warehouse_id<0) $warehouse_id='NULL'; + dol_syslog(get_class($this).'::setWarehouse('.$warehouse_id.')'); + + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; + $sql.= " SET fk_warehouse = ".$warehouse_id; + $sql.= " WHERE rowid=".$this->id; + + if ($this->db->query($sql)) { + $this->warehouse_id = ($warehouse_id=='NULL')?null:$warehouse_id; + return 1; + } else { + dol_syslog(get_class($this).'::setWarehouse Error ', LOG_DEBUG); + $this->error=$this->db->error(); + return 0; + } + } + + /** * Set last model used by doc generator * @@ -2128,13 +2261,18 @@ function add_object_linked($origin=null, $origin_id=null) /** * Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds - * - * @param int $sourceid Object source id - * @param string $sourcetype Object source type - * @param int $targetid Object target id - * @param string $targettype Object target type + * Possible usage for parameters: + * - all parameters empty -> we look all link to current object (current object can be source or target) + * - one couple id+type is provided -> this will set $justsource or $justtarget + * - one couple id+type is provided and other type is provided -> this will set $justsource or $justtarget + criteria on other type + * + * + * @param int $sourceid Object source id (if not defined, id of object) + * @param string $sourcetype Object source type (if not defined, element name of object) + * @param int $targetid Object target id (if not defined, id of object) + * @param string $targettype Object target type (if not defined, elemennt name of object) * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided - * @param int $alsosametype 0=Return only links to different object than source. 1=Include also link to objects of same type. + * @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type. * @return void * @see add_object_linked, updateObjectLinked, deleteObjectLinked */ @@ -2152,12 +2290,12 @@ function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targett if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid)) { - $justsource=true; + $justsource=true; // the source (id and type) is a search criteria if (! empty($targettype)) $withtargettype=true; } if (! empty($targetid) && ! empty($targettype) && empty($sourceid)) { - $justtarget=true; + $justtarget=true; // the target (id and type) is a search criteria if (! empty($sourcetype)) $withsourcetype=true; } @@ -2206,13 +2344,27 @@ function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targett while ($i < $num) { $obj = $this->db->fetch_object($resql); - if ($obj->fk_source == $sourceid) + if ($justsource || $justtarget) { - $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + if ($justsource) + { + $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + } + else if ($justtarget) + { + $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + } } - if ($obj->fk_target == $targetid) + else { - $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + if ($obj->fk_source == $sourceid && $obj->sourcetype == $sourcetype) + { + $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + } + if ($obj->fk_target == $targetid && $obj->targettype == $targettype) + { + $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + } } $i++; } @@ -2883,60 +3035,60 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0 print '
'; - if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; // Description - print ''; + print ''; if ($this->element == 'askpricesupplier') { - print ''; + print ''; } // VAT - print ''; + print ''; // Price HT - print ''; + print ''; if ($inputalsopricewithtax) print ''; // Qty - print ''; + print ''; if($conf->global->PRODUCT_USE_UNITS) { - print ''; + print ''; } // Reduction short - print ''; + print ''; if ($this->situation_cycle_ref) { - print ''; + print ''; } if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) { if ($conf->global->MARGIN_TYPE == "1") - print ''; + print ''; else - print ''; + print ''; if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) - print ''; + print ''; if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) - print ''; + print ''; } // Total HT - print ''; + print ''; - print ''; // No width to allow autodim + print ''; // No width to allow autodim - print ''; + print ''; - print ''; + print ''; print "\n"; @@ -3679,10 +3831,10 @@ function fetch_optionals($rowid=null,$optionsArray=null) foreach ($tab as $key => $value) { - // Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine) + // Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine) if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key)) { - // we can add this attribute to adherent object + // we can add this attribute to object $this->array_options["options_".$key]=$value; } } @@ -3730,7 +3882,7 @@ function deleteExtraFields() /** * Add/Update all extra fields values for the current object. * Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) - * This function delte record with all extrafields and insert them again from the array $this->array_options. + * This function delete record with all extrafields and insert them again from the array $this->array_options. * * @return int -1=error, O=did nothing, 1=OK */ @@ -3784,12 +3936,25 @@ function insertExtraFields() // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - if ($value) - { - $object->fetch(0,$value); - $this->array_options[$key]=$object->id; - } + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + if ($value) + { + $res=$object->fetch(0,$value); + if ($res > 0) $this->array_options[$key]=$object->id; + else + { + $this->error="Ref '".$value."' for object '".$object->element."' not found"; + $this->db->rollback(); + return -1; + } + } + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + } break; } } @@ -3846,10 +4011,10 @@ function insertExtraFields() /** * Function to show lines of extrafields with output datas * - * @param object $extrafields Extrafield Object - * @param string $mode Show output ('view') or input ('edit') for extrafield - * @param array $params Optionnal parameters. Example: array('colspan'=>2) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param Extrafields $extrafields Extrafield Object + * @param string $mode Show output (view) or input (edit) for extrafield + * @param array $params Optional parameters + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) * * @return string */ @@ -3880,7 +4045,16 @@ function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='') $value=$this->array_options["options_".$key]; break; case "edit": - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]); + if (isset($_POST["options_" . $key])) { + if (is_array($_POST["options_" . $key])) { + // $_POST["options"] is an array but following code expects a comma separated string + $value = implode(",", $_POST["options_" . $key]); + } else { + $value = $_POST["options_" . $key]; + } + } else { + $value = $this->array_options["options_" . $key]; + } break; } if ($extrafields->attribute_type[$key] == 'separate') diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 5417c8ef8ce0c..53be6607f3808 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -439,9 +439,10 @@ function setValues($db) if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2; if (! isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) $this->global->MAIN_MAX_DECIMALS_SHOWN=8; - // Default pdf use dash between lines - if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; - + // Default pdf option + if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; // use dash between lines + if (! isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT=1; // allow html content into free footer text + // Set default value to MAIN_SHOW_LOGO if (! isset($this->global->MAIN_SHOW_LOGO)) $this->global->MAIN_SHOW_LOGO=1; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0807bbcec75b1..55cf274e78c26 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -111,7 +111,7 @@ function __construct($db) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not - * @param string $default_value Defaulted value + * @param string $default_value Defaulted value (Example: '', '0', 'null', 'avalue') * @param array $param Params for field * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check @@ -815,7 +815,9 @@ function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$s { $sqlwhere.= ' WHERE '.$InfoFieldList[4]; } - }else { + } + else + { $sqlwhere.= ' WHERE 1'; } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. @@ -1083,10 +1085,19 @@ function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$s // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - $object->fetch($value); - $out=''; - + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + $object->fetch($value); + $valuetoshow=$object->ref; + if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ref is id because name is not unique + $out.=''; + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + $out.='Error bad setup of extrafield'; + } } /* Add comments if ($type == 'date') $out.=' (YYYY-MM-DD)'; @@ -1100,7 +1111,7 @@ function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$s * * @param string $key Key of attribute * @param string $value Value to show - * @param string $moreparam More param + * @param string $moreparam To add more parametes on html input tag (only checkbox use html input for output rendering) * @return string Formated value */ function showOutputField($key,$value,$moreparam='') @@ -1117,6 +1128,8 @@ function showOutputField($key,$value,$moreparam='') $perms=$this->attribute_perms[$key]; $list=$this->attribute_list[$key]; + $showsize=0; + if ($type == 'date') { $showsize=10; @@ -1324,9 +1337,17 @@ function showOutputField($key,$value,$moreparam='') // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - $object->fetch($value); - $value=$object->getNomUrl(3); + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + $object->fetch($value); + $value=$object->getNomUrl(3); + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + $out.='Error bad setup of extrafield'; + } } } elseif ($type == 'text') @@ -1338,11 +1359,59 @@ function showOutputField($key,$value,$moreparam='') $showsize=round($size); if ($showsize > 48) $showsize=48; } + //print $type.'-'.$size; $out=$value; + return $out; } + /** + * Return tag to describe alignement to use for this extrafield + * + * @param string $key Key of attribute + * @return string Formated value + */ + function getAlignFlag($key) + { + global $conf,$langs; + + $type=$this->attribute_type[$key]; + + $align=''; + + if ($type == 'date') + { + $align="center"; + } + elseif ($type == 'datetime') + { + $align="center"; + } + elseif ($type == 'int') + { + $align="right"; + } + elseif ($type == 'double') + { + $align="right"; + } + elseif ($type == 'boolean') + { + $align="center"; + } + elseif ($type == 'radio') + { + $align="center"; + } + elseif ($type == 'checkbox') + { + $align="center"; + } + + return $align; + } + /** * Return HTML string to print separator extrafield * @@ -1451,7 +1520,7 @@ function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='') else if (in_array($key_type,array('checkbox'))) { $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); - $value_key=implode($value_arr,','); + $value_key=implode(',', $value_arr); } else if (in_array($key_type,array('price','double'))) { diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index a497b3cb7e2c8..249a6665a3fa6 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -144,6 +144,21 @@ function executeHooks($method, $parameters=false, &$object='', &$action='') 'formBuilddocLineOptions', 'moveUploadedFile', 'pdf_writelinedesc', + 'pdf_getlinenum', + 'pdf_getlineref', + 'pdf_getlineref_supplier', + 'pdf_getlinevatrate', + 'pdf_getlineupexcltax', + 'pdf_getlineupwithtax', + 'pdf_getlineqty', + 'pdf_getlineqty_asked', + 'pdf_getlineqty_shipped', + 'pdf_getlineqty_keeptoship', + 'pdf_getlineunit', + 'pdf_getlineremisepercent', + 'pdf_getlineprogress', + 'pdf_getlinetotalexcltax', + 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', 'printSearchForm', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8d69e58bad3d0..a9f66d80f227c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -484,9 +484,10 @@ function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extrac * @param string $htmlname Name of html select object * @param string $htmloption Options html on select object * @param integer $maxlength Max length for labels (0=no limit) + * @param string $morecss More css class * @return string HTML string with select */ - function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0) + function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0,$morecss='minwidth300') { global $conf,$langs; @@ -507,7 +508,7 @@ function select_country($selected='',$htmlname='country_id',$htmloption='',$maxl $resql=$this->db->query($sql); if ($resql) { - $out.= ''; $num = $this->db->num_rows($resql); $i = 0; if ($num) @@ -3234,10 +3235,10 @@ function formconfirm($page, $title, $question, $action, $formquestion='', $selec if (! empty($more)) { $formconfirm.= '
'.$more.'
'; } - $formconfirm.= ($question ? '
': ''); + $formconfirm.= ($question ? '
'.img_help('','').' '.$question . '
': ''); $formconfirm.= '
'."\n"; - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; $formconfirm.= ''; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } else { - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; $formconfirm.= ''."\n"; $formconfirm.= ''."\n"; @@ -3345,7 +3346,7 @@ function formconfirm($page, $title, $question, $action, $formquestion='', $selec $formconfirm.= "\n"; $formconfirm.= '
'; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } return $formconfirm; @@ -4500,27 +4501,34 @@ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_la /** * Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL. - * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. + * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. * * @param string $htmlname Name of html select area - * @param string $url Url + * @param string $url Url. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...) * @param string $id Preselected key * @param string $moreparam Add more parameters onto the select tag * @param string $moreparamtourl Add more parameters onto the Ajax called URL * @param int $disabled Html select box is disabled * @param int $minimumInputLength Minimum Input Length * @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. */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='') + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='') { + global $langs; + $out = ''; $tmpplugin='select2'; $out.=''; @@ -4590,34 +4612,36 @@ static function multiselectarray($htmlname, $array, $selected=array(), $key_in_l { global $conf, $langs; + $out = ''; + // Add code for jquery to use multiselect if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; - print ' + $out.=' + + '; + return $out; + } /** * Render list of categories linked to object with id $id and type $type @@ -4698,7 +4818,7 @@ function showCategories($id, $type, $rendermode=0) if ($rendermode == 0) { - $cate_arbo = $this->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); + $cate_arbo = $this->select_all_categories($type, '', 'parent', 64, 0, 1); foreach($categories as $c) { $arrayselected[] = $c->id; } @@ -5041,16 +5161,18 @@ function select_export_model($selected='',$htmlname='exportmodelid',$type='',$us * @param int $shownav Show Condition (navigation is shown if value is 1) * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field) * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous - * @param string $morehtmlref Code html supplementaire a afficher apres ref + * @param string $morehtmlref More html to show after ref * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name + * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlright More html code to show before navigation arrows * @return string Portion HTML avec ref + boutons nav */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0) + function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='') { global $langs,$conf; - $ret=''; + $ret=''; if (empty($fieldid)) $fieldid='rowid'; if (empty($fieldref)) $fieldref='ref'; @@ -5063,14 +5185,27 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''; //print "xx".$previous_ref."x".$next_ref; - $ret.='
'; + $ret.='
'; + + $ret.='
'.$morehtmlleft.'
'; + + $ret.='
'; - $ret.=dol_htmlentities($object->$fieldref); + // For thirdparty and contact, the ref is he id, so we show something else + if ($object->element == 'societe') + { + $ret.=dol_htmlentities($object->name); + } + else if (in_array($object->element, array('contact', 'user', 'member'))) + { + $ret.=dol_htmlentities($object->getFullName($langs)); + } + else $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) { $ret.=' '.$morehtmlref; } - $ret.='
'; + $ret.='
'; if ($previous_ref || $next_ref || $morehtml) { @@ -5078,23 +5213,20 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f } if ($morehtml) { - //$ret.='
'; - //$ret.='
'.$staticcontratligne->LibStatut(0,3).''.$staticcontratligne->LibStatut(4,3,0).''.$staticcontratligne->LibStatut(4,3,1).''.$staticcontratligne->LibStatut(5,3).'
'; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print '  '; + print ''; print ''; print "
'.$obj->ref_customer.''.$obj->ref_supplier.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''.dol_print_date($obj->datec).''.($obj->nb_running>0?$obj->nb_running:'').''.($obj->nb_expired>0?$obj->nb_expired:'').''.($obj->nb_closed>0 ?$obj->nb_closed:'').'
  '.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans("AskPriceSupplierRefFourn").''.$langs->trans("AskPriceSupplierRefFourn").''.$langs->trans('VAT').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('Qty').''.$langs->trans('Unit').''.$langs->trans('Unit').''.$langs->trans('ReductionShort').''.$langs->trans('ReductionShort').'' . $langs->trans('Progress') . '' . $langs->trans('Progress') . ''.$langs->trans('BuyingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('CostPrice').''.$langs->trans('CostPrice').''.$langs->trans('MarginRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarkRate').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShort').'
'.$morehtml; $ret.='
  • '.$morehtml.'
  • '; } if ($shownav && ($previous_ref || $next_ref)) { - //$ret.='
    '.$previous_ref.''.$next_ref; $ret.=''; $ret.=''; } if ($previous_ref || $next_ref || $morehtml) { - //$ret.='
    '; $ret.=''; } - $ret.=''; - + $ret.='
    '.$morehtmlright.'
    '; + $ret.=''; + return $ret; } @@ -5131,15 +5263,18 @@ function showbarcode(&$object,$width=100) /** * Return HTML code to output a photo * - * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') - * @param object $object Object containing data to retrieve file name - * @param int $width Width of photo - * @param int $height Height of photo (auto if 0) - * @param int $caneditfield Add edit fields - * @param string $cssclass CSS name to use on img for photo - * @return string HTML code to output photo + * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') + * @param object $object Object containing data to retrieve file name + * @param int $width Width of photo + * @param int $height Height of photo (auto if 0) + * @param int $caneditfield Add edit fields + * @param string $cssclass CSS name to use on img for photo + * @param string $imagesize 'mini', 'small' or '' (original) + * @param int $addlinktofullsize Add link to fullsize image + * @param int $cache 1=Accept to use image in cache + * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin') + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0) { global $conf,$langs; @@ -5153,51 +5288,77 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf $dir=$conf->societe->multidir_output[$entity]; $smallfile=$object->logo; $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); - if ($object->logo) $file=$id.'/logos/thumbs/'.$smallfile; + if (! empty($object->logo)) + { + if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); + else $file=$id.'/logos/thumbs/'.$smallfile; + } } - if ($modulepart=='contact') + else if ($modulepart=='contact') { $dir=$conf->societe->multidir_output[$entity].'/contact'; - $file=$id.'/photos/'.$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); + else $file=$id.'/photos/'.$object->photo; + } } else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; - if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } else if ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; - if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'invoice_supplier').'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; - } else { + } + else + { $dir=$conf->$modulepart->dir_output; - if ($object->photo) $file=get_exdir($id, 2, 0, 0, $adherent, 'member').'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } if ($dir) { - $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { - $nophoto='/public/theme/common/nophoto.jpg'; + $nophoto='/public/theme/common/nophoto.png'; if (in_array($modulepart,array('userphoto','contact'))) // For module thar are "physical" users { $nophoto='/public/theme/common/user_anonymous.png'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 000a2a35c137a..230ffa995040e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -176,22 +176,24 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm $out .= ''; $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= '
    '; - $out .= $langs->trans("URLToLink") . ': '; + $out .= '
    '; + $out .= '
    '; + $out .= ': '; $out .= ''; - $out .= '   ' . $langs->trans("Label") . ': '; + $out .= '
    '; + $out .= '
    '; + $out .= ': '; $out .= ''; $out .= ''; $out .= ''; - $out .= ' '; + $out .= '
    '; + $out .= '
    '; $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; - $out .= '
    '; - + $out .= ''; + $out .= ''; + $out .= '
    '; $out .= '
    '; $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); @@ -492,7 +494,7 @@ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed $out.= ''; $out.= ''; - $out.= '
    '.$titletoshow.'
    '; + $out.= load_fiche_titre($titletoshow, '', ''); $out.= ''; $out.= ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 437637c3bdf96..51cf8a9c7a72e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -302,7 +302,7 @@ function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5 /** * Return select list for categories (to use in form search selectors) * - * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) + * @param int $type Type of categories (0=product, 1=supplier, 2=customer, 3=member, 4=contact) * @param integer $selected Preselected value * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" @@ -598,7 +598,7 @@ static function showColor($color, $textifnotdefined='') include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(colorStringToArray($color,array()),''); - if ($color) print ''; + if ($color) print ''; else print $textifnotdefined; } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 27bcb64da3c26..89ab001986577 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Destailleur Laurent + * Copyright (C) 2004-2015 Destailleur Laurent * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -579,6 +579,18 @@ function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0) { $str=$this->tab_translate[$key]; + // Make some string replacement after translation + $replacekey='MAIN_REPLACE_TRANS_'.$this->defaultlang; + if (! empty($conf->global->$replacekey)) // Replacement translation variable with string1:newstring1;string2:newstring2 + { + $tmparray=explode(';', $conf->global->$replacekey); + foreach($tmparray as $tmp) + { + $tmparray2=explode(':',$tmp); + $str=preg_replace('/'.preg_quote($tmparray2[0]).'/',$tmparray2[1],$str); + } + } + if (! preg_match('/^Format/',$key)) { //print $str; @@ -647,17 +659,17 @@ function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4 { $str=$this->tab_translate[$key]; - // Overwrite translation - $overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang; - if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2 + // Make some string replacement after translation + $replacekey='MAIN_REPLACE_TRANS_'.$this->defaultlang; + if (! empty($conf->global->$replacekey)) // Replacement translation variable with string1:newstring1;string2:newstring2 { - $tmparray=explode(',', $conf->global->$overwritekey); + $tmparray=explode(';', $conf->global->$replacekey); foreach($tmparray as $tmp) { $tmparray2=explode(':',$tmp); - if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; } + $str=preg_replace('/'.preg_quote($tmparray2[0]).'/',$tmparray2[1],$str); } - } + } if (! preg_match('/^Format/',$key)) { @@ -969,7 +981,8 @@ public function loadCacheCurrencies($currency_code) } /** - * Return an array with content of all loaded translation keys (found into this->tab_translate) + * Return an array with content of all loaded translation keys (found into this->tab_translate) so + * we get a substitution array we can use for substitutions (for mail or ODT generation for example) * * @return array Array of translation keys lang_key => string_translation_loaded */ @@ -984,9 +997,3 @@ function get_translations_for_substitutions() return $substitutionarray; } } - - -function warning_handler($errno, $errstr, $errfile, $errline, array $errcontext) { - global $str; - print 'str='.$str; -} diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index fa9db9ea4b42a..f1909a91ea0be 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -226,7 +226,7 @@ function lastquery() */ function order($sortfield=null,$sortorder=null) { - if (isset($sortfield)) + if (! empty($sortfield)) { $return=''; $fields=explode(',',$sortfield); @@ -236,7 +236,7 @@ function order($sortfield=null,$sortorder=null) else $return.=','; $return.=preg_replace('/[^0-9a-z_\.]/i','',$val); - if (isset($sortorder)) + if (! empty($sortorder)) { $return.=' '.preg_replace('/[^0-9a-z]/i','',$sortorder); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 9490f3a7b7d72..7b22a2e8dbe2d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -678,9 +678,11 @@ function activateModule($value,$withdeps=1) $ret=''; $modName = $value; $modFile = $modName . ".class.php"; - $modulesdir = dolGetModulesDirs(); - // Loop on each directory + // Loop on each directory to fill $modulesdir + $modulesdir = dolGetModulesDirs(); + + // Loop on each modulesdir directories $found=false; foreach ($modulesdir as $dir) { @@ -775,9 +777,11 @@ function unActivateModule($value, $requiredby=1) $ret=''; $modName = $value; $modFile = $modName . ".class.php"; - $modulesdir = dolGetModulesDirs(); - // Loop on each directory + // Loop on each directory to fill $modulesdir + $modulesdir = dolGetModulesDirs(); + + // Loop on each modulesdir directories $found=false; foreach ($modulesdir as $dir) { @@ -887,13 +891,13 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql if ($modulequalified) { // Load languages files of module - if (isset($objMod->langfiles) && is_array($objMod->langfiles)) - { - foreach($objMod->langfiles as $langfile) - { - $langs->load($langfile); - } - } + if (isset($objMod->langfiles) && is_array($objMod->langfiles)) + { + foreach($objMod->langfiles as $langfile) + { + $langs->load($langfile); + } + } // Complete arrays //&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond @@ -943,12 +947,113 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql return 1; } +/** + * Add external modules to list of contact element + * + * @param array $elementList elementList + * @return int 1 + */ +function complete_elementList_with_modules(&$elementList) +{ + global $db, $modules, $conf, $langs; + + // Search modules + $filename = array(); + $modules = array(); + $orders = array(); + $categ = array(); + $dirmod = array(); + + $i = 0; // is a sequencer of modules found + $j = 0; // j is module number. Automatically affected if module number not defined. + + $modulesdir = dolGetModulesDirs(); + + foreach ($modulesdir as $dir) + { + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
    "; + dol_syslog("Scan directory ".$dir." for modules"); + $handle=@opendir(dol_osencode($dir)); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + //print "$i ".$file."\n
    "; + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); + + if ($modName) + { + include_once $dir.$file; + $objMod = new $modName($db); + + if ($objMod->numero > 0) + { + $j = $objMod->numero; + } + else + { + $j = 1000 + $i; + } + + $modulequalified=1; + + // We discard modules according to features level (PS: if module is activated we always show it) + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + //If module is not activated disqualified + if (empty($conf->global->$const_name)) $modulequalified=0; + + if ($modulequalified) + { + // Load languages files of module + if (isset($objMod->langfiles) && is_array($objMod->langfiles)) + { + foreach($objMod->langfiles as $langfile) + { + $langs->load($langfile); + } + } + + $modules[$i] = $objMod; + $filename[$i]= $modName; + $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module + //print "x".$modName." ".$orders[$i]."\n
    "; + if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories + else $categ[$objMod->special]=1; + $dirmod[$i] = $dirroot; + if (! empty($objMod->module_parts['contactelement'])) + { + $elementList[$objMod->name] = $langs->trans($objMod->name); + //exit; + } + + $j++; + $i++; + } + else dol_syslog("Module ".get_class($objMod)." not qualified"); + } + } + } + closedir($handle); + } + else + { + dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); + } + } + + return 1; +} /** * Show array with constants to edit * * @param array $tableau Array of constants - * @param int $strictw3c Respect W3C (no form into table) + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all * @return void */ function form_constantes($tableau,$strictw3c=0) @@ -957,7 +1062,7 @@ function form_constantes($tableau,$strictw3c=0) $form = new Form($db); - if (! empty($strictw3c)) print "\n".'
    '; + if (! empty($strictw3c) && $strictw3c == 1) print "\n".''; print '
    '; print ''; @@ -1094,7 +1199,7 @@ function form_constantes($tableau,$strictw3c=0) } print '
    '; - if (! empty($strictw3c)) + if (! empty($strictw3c) && $strictw3c == 1) { print '
    '; print "\n"; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 9a67065fe649e..70988d7e330fb 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -58,6 +58,16 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'customer'; $h++; } + if (($object->client==1 || $object->client==2 || $object->client==3) && (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))) + { + $langs->load("products"); + // price + $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id; + $head[$h][1] = $langs->trans("CustomerPrices"); + $head[$h][2] = 'price'; + $h++; + } + if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) { $head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id; @@ -81,6 +91,13 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'agenda'; $h++; } + if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) )) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Projects"); + $head[$h][2] = 'project'; + $h++; + } //show categorie tab /*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { @@ -169,16 +186,6 @@ function societe_prepare_head(Societe $object) $h++; } - if (($object->client==1 || $object->client==2 || $object->client==3) && (! empty ( $conf->global->PRODUIT_CUSTOMER_PRICES ))) - { - $langs->load("products"); - // price - $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id; - $head[$h][1] = $langs->trans("CustomerPrices"); - $head[$h][2] = 'price'; - $h++; - } - // Log $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$object->id; $head[$h][1] = $langs->trans("Info"); @@ -456,9 +463,10 @@ function getFormeJuridiqueLabel($code) * @param DoliDB $db Database handler * @param Object $object Third party object * @param string $backtopage Url to go once contact is created + * @param int $nocreatelink 1=Hide create project link * @return void */ -function show_projects($conf,$langs,$db,$object,$backtopage='') +function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0) { global $user; global $bc; @@ -470,7 +478,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $langs->load("projects"); $buttoncreate=''; - if (! empty($conf->projet->enabled) && $user->rights->projet->creer) + if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { //$buttoncreate=''.$langs->trans("AddProject").''; $buttoncreate=''.$langs->trans("AddProject"); @@ -632,40 +640,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "
    '; - print ''; - print ''; - //print ''; - print ' '; - print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status); - print ' '; - print ''; - print '
    '; + print ''; + print ''; + //print ''; + print ' '; + print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status); + print ' '; + print ''; + print '
    '; + $contactstatic->id = $obj->rowid; + $contactstatic->ref = $obj->ref; $contactstatic->statut = $obj->statut; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; @@ -705,44 +711,23 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->phone_mobile = $obj->phone_mobile; $contactstatic->phone_perso = $obj->phone_perso; $contactstatic->email = $obj->email; + $contactstatic->web = $obj->web; + $contactstatic->skype = $obj->skype; + + $country_code = getCountry($obj->country_id, 2); + $contactstatic->country_code = $country_code; + + print "
    '; print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage)); print ''; if ($obj->poste) print $obj->poste; print ''; - $outdone=0; - $contactstatic->address = $obj->address; - $contactstatic->zip = $obj->zip; - $contactstatic->town = $obj->town; - $contactstatic->country_id = $obj->country_id; - $coords = $contactstatic->getFullAddress(1,', '); - if (! empty($conf->use_javascript_ajax)) - { - $namecoords = $contactstatic->getFullName($langs,1).'
    '.$coords; - // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile - print ''; - print img_picto($langs->trans("Address"), 'object_address.png'); - print ' '; - } - if ($coords) { print dol_print_address($coords,'address_contact_'.$obj->rowid, 'contact', $obj->rowid); $outdone++; } - - if ($obj->phone_pro || $obj->phone_mobile || $obj->phone_perso || $obj->fax) print ($outdone?'
    ':''); - if ($obj->phone_pro) { print dol_print_phone($obj->phone_pro,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } - if ($obj->phone_mobile) { print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } - if ($obj->phone_perso) { print dol_print_phone($obj->phone_perso,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } - if ($obj->fax) { print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX',' ','fax'); $outdone++; } - - print '
    '; - $outdone=0; - if ($obj->email) print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL',0,0,1); - if (! empty($conf->skype->enabled)) - { - if ($obj->skype) print ($outdone?'
    ':'').dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE'); - } + print $contactstatic->getBannerAddress('contact', $object); print '
    '; - print ''; - print_liste_field_titre($title,"index.php","","","","",$sortfield,$sortorder); - if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { - print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder); - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder); - print "\n"; $sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount, COUNT(DISTINCT t.rowid) as nb"; // We use DISTINCT here because line can be doubled if task has 2 links to same user $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; @@ -962,6 +952,17 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $num = $db->num_rows($resql); $i = 0; + print ''; + print_liste_field_titre($title.' '.$num.'',$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); + if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder); + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder); + print "\n"; + while ($i < $num) { $objp = $db->fetch_object($resql); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 0e7f74b32f72f..4cfc077f0be8c 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -74,7 +74,7 @@ function dol_decode($chain) * If constant MAIN_SECURITY_SALT is defined, we use it as a salt. * * @param string $chain String to hash - * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5) + * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0. * @return string Hash of string */ function dol_hash($chain,$type=0) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index cb62b63377ff8..526f6e481850a 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -355,7 +355,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print '
    '; $file=$dirtheme."/".$subdir."/thumb.png"; $url=$urltheme."/".$subdir."/thumb.png"; - if (! file_exists($file)) $url=$urltheme."/common/nophoto.jpg"; + if (! file_exists($file)) $url=DOL_URL_ROOT.'/public/theme/common/nophoto.png'; print 'id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); else $title=$langs->trans("ShowPreview"); @@ -414,7 +414,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb'; else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),''); - if ($color) print ''; + if ($color) print ''; else print $langs->trans("None"); } print '   ('.$langs->trans("Default").': edf4fb, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; @@ -440,7 +440,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); - if ($color) print ''; + if ($color) print ''; else print ''; } if ($edit) print '
    ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; @@ -459,10 +459,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); - if ($color) print ''; + if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': 6e7896, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ''; } @@ -486,7 +486,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); } - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': e6e6e6, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ''; print ''; diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 365961651919b..c421fdb1aebb3 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -91,7 +91,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= if (! $passok) { if ((! $passcrypted || $passtyped) - && ($passtyped == $passclear)) + && ($passclear && ($passtyped == $passclear))) { $passok=true; dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database"); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index b1bc55be0a80b..df0b9e4648827 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -68,11 +68,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Third parties insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/soc.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/fourn/list.php?leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/soc.php?leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/prospect/list.php?leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/soc.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/list.php?leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -- Third parties - Contacts insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 1cafd091521ed..9623958188dc5 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -205,14 +205,15 @@ function print_end_menu_array_auguria() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler - * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) + * @param array $moredata An array with more data to output * @return int Nb of entries */ -function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='') +function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='',$moredata=null) { global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; @@ -245,6 +246,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM print '
    '."\n"; } + if (is_array($moredata) && ! empty($moredata['searchform'])) + { + print "\n"; + print "\n"; + print '
    '."\n"; + print $moredata['searchform']; + print '
    '."\n"; + print "\n"; + } + // We update newmenu with entries found into database $menuArbo = new Menubase($db,'auguria'); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu); @@ -348,7 +359,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM // Show menu if (empty($noout)) { - $alt=0; $blockvmenuopened=false; + $alt=0; $altok=0; $blockvmenuopened=false; $num=count($menu_array); for ($i = 0; $i < $num; $i++) { @@ -358,14 +369,15 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $alt++; if (empty($menu_array[$i]['level']) && $showmenu) { + $altok++; $blockvmenuopened=true; - if (($alt%2==0)) + if ($altok % 2 == 0) { - print '
    '."\n"; + print '
    '."\n"; } else { - print '
    '."\n"; + print '
    '."\n"; } } @@ -437,8 +449,20 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if ($blockvmenuopened) { print "
    \n"; $blockvmenuopened=false; } } } + + if ($altok) print '
    '; } + if (is_array($moredata) && ! empty($moredata['bookmarks'])) + { + print "\n"; + print "\n"; + print '
    '."\n"; + print $moredata['bookmarks']; + print '
    '."\n"; + print "\n"; + } + return count($menu_array); } diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index b54c746388e2b..a7c701aaeff47 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -158,9 +158,10 @@ function loadMenu($forcemainmenu='',$forceleftmenu='') * Show menu * * @param string $mode 'top', 'left', 'jmobile' + * @param array $moredata An array with more data to output * @return string */ - function showmenu($mode) + function showmenu($mode, $moredata=null) { global $conf, $langs, $user; @@ -176,7 +177,7 @@ function showmenu($mode) $this->menu=new Menu(); if ($mode == 'top') print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0); - if ($mode == 'left') print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0); + if ($mode == 'left') print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0,'','',$moredata); if ($mode == 'jmobile') { print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e4949b1d973cf..099d65f7f955a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -409,14 +409,15 @@ function print_end_menu_array() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) - * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) + * @param array $moredata An array with more data to output * @return int nb of menu entries */ -function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='') +function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='',$moredata=null) { global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; @@ -449,6 +450,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print '
    '."\n"; } + if (is_array($moredata) && ! empty($moredata['searchform'])) + { + print "\n"; + print "\n"; + print '
    '."\n"; + print $moredata['searchform']; + print '
    '."\n"; + print "\n"; + } + /** * We update newmenu with entries found into database * -------------------------------------------------- @@ -590,13 +601,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); - $newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); /* no more required, there is a filter that can do more - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); */ $newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); @@ -606,7 +617,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $langs->load("commercial"); - $newmenu->add("/comm/list.php?leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); $newmenu->add("/societe/soc.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); @@ -616,10 +627,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled)) { $langs->load("suppliers"); - $newmenu->add("/fourn/list.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire); - //$newmenu->add("/fourn/list.php?leftmenu=suppliers", $langs->trans("List"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire); - //$newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire); } // Contacts @@ -1146,7 +1155,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Security check $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire); - $newmenu->add("/fourn/list.php",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); + $newmenu->add("/societe/list.php?type=f",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); $newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire); $newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); } @@ -1409,11 +1418,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $blockvmenuopened=true; if ($altok % 2 == 0) { - print '
    '."\n"; + print '
    '."\n"; } else { - print '
    '."\n"; + print '
    '."\n"; } } @@ -1486,6 +1495,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($altok) print '
    '; } + if (is_array($moredata) && ! empty($moredata['bookmarks'])) + { + print "\n"; + print "\n"; + print '
    '."\n"; + print $moredata['bookmarks']; + print '
    '."\n"; + print "\n"; + } + return count($menu_array); } diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index fc66eef7fd623..4326de6d98f38 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -112,9 +112,10 @@ function loadMenu($forcemainmenu='',$forceleftmenu='') * Show menu * * @param string $mode 'top', 'left', 'jmobile' + * @param array $moredata An array with more data to output * @return string */ - function showmenu($mode) + function showmenu($mode, $moredata=null) { global $conf, $langs, $user; @@ -132,7 +133,7 @@ function showmenu($mode) if (empty($conf->global->MAIN_MENU_INVERT)) { if ($mode == 'top') print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0); - if ($mode == 'left') print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0); + if ($mode == 'left') print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0,'','',$moredata); } else { diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 5c428ca9f1366..e1b240a8e5e34 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -61,9 +61,10 @@ function loadMenu() * Show menu * * @param string $mode 'top', 'left', 'jmobile' + * @param array $moredata An array with more data to output * @return string */ - function showmenu($mode) + function showmenu($mode, $moredata=null) { global $user,$conf,$langs,$dolibarr_main_db_name; @@ -133,20 +134,22 @@ function showmenu($mode) if (empty($noout)) { - $alt=0; + $alt=0; $altok=0; $blockvmenuopened=false; $num=count($this->menu->liste); for ($i = 0; $i < $num; $i++) { $alt++; if (empty($this->menu->liste[$i]['level'])) { + $altok++; + $blockvmenuopened=true; if (($alt%2==0)) { - print '
    '."\n"; + print '
    '."\n"; } else { - print '
    '."\n"; + print '
    '."\n"; } } @@ -201,6 +204,8 @@ function showmenu($mode) print "
    \n"; } } + + if ($altok) print '
    '; } if ($mode == 'jmobile') diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c059ff7c2cc3e..b8d4df05e922d 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -35,16 +35,19 @@ class DolibarrModules // Can not be abstract, because we need to instantiant it into unActivateModule to be able to disable a module whose files were removed. { /** - * @var DoliDb Database handler + * @var int Module unique ID */ - public $db; + public $numero; /** - * @var string Relative path to module style sheet - * @deprecated - * @see module_parts + * @var string Module name */ - public $style_sheet = ''; + public $name; + + /** + * @var DoliDb Database handler + */ + public $db; /** * @var array Paths to create when module is activated @@ -134,16 +137,6 @@ class DolibarrModules // Can not be abstract, because we need to insta */ public $error; - /** - * @var int Module unique ID - */ - public $numero; - - /** - * @var string Module name - */ - public $name; - /** * @var string Module version */ @@ -193,7 +186,15 @@ class DolibarrModules // Can not be abstract, because we need to insta * @var bool Module is enabled globally (Multicompany support) */ public $core_enabled; + + /** + * @var string Relative path to module style sheet + * @deprecated + * @see module_parts + */ + public $style_sheet = ''; + /** * Constructor. Define names, constants, directories, boxes, permissions @@ -470,6 +471,7 @@ function isCoreOrExternalModule() if ($this->version == 'dolibarr' || $this->version == 'dolibarr_deprecated') return 'core'; if (! empty($this->version) && ! in_array($this->version,array('experimental','development'))) return 'external'; if (! empty($this->editor_name) || ! empty($this->editor_web)) return 'external'; + if ($this->numero >= 100000) return 'external'; return 'unknown'; } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 12ea7aa7b082d..542f53c24b795 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -270,7 +270,11 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->client; + else { + $socobject = $object->client; + // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; + } } else { @@ -344,8 +348,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array(); $array_other=$this->get_substitutionarray_other($outputlangs); + // retrieve contact information for use in invoice as contact_xxx tags + $array_thirdparty_contact = array(); + if ($usecontact) + $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); - $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other); + $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index a76531cd719b3..430d62146f579 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -45,7 +45,7 @@ function __construct($db) // Key text used to identify module (for permission, menus, etc...) $this->rights_class = 'cashdesk'; - $this->family = "products"; + $this->family = "portal"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "CashDesk module"; diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php new file mode 100644 index 0000000000000..1e82db5dfc4d8 --- /dev/null +++ b/htdocs/core/modules/modHRM.class.php @@ -0,0 +1,250 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/modules/modHRM.class.php + * \ingroup HRM + * \brief Description and activation file for module HRM + */ +include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"); + +/** + * Class to describe and activate the HRM module + */ +class modHRM extends DolibarrModules +{ + /** + * Constructor. + * Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db + */ + public function __construct($db) + { + global $langs, $conf; + + $this->db = $db; + + $this->numero = 4000; + $this->rights_class = 'hrm'; + + $this->family = "hr"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace ( '/^mod/i', '', get_class ( $this ) ); + $this->description = "Gestion des ressources humaines"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; + + $this->const_name = 'MAIN_MODULE_' . strtoupper ( $this->name ); + $this->special = 0; + // $this->picto = ''; + + // define triggers + $this->module_parts = array(); + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Config pages + $this->config_page_url = array('admin_hrm.php@hrm'); + + // Dependencies + $this->depends = array(); + $this->requiredby = array(/*" + modSalaries, + modExpenseReport, + modHoliday + "*/); + $this->conflictwith = array(); + $this->phpmin = array ( + 5, + 3 + ); // Minimum version of PHP required by module + $this->need_dolibarr_version = array ( + 3, + 7 + ); // Minimum version of Dolibarr required by module + $this->langfiles = array ( + "hrm" + ); + + // Dictionnaries + $this->dictionnaries=array( + 'langs'=>'hrm', + 'tabname'=>array( + MAIN_DB_PREFIX."c_hrm_department", + MAIN_DB_PREFIX."c_hrm_function" + ), + 'tablib'=>array( + "DepartmentDict", + "FunctionDict" + ), + 'tabsql'=>array( + 'SELECT rowid, pos, code, label, active FROM '.MAIN_DB_PREFIX.'c_hrm_department', + 'SELECT rowid, pos, code, label, c_level, active FROM '.MAIN_DB_PREFIX.'c_hrm_department' + ), + 'tabsqlsort'=>array( + 'rowid ASC', + 'rowid ASC' + ), + 'tabfield'=>array( + "code,label", + "code,label" + ), + 'tabfieldvalue'=>array( + "code,label", + "code,label" + ), + 'tabfieldinsert'=>array( + "code,label", + "code,label" + ), + 'tabrowid'=>array( + "rowid", + "rowid" + ), + 'tabcond'=>array( + '$conf->hrm->enabled', + '$conf->hrm->enabled' + ) + ); + + // Constantes + $this->const = array (); + $r = 0; + + // Boxes + $this->boxes = array (); + + // Permissions + $this->rights = array(); // Permission array used by this module + $r = 0; + + $this->rights[$r][0] = 4001; + $this->rights[$r][1] = 'See employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'read'; + $r ++; + + $this->rights[$r][0] = 4002; + $this->rights[$r][1] = 'Create employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'write'; + $r ++; + + $this->rights[$r][0] = 4003; + $this->rights[$r][1] = 'Delete employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'delete'; + $r ++; + + $this->rights[$r][0] = 4004; + $this->rights[$r][1] = 'Export employees'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'export'; + $r ++; + + // Main menu entries + $this->menus = array (); // List of menus to add + $r = 0; + + $this->menu[$r] = array ( + 'fk_menu' => 'fk_mainmenu=hrm', + 'type' => 'left', + 'titre' => 'Employees', + 'leftmenu' => 'employee', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/index.php', + 'langs' => 'hrm', + 'position' => 100, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'NewEmployee', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/card.php?action=create', + 'langs' => 'hrm', + 'position' => 101, + 'enabled' => '$user->rights->hrm->employee->write', + 'perms' => '$user->rights->hrm->employee->write', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'List', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/list.php', + 'langs' => 'hrm', + 'position' => 102, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'Statistics', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/stats.php', + 'langs' => 'hrm', + 'position' => 103, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus + * (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Enabling module ('', 'noboxes') + * @return int if OK, 0 if KO + */ + function init($options='') + { + // Permissions + $this->remove($options); + + $sql = array(); + + return $this->_init($sql,$options); + } +} diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 54f65a8359186..0b282584261e5 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -43,7 +43,7 @@ function __construct($db) $this->db = $db; $this->numero = 60; - $this->family = "other"; + $this->family = "technic"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des etiquettes"; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 8c510186f0641..d3be64d0560f7 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -45,7 +45,7 @@ function __construct($db) $this->db = $db; $this->numero = 0; - $this->family = "base"; // Family for module (or "base" if core module) + $this->family = "hr"; // Family for module (or "base" if core module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des utilisateurs (requis)"; diff --git a/htdocs/core/modules/modSyncSupplierWebServices.class.php b/htdocs/core/modules/modWebServicesClient.class.php similarity index 91% rename from htdocs/core/modules/modSyncSupplierWebServices.class.php rename to htdocs/core/modules/modWebServicesClient.class.php index 96403f67ee4b8..307f3420640a3 100644 --- a/htdocs/core/modules/modSyncSupplierWebServices.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -18,7 +18,7 @@ /** * \defgroup webservices Module webservices * \brief Module to enable client for supplier WebServices - * \file htdocs/core/modules/modSyncSupplierWebServices.class.php + * \file htdocs/core/modules/modWebServicesClient.class.php * \ingroup webservices * \brief File to describe client for supplier webservices module */ @@ -27,7 +27,7 @@ /** * Class to describe a sync supplier web services module */ -class modSyncSupplierWebServices extends DolibarrModules +class modWebServicesClient extends DolibarrModules { /** @@ -38,12 +38,12 @@ class modSyncSupplierWebServices extends DolibarrModules function __construct($db) { $this->db = $db; - $this->numero = 2650; + $this->numero = 2660; $this->family = "technic"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - $this->description = "Enable the client for external supplier web services"; + $this->description = "Enable the web service client to call external supplier web services"; $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php new file mode 100644 index 0000000000000..0e75daa26bdbf --- /dev/null +++ b/htdocs/core/modules/modWebsite.class.php @@ -0,0 +1,124 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup website Module website + * \brief Website module descriptor. + * \file htdocs/core/modules/modWebsite.class.php + * \ingroup website + * \brief Description and activation file for module Website + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + + +/** + * Class to describe Website module + */ +class modWebsite extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + $this->numero = 10000; + + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page + $this->family = "portal"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "Enable the public website with CMS features"; + $this->version = 'development'; // 'experimental' or 'dolibarr' or version + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 0; + // Name of image file used for this module. + $this->picto='globe'; + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Config pages + //------------- + $this->config_page_url = array("website.php"); + + // Dependancies + //------------- + $this->hidden = ! empty($conf->global->WEBSITE_MODULE_DISABLED); // A condition to disable module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->langfiles = array("website"); + + // Constants + //----------- + $this->const = array(); + + // New pages on tabs + // ----------------- + $this->tabs = array(); + + // Boxes + //------ + $this->boxes = array(); + + // Permissions + $this->rights = array(); // Permission array used by this module + $this->rights_class = 'website'; + $r=0; + + $this->rights[$r][0] = 10001; + $this->rights[$r][1] = 'Read website content'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'read'; + $r++; + + $this->rights[$r][0] = 10002; + $this->rights[$r][1] = 'Create/modify website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'create'; + $r++; + + $this->rights[$r][0] = 10003; + $this->rights[$r][1] = 'Delete website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'delete'; + $r++; + + // Main menu entries + $r=0; + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'top', // This is a Left menu entry + 'titre'=>'Website', + 'url'=>'/website/index.php', + 'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>100, + 'enabled'=>'$conf->website->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->website->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; + } +} diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 80ec0ba6fe0a4..d6773eb2c80aa 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -288,9 +288,9 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede dol_mkdir($conf->propal->dir_temp); - // If BILLING contact defined on invoice, we use it + // If CUSTOMER contact defined on proposal, we use it $usecontact=false; - $arrayidcontact=$object->getIdContact('external','BILLING'); + $arrayidcontact=$object->getIdContact('external','CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact=true; @@ -302,13 +302,16 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->client; + else { + $socobject = $object->client; + // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; + } } else { $socobject=$object->client; } - // Make substitution $substitutionarray=array( '__FROM_NAME__' => $this->emetteur->name, @@ -369,8 +372,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs); + // retrieve contact information for use in proposal as contact_xxx tags + $array_thirdparty_contact = array(); + if ($usecontact) + $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); - $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); + $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); diff --git a/htdocs/core/search.php b/htdocs/core/search.php new file mode 100644 index 0000000000000..0307a8c77d112 --- /dev/null +++ b/htdocs/core/search.php @@ -0,0 +1,140 @@ + + * + * This file is a modified version of datepicker.php from phpBSM to fix some + * bugs, to add new features and to dramatically increase speed. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/search.php + * \brief Wrapper that receive any search. Depending on input field, make a redirect to correct URL. + */ + +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); +if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); + +require_once '../main.inc.php'; + +/* + * Actions + */ + +if (GETPOST('search_proposal') != '') +{ + header("Location: ".DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode(GETPOST('search_proposal'))); + exit; +} +if (GETPOST('search_customer_order') != '') +{ + header("Location: ".DOL_URL_ROOT.'/commande/list.php?sall='.urlencode(GETPOST('search_customer_order'))); + exit; +} +if (GETPOST('search_supplier_order') != '') +{ + header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode(GETPOST('search_supplier_order'))); + exit; +} +if (GETPOST('search_intervention') != '') +{ + header("Location: ".DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode(GETPOST('search_intervention'))); + exit; +} +if (GETPOST('search_contract') != '') +{ + header("Location: ".DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode(GETPOST('search_contract'))); + exit; +} +if (GETPOST('search_invoice') != '') +{ + header("Location: ".DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode(GETPOST('search_invoice'))); + exit; +} +if (GETPOST('search_supplier_invoice') != '') +{ + header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode(GETPOST('search_supplier_invoice'))); + exit; +} +if (GETPOST('search_donation') != '') +{ + header("Location: ".DOL_URL_ROOT.'/don/list.php?sall='.urlencode(GETPOST('search_donation'))); + exit; +} +if (GETPOST('search_product') != '') +{ + header("Location: ".DOL_URL_ROOT.'/product/list.php?sall='.urlencode(GETPOST('search_product'))); + exit; +} +if (GETPOST('search_thirdparty') != '') +{ + header("Location: ".DOL_URL_ROOT.'/societe/list.php?mode=search&sall='.urlencode(GETPOST('search_thirdparty'))); + exit; +} +if (GETPOST('search_contact') != '') +{ + header("Location: ".DOL_URL_ROOT.'/contact/list.php?mode=search&sall='.urlencode(GETPOST('search_contact'))); + exit; +} +if (GETPOST('search_deplacement') != '') +{ + header("Location: ".DOL_URL_ROOT.'/compta/deplacement/list.php?mode=search&sall='.urlencode(GETPOST('search_deplacement'))); + exit; +} +if (GETPOST('search_expensereport') != '') +{ + header("Location: ".DOL_URL_ROOT.'/expensereport/list.php?mode=search&sall='.urlencode(GETPOST('search_expensereport'))); + exit; +} +if (GETPOST('search_holiday') != '') +{ + header("Location: ".DOL_URL_ROOT.'/holiday/list.php?mode=search&sall='.urlencode(GETPOST('search_holiday'))); + exit; +} +if (GETPOST('search_member') != '') +{ + header("Location: ".DOL_URL_ROOT.'/adherents/list.php?mode=search&sall='.urlencode(GETPOST('search_member'))); + exit; +} +if (GETPOST('search_project') != '') +{ + header("Location: ".DOL_URL_ROOT.'/projet/list.php?mode=search&search_all='.urlencode(GETPOST('search_project'))); + exit; +} +if (GETPOST('search_task') != '') +{ + header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php?mode=search&search_all='.urlencode(GETPOST('search_task'))); + exit; +} + + + +// If we are here, search was called with no supported criteria +if (! empty($_SERVER['HTTP_REFERER'])) +{ + header("Location: ".$_SERVER['HTTP_REFERER']); + exit; +} +else +{ + print 'The wrapper search.php was called without any search criteria'; +} + diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index dc90a7c38531e..fa63a9e9c0652 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -70,14 +70,14 @@ if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname'); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'sall', '', 'company'); $nbofsearch++; } if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname'); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'sall', '', 'contact'); $nbofsearch++; } @@ -85,7 +85,7 @@ && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) { $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', '', 'sall'.rand(0,10)); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', '', 'product'); $nbofsearch++; } @@ -100,7 +100,7 @@ if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', 'sall'.rand(0,10)); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', '', 'member'); $nbofsearch++; } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 142c090321260..174da1ae4095a 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -100,9 +100,12 @@ function init_typeoffields(type)
    - +
    -textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?>textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> -textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?>
    +textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0)?> +
    trans("Position"); ?>
    global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
    trans('AddNewLine'); ?>trans("FreeZone"); ?>
    trans('AskPriceSupplierRefFourn'); ?>trans('VAT'); ?>trans('PriceUHT'); ?>trans('VAT'); ?>trans('PriceUHT'); ?> trans('PriceUTTC'); ?>trans('PriceUTTC'); ?> trans('Qty'); ?>trans('Qty'); ?> '; + print ''; print ''; print $langs->trans('Unit'); print 'trans('ReductionShort'); ?>trans('ReductionShort'); ?> ' . $langs->trans('Progress') . '' . $langs->trans('Progress') . ' + global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); @@ -87,11 +87,11 @@ ?> '.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').'  
    global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> '; + echo ''; // Show radio free line if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) { echo ' tva_assuj == "0") echo ''.vatrate(0, true); else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); ?> + "> + "> "> + "> '; + print ''; print $form->selectUnits($line->fk_unit, "units"); print 'remise_percent); ?>">%remise_percent); ?>">% + product->enabled) || ! empty($conf->service->enabled)) { ?> @@ -277,7 +277,7 @@ } } ?> - +
    +
    info_bits & 2) == 2) { ?> @@ -125,17 +125,17 @@ ?>
    ref_fourn; ?>ref_fourn; ?> tva_tx,'%',$line->info_bits); ?>tva_tx,'%',$line->info_bits); ?>subprice); ?>subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?>pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> + info_bits & 2) != 2) && $line->special_code != 3) { // I comment this because it shows info even when not required // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated @@ -148,7 +148,7 @@ global->PRODUCT_USE_UNITS) { - print ''; + print ''; $label = $line->getLabelOfUnit('short'); if ($label !== '') { print $langs->trans($label); @@ -158,42 +158,42 @@ ?> remise_percent) && $line->special_code != 3) { ?> - remise_percent,$langs); ?>    ' . $line->situation_percent . '%' . $line->situation_percent . '%pa_ht); ?>pa_ht); ?> pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?>pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> marque_tx, null, null, null, null, $rounding).'%'; ?>marque_tx, null, null, null, null, $rounding).'%'; ?> trans('Option'); ?>trans('Option'); ?> total_ht); ?>total_ht); ?> + info_bits & 2) == 2) { ?> id.'#line_'.$line->id; ?>"> @@ -202,7 +202,7 @@ + situation_counter == 1 || !$this->situation_cycle_ref) { print 'id . '">'; @@ -213,7 +213,7 @@ + 0) { ?> id; ?>"> @@ -226,7 +226,7 @@ browser->phone)?' class="tdlineupdown"':''); ?>>browser->phone)?' class="linecolmove tdlineupdown"':' class="linecolmove"'); ?>> '; print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), $status, 1); print ''; -print ' '; print ''; -print '  '; print ''; print '
    '; + print ''; if ($user->rights->cron->delete) { print "id."&status=".$status."&action=delete\" title=\"".dol_escape_htmltag($langs->trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'),'delete')."  "; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 6664550e5c875..ac64bcc90bd32 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -81,14 +81,14 @@ if (empty($donation_date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); $action = "create"; $error++; } if (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); $action = "create"; $error++; } @@ -136,14 +136,14 @@ if (empty($donation_date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); $action = "create"; $error++; } if (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); $action = "create"; $error++; } diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 55b7d9377a30f..14389887faa50 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -43,6 +43,7 @@ $limit = $conf->liste_limit; $statut=isset($_GET["statut"])?$_GET["statut"]:"-1"; +$search_all=GETPOST('sall','alpha'); $search_ref=GETPOST('search_ref','alpha'); $search_company=GETPOST('search_company','alpha'); $search_name=GETPOST('search_name','alpha'); @@ -51,14 +52,29 @@ if (!$user->rights->don->lire) accessforbidden(); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { - $search_ref=""; + $search_all=""; + $search_ref=""; $search_company=""; $search_name=""; $search_amount=""; } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('orderlist')); + + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'd.rowid'=>'Id', + 'd.ref'=>'Ref', + 'd.lastname'=>'Lastname', + 'd.firstname'=>'Firstname', +); + + + /* * View */ @@ -83,6 +99,10 @@ { $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; } +if (trim($search_all) != '') +{ + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} if (trim($search_company) != '') { $sql .= natural_search('d.societe', $search_company); @@ -120,6 +140,18 @@ print '
    '."\n"; if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($search_all) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall)); + } + print ""; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","", $param,"",$sortfield,$sortorder); diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 9f298e42b32fb..07c6a6029e8c0 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -100,7 +100,7 @@ if (! $ecmdir->label) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; $ok=false; } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 64a9c46f0de28..54c514ec1f2b4 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -100,7 +100,7 @@ if (empty($_FILES['userfile']['tmp_name'])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("File")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); } if (! $error) diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 47239aa3acd74..0531050aa3d95 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -100,7 +100,7 @@ if (empty($_FILES['userfile']['tmp_name'])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("File")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); } if (! $error) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 91c570a39a721..3ca2c18bf6c3d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -520,7 +520,7 @@ dol_fiche_head(''); - print '
    '; + print '
    '; // Ref print ''; - print ''; + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall)); } - */ + + // Filter on categories + $moreforfilter=''; + if ($type == 'c' || $type == 'p') + { + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
    '; + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$formother->select_categories('customer',$search_categ,'search_categ',1); + $moreforfilter.='
    '; + } + // If the user can view prospects other than his' + if ($user->rights->societe->client->voir || $socid) + { + $moreforfilter.='
    '; + $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); + $moreforfilter.='
    '; + } + } + if ($type == 'f') + { + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
    '; + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$formother->select_categories('supplier',$search_categ,'search_categ',1); + $moreforfilter.='
    '; + } + } if (! empty($moreforfilter)) { - print '
    '; + print '
    '; print $moreforfilter; - $parameters=array(); + $parameters=array('type'=>$type); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '; } - print '
    '; @@ -662,6 +662,8 @@ print '
    '; + + print ''; @@ -1533,9 +1535,9 @@ */ if ($action != 'presend') { - print '
    '; - - $objectref = dol_sanitizeFileName($object->ref); + print '
    '; + + $objectref = dol_sanitizeFileName($object->ref); $filedir = $conf->expedition->dir_output . "/sending/" .$objectref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; @@ -1552,14 +1554,14 @@ //$linktoelem = $form->showLinkToObjectBlock($object); //if ($linktoelem) print '
    '.$linktoelem; - print '
    '; + print '
    '; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'shipping',$socid); - print '
    '; + print ''; } /* diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 096208742deb8..26f6683a43b80 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2014 Francis Appels + * Copyright (C) 2014-2015 Francis Appels * * 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 @@ -568,7 +568,7 @@ function valid($user, $notrigger=0) $result=$soc->set_as_client(); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $numref = $this->getNextNumRef($soc); } @@ -981,7 +981,7 @@ function update($user=null, $notrigger=0) } } - /** + /** * Delete shipment. * Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element) * @@ -990,9 +990,13 @@ function update($user=null, $notrigger=0) function delete() { global $conf, $langs, $user; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + if ($conf->productbatch->enabled) + { + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; + } $error=0; + $this->error=''; // Add a protection to refuse deleting if shipment has at least one delivery $this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment @@ -1003,15 +1007,6 @@ function delete() } $this->db->begin(); - - if ($conf->productbatch->enabled) - { - require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; - if (ExpeditionLineBatch::deletefromexp($this->db,$this->id) < 0) - { - $error++;$this->errors[]="Error ".$this->db->lasterror(); - } - } // Stock control if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > 0) { @@ -1020,7 +1015,7 @@ function delete() $langs->load("agenda"); // Loop on each product line to add a stock movement - $sql = "SELECT cd.fk_product, cd.subprice, ed.qty, ed.fk_entrepot"; + $sql = "SELECT cd.fk_product, cd.subprice, ed.qty, ed.fk_entrepot, ed.rowid as expeditiondet_id"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,"; $sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql.= " WHERE ed.fk_expedition = ".$this->id; @@ -1035,26 +1030,62 @@ function delete() { dol_syslog(get_class($this)."::delete movement index ".$i); $obj = $this->db->fetch_object($resql); - - //var_dump($this->lines[$i]); + $mouvS = new MouvementStock($this->db); - $mouvS->origin = &$this; - // We decrement stock of product (and sub-products) - // We use warehouse selected for each line - $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr",$this->ref)); - if ($result < 0) + // we do not log origin because it will be deleted + $mouvS->origin = null; + // get lot/serial + $lotArray = null; + if ($conf->productbatch->enabled) { - $error++; - break; + $lotArray = ExpeditionLineBatch::fetchAll($this->db,$obj->expeditiondet_id); + if (! is_array($lotArray)) + { + $error++;$this->errors[]="Error ".$this->db->lasterror(); + } } + if (empty($lotArray)) { + // no lot/serial + // We increment stock of product (and sub-products) + // We use warehouse selected for each line + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr", $this->ref)); + if ($result < 0) + { + $error++;$this->errors=$this->errors + $mouvS->errors; + break; + } + } + else + { + // We increment stock of batches + // We use warehouse selected for each line + foreach($lotArray as $lot) + { + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->dluo_qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); + if ($result < 0) + { + $error++;$this->errors=$this->errors + $mouvS->errors; + break; + } + } + } } } else { - $error++; + $error++;$this->errors[]="Error ".$this->db->lasterror(); } } - + + // delete batch expedition line + if (! $error && $conf->productbatch->enabled) + { + if (ExpeditionLineBatch::deletefromexp($this->db,$this->id) < 0) + { + $error++;$this->errors[]="Error ".$this->db->lasterror(); + } + } + if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet"; @@ -1073,13 +1104,13 @@ function delete() if ($this->db->query($sql)) { - // Call trigger - $result=$this->call_trigger('SHIPPING_DELETE',$user); - if ($result < 0) { $error++; } - // End call triggers + // Call trigger + $result=$this->call_trigger('SHIPPING_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers - if (! $error) - { + if (! $error) + { $this->db->commit(); // We delete PDFs @@ -1106,8 +1137,8 @@ function delete() } return 1; - } - else + } + else { $this->db->rollback(); return -1; diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 2011bd9c6f981..5253156e32a19 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -188,11 +188,12 @@ static function fetchAll($db,$id_line_expdet) $sql.= " WHERE fk_expeditiondet=".(int) $id_line_expdet; dol_syslog(__METHOD__ ."", LOG_DEBUG); - $resql=$db->query($sql); - if ($resql) - { + $resql=$db->query($sql); + if ($resql) + { $num=$db->num_rows($resql); - $i=0; + $i=0; + $ret = array(); while ($i<$num) { $tmp=new self($db); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 82bf1d01e6a63..2fd7bbb359a16 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -88,9 +88,7 @@ $commande->fetch($id); $result=$commande->set_date_livraison($user,$datelivraison); if ($result < 0) - { - $mesg='
    '.$commande->error.'
    '; - } + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setdeliveryaddress' && $user->rights->commande->creer) @@ -98,6 +96,8 @@ $commande = new Commande($db); $commande->fetch($id); $commande->setDeliveryAddress(GETPOST('delivery_address_id','int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setmode' && $user->rights->commande->creer) @@ -105,7 +105,24 @@ $commande = new Commande($db); $commande->fetch($id); $result = $commande->setPaymentMethods(GETPOST('mode_reglement_id','int')); - if ($result < 0) dol_print_error($db,$commande->error); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); +} + +if ($action == 'setavailability' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result=$commande->availability(GETPOST('availability_id')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); +} + +if ($action == 'setdemandreason' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result=$commande->demand_reason(GETPOST('demand_reason_id')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setconditions' && $user->rights->commande->creer) @@ -113,7 +130,8 @@ $commande = new Commande($db); $commande->fetch($id); $result=$commande->setPaymentTerms(GETPOST('cond_reglement_id','int')); - if ($result < 0) dol_print_error($db,$commande->error); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } // shipping method @@ -121,8 +139,18 @@ $commande = new Commande($db); $commande->fetch($id); $result=$commande->setShippingMethod(GETPOST('shipping_method_id', 'int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } +// warehouse +if ($action == 'setwarehouse' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result = $commande->setWarehouse(GETPOST('warehouse_id', 'int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); +} /* @@ -164,8 +192,8 @@ } // Onglet commande - $nbrow=8; - if (! empty($conf->projet->enabled)) $nbrow++; + //$nbrow=8; + //if (! empty($conf->projet->enabled)) $nbrow++; print ''; @@ -286,6 +314,27 @@ print ''; print ''; + // Warehouse + if (! empty($conf->stock->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + print ''; + print ''; + } + // Terms of payment print '"; - $statstring.= ''; + $statstring.= ''; $statstring.= ""; } if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring.= ""; - $statstring.= ''; + $statstring.= ''; $statstring.= ""; } if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; - $statstring2.= ''; + $statstring2.= ''; $statstring2.= ""; } print $statstring; diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 198d31666c3e7..a415ae57b1c1f 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -57,6 +57,8 @@ * View */ +$form=new Form($b); + $title=$langs->trans("ThirdParty"); if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Info"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; @@ -82,11 +84,21 @@ dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
    '; + + print '
    '; - print '
    '; + print ''; + if ($action != 'editwarehouse' && $user->rights->commande->creer) + print ''; + print '
    '; + print $langs->trans('Warehouse'); + print 'id.'">'.img_edit($langs->trans('SetWarehouse'),1).'
    '; + print '
    '; + if ($action == 'editwarehouse') { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->warehouse_id, 'warehouse_id', 1); + } else { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->warehouse_id, 'none'); + } + print '
    '; print ''; + print ''; // Qty already shipped $qtyProdCom=$objp->qty; @@ -677,7 +726,7 @@ print ''.$langs->trans("WarehouseSource").''; print ''; + //print ''; + } - print '
    '; @@ -529,7 +578,7 @@ } // Qty ordered - print ''.$objp->qty.'' . ($objp->qty!=1?''.$objp->qty.'':$objp->qty) . ''; - print $formproduct->selectWarehouses(-1,'entrepot_id','',1); + print $formproduct->selectWarehouses(! empty($commande->warehouse_id)?$commande->warehouse_id:-1,'entrepot_id','',1); if (count($formproduct->cache_warehouses) <= 0) { print '   '.$langs->trans("WarehouseSourceNotDefined").' '.$langs->trans("AddOne").''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index c32b6505cb111..f456bc0db8b7a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -833,13 +833,13 @@ if (! GETPOST('fk_c_type_fees') > 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Vat")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); $action=''; } @@ -849,7 +849,7 @@ if (empty($object_ligne->fk_projet) || $object_ligne->fk_projet==-1) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Project")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Project")), null, 'errors'); } }*/ @@ -857,13 +857,13 @@ if (empty($object_ligne->date) || $object_ligne->date=="--") { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } // Si aucun prix n'est rentré if($object_ligne->value_unit==0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UP")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UP")), null, 'errors'); } // S'il y'a eu au moins une erreur @@ -956,13 +956,13 @@ if (! GETPOST('fk_c_type_fees') > 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Vat")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); $action=''; } @@ -1100,13 +1100,13 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -1321,56 +1321,56 @@ if ($action == 'save') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); if ($ret == 'html') print '
    '; } if ($action == 'save_from_refuse') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); if ($ret == 'html') print '
    '; } if ($action == 'delete') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); if ($ret == 'html') print '
    '; } if ($action == 'validate') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); if ($ret == 'html') print '
    '; } if ($action == 'paid') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); if ($ret == 'html') print '
    '; } if ($action == 'cancel') { $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>"")); - $ret=$form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1); + $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1); if ($ret == 'html') print '
    '; } if ($action == 'brouillonner'): - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); if ($ret == 'html') print '
    '; endif; if ($action == 'refuse') // Deny { $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); if ($ret == 'html') print '
    '; } if ($action == 'delete_line') { - $ret=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); if ($ret == 'html') print '
    '; } @@ -1669,7 +1669,7 @@ print img_picto($langs->trans("Document"), "object_generic"); print ' '.$piece_comptable.''; } - print ''; + print ''; print '"; - // Client - print ""; - print ''; - print ''; - // Statut print ''; - print "\n"; + print "\n"; print ''; // Date print ''; - print "\n"; + print "\n"; print ''; print '
    '.$langs->trans("DateStart").''.$langs->trans("DateStart").''; $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print '
    '.$langs->trans("DateEnd").''.$langs->trans("DateEnd").''; $form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1); print ''.$objp->date.''.dol_print_date($db->jdate($objp->date), 'day').''; if ($objp->projet_id > 0) { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 920c6aa16d791..0dba68b5b5cc3 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1534,7 +1534,7 @@ function load_board($user) $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; - $response->img=img_object($langs->trans("ExpenseReports"),"user"); + $response->img=img_object($langs->trans("ExpenseReports"),"trip"); while ($obj=$this->db->fetch_object($resql)) { diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ba3b652a3a977..4a12d25f8f2d8 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -39,6 +39,7 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'expensereport','',''); +$sall = GETPOST('sall'); $search_ref = GETPOST('search_ref'); $search_user = GETPOST('search_user','int'); $search_amount_ht = GETPOST('search_amount_ht','alpha'); @@ -66,6 +67,14 @@ if ($search_status == '') $search_status=-1; if ($search_user == '') $search_user=-1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'd.ref'=>'Ref', + 'u.lastname'=>'Lastname', + 'u.firstname'=>"Firstname", +); + + /* * View */ @@ -101,6 +110,11 @@ $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid"; $sql.= " WHERE d.entity = ".$conf->entity; +// Search all +if (!empty($sall)) +{ + $sql.= natural_search(array_keys($fieldstosearchall), $sall); +} // Ref if(!empty($search_ref)){ $sql.= " AND d.ref LIKE '%".$db->escape($search_ref)."%'"; @@ -183,6 +197,16 @@ print_barre_liste($langs->trans("ListTripsAndExpenses"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''."\n"; if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } print ''; print ""; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index bba5ceb1ee1df..d64cbca648f2c 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -211,7 +211,7 @@ // Show filter box print ''; print ''; -print '
    '; +print '
    '; print ''; // Company /* @@ -237,8 +237,8 @@ print ''; print '

    '; -print '
    '.$langs->trans("Filter").'
    '; -print ''; +print '
    '; +print ''; print ''; print ''; print ''; diff --git a/htdocs/expensereport/synchro_compta.php b/htdocs/expensereport/synchro_compta.php index 3e2a7c21d3448..59a6b8926fe12 100644 --- a/htdocs/expensereport/synchro_compta.php +++ b/htdocs/expensereport/synchro_compta.php @@ -108,13 +108,13 @@ if ($_GET["action"] == 'ndfTOaccount'): $idTrip = $_GET['idTrip']; - $ret=$html->formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1); if ($ret == 'html') print '
    '; endif; if ($_GET["action"] == 'accountTOndf'): $idTrip = $_GET['idTrip']; - $ret=$html->formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1); if ($ret == 'html') print '
    '; endif; @@ -212,4 +212,4 @@ llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index ceab5d547149f..e087041100338 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -320,7 +320,7 @@ } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ExportModelName")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportModelName")), null, 'errors'); } } diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 8f9f7946e562e..ca3bcea14584f 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -123,7 +123,7 @@ print ''; include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; -$model=new ModeleExports(); +$model=new ModeleExports($db); $liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties $var=true; diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 89efad03841b5..899ecaf980575 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -72,13 +72,21 @@ */ print '
    '.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").'
    '; - // Ref - print '"; - print ''; - - $nbrow=4; + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + $nbrow=3; + // Client + print ""; + print ''; print '
    '.$langs->trans("Ref")."'.$object->ref.'
    '.$langs->trans("Ref").''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); + print '
    ".$langs->trans("Customer")."'; + print ''.$soc->name.''; + print ''; - + /* * Documents */ @@ -124,7 +132,7 @@ print "
    \n"; // Conversion du PDF en image png si fichier png non existant - if (! file_exists($fileimage) && ! file_exists($fileimagebis)) + if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) { if (class_exists("Imagick")) { @@ -141,21 +149,14 @@ print "
    ".$langs->trans("Customer")."'; - print ''.$soc->name.''; - print '
    '.$langs->trans("Status").'".$object->getLibStatut(4)."".$object->getLibStatut(4)."
    '.$langs->trans("Date").'".dol_print_date($object->datec,"daytext")."".dol_print_date($object->datec,"daytext")."
    '; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index e63fb8c3da01f..c1e7a3aaca2aa 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -392,7 +392,7 @@ function setValid($user, $notrigger=0) $now=dol_now(); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->thirdparty); } diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 81a2db9621c5a..03b217f9a9173 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Charlie Benke @@ -67,11 +67,9 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +print $langs->trans("Intervention").':'; print "
    '.$langs->trans("SearchAnIntervention").'
    '.$langs->trans("Search").'
    '; -print $langs->trans("Ref").':
    '.$langs->trans("Other").':

    \n"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 74051b5bc703a..896d8c6a4fa41 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -64,7 +64,7 @@ $sall=GETPOST('sall'); $optioncss = GETPOST('optioncss','alpha'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_ref=""; $search_company=""; @@ -72,6 +72,17 @@ $search_status=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'f.ref'=>'Ref', + 's.nom'=>"ThirdParty", + 'f.description'=>'Description', + 'f.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate"; +if (! empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall['f.description']); + + /* * View */ @@ -110,9 +121,7 @@ if ($socid) $sql.= " AND s.rowid = " . $socid; if ($sall) { - $arraytosearch=array('f.ref', 'f.description', 's.nom'); - if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $arraytosearch=array('f.ref', 'f.description', 's.nom', 'fd.description'); - $sql .= natural_search($arraytosearch, $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -135,11 +144,22 @@ print '
    '."\n"; if ($optioncss != '') print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$urlparam,'width="15%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder); if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index c39acd9dd2988..113f83265f214 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Francis Appels * * 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,83 +49,42 @@ { $producttmp=new ProductFournisseur($db); $producttmp->fetch($idprod); - - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; - $sql.= " pfp.ref_fourn,"; - $sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,"; - $sql.= " pfp.fk_supplier_price_expression, pfp.tva_tx, s.nom as name"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = pfp.fk_soc"; - $sql.= " WHERE pfp.fk_product = ".$idprod; - $sql.= " AND p.tobuy = 1"; - $sql.= " AND s.fournisseur = 1"; - $sql.= " ORDER BY s.nom, pfp.ref_fourn DESC"; - - dol_syslog("Ajax::getSupplierPrices", LOG_DEBUG); - $result=$db->query($sql); - - if ($result) + $productSupplierArray = $producttmp->list_product_fournisseur_price($idprod, 's.nom, pfp.quantity, pfp.price'); // We list all price per supplier, and then firstly with the lower quantity. So we can choose first one with enough quantity into list. + if ( is_array($productSupplierArray)) { - $num = $db->num_rows($result); - - if ($num) + foreach ($productSupplierArray as $productSupplier) { - require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; - $i = 0; - while ($i < $num) + $price = $productSupplier->fourn_price * (1 - $productSupplier->fourn_remise_percent / 100); + $unitprice = $productSupplier->fourn_unitprice * (1 - $productSupplier->fourn_remise_percent / 100); + + $title = $productSupplier->fourn_name.' - '.$productSupplier->fourn_ref.' - '; + + if ($productSupplier->fourn_qty == 1) { - $objp = $db->fetch_object($result); - - if (!empty($objp->fk_supplier_price_expression)) { - $priceparser = new PriceParser($db); - $price_result = $priceparser->parseProductSupplier($idprod, $objp->fk_supplier_price_expression, $objp->quantity, $objp->tva_tx); - if ($price_result >= 0) { - $objp->fprice = $price_result; - if ($objp->quantity >= 1) - { - $objp->unitprice = $objp->fprice / $objp->quantity; - } - } - } - - $price = $objp->fprice * (1 - $objp->remise_percent / 100); - $unitprice = $objp->unitprice * (1 - $objp->remise_percent / 100); - - $title = $objp->name.' - '.$objp->ref_fourn.' - '; - - if ($objp->quantity == 1) - { - $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/"; - } - $title.= $objp->quantity.' '.($objp->quantity == 1 ? $langs->trans("Unit") : $langs->trans("Units")); - - if ($objp->quantity > 1) - { - $title.=" - "; - $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); - - $price = $unitprice; - } - if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) - { - $title.=" + "; - $title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency); - $price += $objp->unitcharges; - } - if ($objp->duration) $label .= " - ".$objp->duration; - - $label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); - if ($objp->ref_fourn) $label.=' ('.$objp->ref_fourn.')'; - - $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title); - $i++; + $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/"; } - - $db->free($result); + $title.= $productSupplier->fourn_qty.' '.($productSupplier->fourn_qty == 1 ? $langs->trans("Unit") : $langs->trans("Units")); + + if ($productSupplier->fourn_qty > 1) + { + $title.=" - "; + $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); + $price = $unitprice; + } + if ($productSupplier->fourn_unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) + { + $title.=" + "; + $title.= price($productSupplier->fourn_unitcharges,0,$langs,0,0,-1,$conf->currency); + $price += $productSupplier->fourn_unitcharges; + } + + $label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); + if ($productSupplier->fourn_ref) $label.=' ('.$productSupplier->fourn_ref.')'; + + $prices[] = array("id" => $productSupplier->product_fourn_price_id, "price" => price($price,0,'',0), "label" => $label, "title" => $title); } } - + // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 55993221d41d8..805fe3071156d 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -131,16 +131,15 @@ dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"),0,'company'); - + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + print '
    '; + print '
    '; print '
    '; - print ''; // Alias names (commercial, trademark or alias names) - print '"; @@ -168,35 +167,6 @@ print ''; } - // Address - print ''; - - // Zip / Town - print ''; - print ''; - - // Country - print ''; - - // EMail - print ''; - - // Web - print ''; - - // Phone - print ''; - - // Fax - print ''; - // Assujetti a TVA ou pas print ''; print ''; } print ''; // Price base - print ''; print ''; if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - print ''; + print ''; } if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { print ''; } print ''; - print ''; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print ''; print ''; print ''; if (! empty($conf->dynamicprices->enabled)) { @@ -930,7 +1035,7 @@ function on_change() { } print '"; - print '"; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '"; //Price if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled)) @@ -944,14 +1049,14 @@ function on_change() { } else { - print '"; - print '"; + print '"; + print '"; if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled print ''; } } - print ''; - print ''; + print ''; + print ''; // User print ''; @@ -1204,7 +1309,7 @@ function on_change() { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1277,7 +1382,7 @@ function on_change() { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1286,18 +1391,18 @@ function on_change() { print ''; print ''; - print ''; - print ''; - print ''; - // Print the search button - print ''; - print ''; - if (count($prodcustprice->lines) > 0) { - $var = False; + print ''; + print ''; + print ''; + // Print the search button + print ''; + print ''; + + $var = False; foreach ($prodcustprice->lines as $line) { @@ -1357,19 +1462,6 @@ function on_change() { print "
    '.$langs->trans("ThirdPartyName").''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','',''); - print '
    '.$langs->trans('AliasNameShort').''; + print '
    '.$langs->trans('AliasNameShort').''; print $object->name_alias; print "
    '.$langs->trans("Address").''; - dol_print_address($object->address,'gmap','thirdparty',$object->id); - print '
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'
    '.$langs->trans("Country").''; - //$img=picto_from_langcode($object->country_code); - $img=''; - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; - print '
    '.$langs->trans('EMail').''.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'
    '.$langs->trans("Web").''.dol_print_url($object->url).'
    '.$langs->trans("Phone").''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
    '.$langs->trans('VATIsUsed').''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7b028ec89a154..38c16797fa731 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -392,7 +392,7 @@ function valid($user,$idwarehouse=0,$notrigger=0) $soc->fetch($this->fourn_id); // Check if object has a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); } @@ -464,6 +464,7 @@ function valid($user,$idwarehouse=0,$notrigger=0) { $result = 1; $this->log($user, 1, time()); // Statut 1 + $this->statut = 1; $this->ref = $num; } @@ -688,7 +689,7 @@ function approve($user, $idwarehouse=0, $secondlevel=0) $soc->fetch($this->fourn_id); // Check if object has a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); } @@ -1574,6 +1575,7 @@ function delete($user='') $result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user); if ($result < 0) { + $this->errors[]='ErrorWhenRunningTrigger'; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); return -1; } @@ -1586,6 +1588,8 @@ function delete($user='') dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1596,12 +1600,14 @@ function delete($user='') if ($this->db->affected_rows($resql) < 1) { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } } else { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1611,6 +1617,8 @@ function delete($user='') $result=$this->deleteExtraFields(); if ($result < 0) { + $this->error='FailToDeleteExtraFields'; + $this->errors[]='FailToDeleteExtraFields'; $error++; dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } @@ -1618,7 +1626,11 @@ function delete($user='') // Delete linked object $res = $this->deleteObjectLinked(); - if ($res < 0) $error++; + if ($res < 0) { + $this->error='FailToDeleteObjectLinked'; + $this->errors[]='FailToDeleteObjectLinked'; + $error++; + } if (! $error) { @@ -1633,6 +1645,7 @@ function delete($user='') if (! dol_delete_file($file,0,0,0,$this)) // For triggers { $this->error='ErrorFailToDeleteFile'; + $this->errors[]='ErrorFailToDeleteFile'; $error++; } } @@ -1642,6 +1655,7 @@ function delete($user='') if (! $res) { $this->error='ErrorFailToDeleteDir'; + $this->errors[]='ErrorFailToDeleteDir'; $error++; } } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a8e56922b9fda..05330fa231985 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -930,7 +930,7 @@ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0) { $num = $force_number; } - else if (preg_match('/^[\(]?PROV/i', $this->ref)) + else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->client); } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 9c4a95c7c52af..cf580459a9caa 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -58,7 +58,7 @@ class ProductFournisseur extends Product var $fourn_remise_percent; // discount for quantity (percent) var $fourn_remise; // discount for quantity (amount) var $product_fourn_id; // supplier id - var $fk_availability; // availability delay + var $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) var $fourn_unitprice; var $fourn_tva_npr; @@ -229,7 +229,7 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai else { $this->db->rollback(); - return 1; + return -1; } } else @@ -312,7 +312,7 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai else { $this->db->rollback(); - return 1; + return -1; } } else @@ -370,7 +370,8 @@ function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) //$this->fourn_tva_npr = $obj->fourn_tva_npr; // TODO this field not exist in llx_product_fournisseur_price. We should add it ? $this->fk_supplier_price_expression = $obj->fk_supplier_price_expression; - if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) { + if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) + { $priceparser = new PriceParser($this->db); $price_result = $priceparser->parseProductSupplier($this->fk_product, $this->fk_supplier_price_expression, $this->fourn_qty, $this->fourn_tva_tx); if ($price_result >= 0) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d69c86eb1eac3..37809f6bf8763 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -359,7 +359,7 @@ // Product not selected $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); } if ($idprod == -1) { @@ -784,7 +784,7 @@ } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Delivery")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); } } @@ -1083,7 +1083,7 @@ $upload_dir_tmp = $vardir.'/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); + dol_remove_file_process(GETPOST('removedfile','alpha'),0); $action='presend'; } @@ -1675,7 +1675,10 @@ $object->date_commande=dol_now(); // We check if number is temporary number - if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty); + if (preg_match('/^[\(]?PROV/i',$object->ref) || empty($object->ref)) // empty should not happened, but when it occurs, the test save life + { + $newref = $object->getNextNumRef($object->thirdparty); + } else $newref = $object->ref; if ($newref < 0) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index cb91a65b34176..c9de3c6a340e4 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -61,11 +61,9 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +print $langs->trans("SupplierOrder").':'; print "
    '.$langs->trans("SearchOrder").'
    '.$langs->trans("Search").'
    '; -print $langs->trans("Ref").':
    '.$langs->trans("Other").':

    \n"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5b37229024c96..6681b5808612b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -38,13 +38,13 @@ $langs->load("sendings"); +$sall=GETPOST('search_all'); $search_ref=GETPOST('search_ref'); $search_refsupp=GETPOST('search_refsupp'); $search_company=GETPOST('search_company'); $search_user=GETPOST('search_user'); $search_ht=GETPOST('search_ht'); $search_ttc=GETPOST('search_ttc'); -$sall=GETPOST('search_all'); $search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7' $optioncss = GETPOST('optioncss','alpha'); @@ -74,6 +74,17 @@ if ($search_status == '') $search_status=-1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'cf.ref'=>'Ref', + 'cf.ref_supplier'=>'RefSupplier', + //'pd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'cf.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate"; + + /* * View @@ -141,7 +152,7 @@ } if ($sall) { - $sql .= natural_search(array('cf.ref', 'cf.ref_supplier', 'cf.note_public', 'cf.note_private'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($socid) $sql.= " AND s.rowid = ".$socid; @@ -190,6 +201,19 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print '
    '; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","",$param,'',$sortfield,$sortorder); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5a54cc84068fd..f3f9dc6afa306 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -716,7 +716,7 @@ // Product not selected $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); } if ($idprod == -1) { @@ -917,7 +917,7 @@ $upload_dir_tmp = $vardir.'/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); + dol_remove_file_process(GETPOST('removedfile','alpha'),0); $action='presend'; } @@ -1515,8 +1515,8 @@ $txt=$langs->trans("SupplierOrder"); } print ''."\n"; } @@ -385,8 +374,8 @@ $quantity = GETPOST('qty') ? GETPOST('qty') : "1"; if ($rowid) { - print ''; - print $product->fourn_qty; + print ''; + print $object->fourn_qty; } else { @@ -402,15 +391,23 @@ $mysoc2 = clone $mysoc; $mysoc2->name='Fictive seller with same country'; $mysoc2->tva_assuj=1; - $default_vat=get_default_tva($mysoc2, $mysoc, $product->id, 0); + $default_vat=get_default_tva($mysoc2, $mysoc, $object->id, 0); print ''; print ''; @@ -424,7 +421,7 @@ foreach ($price_expression->list_price_expression() as $entry) { $price_expression_list[$entry->id] = $entry->title; } - $price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($product->fk_supplier_price_expression ? $product->fk_supplier_price_expression : '0'); + $price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($object->fk_supplier_price_expression ? $object->fk_supplier_price_expression : '0'); print $form->selectarray('eid', $price_expression_list, $price_expression_preselection); print ' 
    '.$langs->trans("PriceExpressionEditor").'
    '; print ''; @@ -451,22 +448,21 @@ function on_change() { // Price qty min print ''; - print ''; // Discount qty min print ''; - print ''; print ''; - - // Delai livraison jours + // Delivery delay in days print ''; print ''; - print ''; + print ''; print ''; // Charges ???? @@ -476,7 +472,7 @@ function on_change() { { print ''; print ''; - print ''; print ''; } @@ -484,7 +480,7 @@ function on_change() { if (is_object($hookmanager)) { - $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id); + $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); } @@ -513,7 +509,7 @@ function on_change() { { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; print $langs->trans("AddSupplierPrice").''; } } @@ -527,19 +523,19 @@ function on_change() { { // Suppliers list title print '
    '.$txt.''.$objectsrc->getNomUrl(1); - //We check if Origin document has already an invoice attached to it - $objectsrc->fetchObjectLinked($originid,'','','invoice_supplier'); + // We check if Origin document (id and type is known) has already at least one invoice attached to it + $objectsrc->fetchObjectLinked($originid,$origin,'','invoice_supplier'); $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); if ($cntinvoice>=1) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 05459d0bd69e4..4252e4a9ef668 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -68,6 +68,7 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="fac.datef,fac.rowid"; +$search_all = GETPOST('sall'); $search_ref = GETPOST("search_ref","int"); $search_ref_supplier = GETPOST("search_ref_supplier","alpha"); $search_label = GETPOST("search_label","alpha"); @@ -86,17 +87,30 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { + $search_all=""; $search_ref=""; $search_ref_supplier=""; $search_label=""; $search_company=""; $search_amount_no_tax=""; $search_amount_all_tax=""; + $search_status=""; $year=""; $month=""; - $filter=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'fac.ref'=>'Ref', + 'fac.ref_supplier'=>'RefSupplier', + //'fd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'fac.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["fac.note_private"]="NotePrivate"; + + + /* * Actions */ @@ -148,16 +162,10 @@ { $sql .= " AND s.rowid = ".$socid; } -if ($filter && $filter != -1) // GETPOST('filtre') may be a string +if ($search_all) { - $filtrearr = explode(",", $filter); - foreach ($filtrearr as $fil) - { - $filt = explode(":", $fil); - $sql .= " AND " . $filt[0] . " = " . $filt[1]; - } + $sql.= natural_search(array_keys($fieldstosearchall), $search_all); } - if ($search_ref) { if (is_numeric($search_ref)) $sql .= natural_search(array('fac.ref'), $search_ref); @@ -215,7 +223,7 @@ if ($search_status != '') { - $sql.= " AND fac.fk_statut = '".$db->escape($search_status)."'"; + $sql.= " AND fac.fk_statut = ".$search_status; } $nbtotalofrecords = 0; @@ -251,10 +259,23 @@ if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter); if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($search_status >= 0) $param.="&search_status=".$search_status; print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''; if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($search_all) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall)); + } + print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.ref,fac.rowid","",$param,"",$sortfield,$sortorder); @@ -308,8 +329,8 @@ print ''; } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 4d20f1f7302c5..72f8ed2b0b2e4 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -65,8 +65,12 @@ // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('pricesuppliercard','globalcard')); -$product = new ProductFournisseur($db); -$product->fetch($id,$ref); + +$object = new ProductFournisseur($db); +if ($id > 0 || $ref) +{ + $object->fetch($id,$ref); +} $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -82,22 +86,18 @@ if ($cancel) $action=''; $parameters=array('socid'=>$socid, 'id_prod'=>$id); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { if ($action == 'remove_pf') { - $product = new ProductFournisseur($db); - if ($product->fetch($id) > 0) + if ($rowid) { - if ($rowid) - { - $result=$product->remove_product_fournisseur_price($rowid); - $action = ''; - setEventMessage($langs->trans("PriceRemoved")); - } + $result=$object->remove_product_fournisseur_price($rowid); + $action = ''; + setEventMessage($langs->trans("PriceRemoved")); } } @@ -119,7 +119,7 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("VATRateForSupplierProduct")), null, 'errors'); } if (! is_numeric($tva_tx)) { @@ -131,19 +131,19 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), null, 'errors'); } if (empty($ref_fourn)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefSupplier")), null, 'errors'); } if ($id_fourn <= 0) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, 'errors'); } if ($_POST["price"] < 0 || $_POST["price"] == '') { @@ -151,7 +151,7 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); } else { @@ -159,34 +159,26 @@ } } - $product = new ProductFournisseur($db); - $result=$product->fetch($id); - if ($result <= 0) - { - $error++; - setEventMessages($product->error, $product->errors, 'errors'); - } - if (! $error) { $db->begin(); if (! $error) { - $ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice + $ret=$object->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice if ($ret == -3) { $error++; - $product->fetch($product->product_id_already_linked); - $productLink = $product->getNomUrl(1,'supplier'); + $object->fetch($object->product_id_already_linked); + $productLink = $object->getNomUrl(1,'supplier'); setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors'); } else if ($ret < 0) { $error++; - setEventMessage($product->error, 'errors'); + setEventMessage($object->error, 'errors'); } } @@ -195,14 +187,14 @@ $supplier=new Fournisseur($db); $result=$supplier->fetch($id_fourn); if (isset($_POST['ref_fourn_price_id'])) - $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days); + $ret=$object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days); if ($ret < 0) { $error++; - setEventMessage($product->error, $product->errors, 'errors'); + setEventMessage($object->error, $object->errors, 'errors'); } else { @@ -217,11 +209,11 @@ } } if (! $error && ! empty($conf->dynamicprices->enabled)) { - $ret=$product->setPriceExpression($price_expression); + $ret=$object->setPriceExpression($price_expression); if ($ret < 0) { $error++; - setEventMessage($product->error, 'errors'); + setEventMessage($object->error, 'errors'); } } } @@ -251,23 +243,20 @@ $form = new Form($db); -if ($id || $ref) +if ($id > 0 || $ref) { if ($action <> 're-edit') { - $product = new ProductFournisseur($db); - $result = $product->fetch($id,$ref); - //$result = $product->fetch_fourn_data($_REQUEST["id_fourn"]); - llxHeader("","",$langs->trans("CardProduct".$product->type)); + llxHeader("","",$langs->trans("CardProduct".$object->type)); } if ($result) { if ($action <> 'edit' && $action <> 're-edit') { - $head=product_prepare_head($product); - $titre=$langs->trans("CardProduct".$product->type); - $picto=($product->type== Product::TYPE_SERVICE?'service':'product'); + $head=product_prepare_head($object); + $titre=$langs->trans("CardProduct".$object->type); + $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'suppliers', $titre, 0, $picto); @@ -276,18 +265,18 @@ // Reference print ''; print ''; print ''; // Label - print ''; + print ''; // Minimum Price print ''; print ''; print '
    '; print ''; print ''; - $liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); - print $form->selectarray('filtre', $liststatus, $filter, 1); + $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('filtre', $liststatus, $search_status, 1); print ''; print ''; print ''; diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php deleted file mode 100644 index 14bd6298ea80f..0000000000000 --- a/htdocs/fourn/list.php +++ /dev/null @@ -1,332 +0,0 @@ - - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2015 Florian Henry - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/fourn/list.php - * \ingroup fournisseur - * \brief Home page of supplier area - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - -$langs->load("suppliers"); -$langs->load("orders"); -$langs->load("companies"); - -$socname = GETPOST("socname"); -$search_name = GETPOST("search_name"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_supplier_code = GETPOST("search_supplier_code"); -$search_supplier_accounting = GETPOST("search_supplier_accounting"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST('search_categ','int'); -$search_status = GETPOST("search_status",'int'); -$catid = GETPOST("catid",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); -$optioncss = GETPOST('optioncss','alpha'); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user,'societe',$socid,''); - -$page = GETPOST('page','int'); -$sortorder = GETPOST('sortorder','alpha'); -$sortfield = GETPOST('sortfield','alpha'); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="nom"; - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('supplierlist')); -$extrafields = new ExtraFields($db); - -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $socname=""; - $search_name=""; - $search_zipcode=""; - $search_town=""; - $search_supplier_code=""; - $search_supplier_accounting=""; - $search_datec=""; - $search_categ=""; - $search_status=''; - $catid=""; - $search_country=""; - $search_type_thirdparty=""; -} - -if ($search_status=='') $search_status=1; // always display activ customer first - -$extrafields->fetch_name_optionals_label('thirdparty'); - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - -/* - * View - */ - -$form=new Form($db); -$htmlother=new FormOther($db); -$thirdpartystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - -$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, "; -$sql.= "code_fournisseur, code_compta_fournisseur"; -$sql.= ",s.fk_pays"; -$sql.= ",typent.code as typent_code"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; -// Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cf ON s.rowid = cf.fk_soc"; // We need this table joined to the select in order to filter by categ -$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur = 1"; -$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql .= " AND s.rowid = ".$socid; -if ($socname) { - $sql .= natural_search('s.nom', $socname); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -if ($search_name) $sql .= natural_search(array('s.nom', 's.name_alias'), $search_name); -if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; -if ($search_town) $sql .= natural_search('s.town', $search_town); -if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'"; -if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'"; -if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; -if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status); -if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL"; -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; - -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} -$sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($conf->liste_limit+1, $offset); -//print $sql; - -dol_syslog('fourn/list.php:', LOG_DEBUG); -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - - $param = "&search_name=".htmlspecialchars($search_name); - $param.="&search_supplier_code=".htmlspecialchars($search_supplier_code); - $param.="&search_zipcode=".htmlspecialchars($search_zipcode); - $param.="&search_town=".htmlspecialchars($search_town); - if ($search_categ != '') $param.='&search_categ='.htmlspecialchars($search_categ); - if ($search_status != '') $param.='&search_status='.htmlspecialchars($search_status); - if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies'); - - print ''."\n"; - if ($optioncss != '') print ''; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1); - $moreforfilter.='       '; - } - if ($moreforfilter) - { - print '
    '; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
    '; - } - - print ''; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="right"',$sortfield,$sortorder); - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print '\n"; - - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - $thirdpartystatic->id=$obj->socid; - $thirdpartystatic->name=$obj->name; - $thirdpartystatic->status=$obj->status; - $thirdpartystatic->name_alias=$obj->name_alias; - - print ""; - print '\n"; - print ''."\n"; - print ''."\n"; - //Country - print ''; - //Type ent - print ''; - print ''; - print ''; - print ''; - - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - print "
    '; - print $form->select_country($search_country,'search_country'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print "
    '; - print $thirdpartystatic->getNomUrl(1,'supplier'); - print "'.$obj->zip.''.$obj->town.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.$obj->code_fournisseur.' '.$obj->code_compta_fournisseur.' '.dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3).'
    \n"; - print "\n"; - $db->free($resql); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -} -else -{ - dol_print_error($db); -} - -$db->close(); - -llxFooter(); diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index de3a470ba908c..b0d6b4affa2b5 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -62,13 +62,13 @@ if (! GETPOST("$ftp_name",'alpha')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); } if (! GETPOST("$ftp_server",'alpha')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Server")), null, 'errors'); } if (! $error) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 25d23594787f6..d9200363f6dae 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -84,20 +84,26 @@ $description = trim(GETPOST('description')); $userID = GETPOST('userID'); + // If no start date + if ($type <= 0) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); + $error++; + $action='create'; + } + // If no start date if (empty($date_debut)) { header('Location: card.php?action=request&error=nodatedebut'); exit; } - // If no end date if (empty($date_fin)) { header('Location: card.php?action=request&error=nodatefin'); exit; } - // If start date after end date if ($date_debut > $date_fin) { @@ -128,22 +134,27 @@ exit; } - $cp->fk_user = $userid; - $cp->description = $description; - $cp->date_debut = $date_debut; - $cp->date_fin = $date_fin; - $cp->fk_validator = $valideur; - $cp->halfday = $halfday; - $cp->fk_type = $type; - - $verif = $cp->create($user); - + $result = 0; + + if (! $error) + { + $cp->fk_user = $userid; + $cp->description = $description; + $cp->date_debut = $date_debut; + $cp->date_fin = $date_fin; + $cp->fk_validator = $valideur; + $cp->halfday = $halfday; + $cp->fk_type = $type; + + $result = $cp->create($user); + } + // If no SQL error we redirect to the request card - if ($verif > 0) + if ($result > 0) { $db->commit(); - header('Location: card.php?id='.$verif); + header('Location: card.php?id='.$result); exit; } else @@ -151,7 +162,7 @@ $db->rollback(); // Otherwise we display the request form with the SQL error message - header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error); + header('Location: card.php?action=request'); exit; } } diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index ee4465a4aeee6..b309eade0f4cd 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -53,6 +53,7 @@ $id = GETPOST('id','int'); +$sall = GETPOST('sall'); $search_ref = GETPOST('search_ref'); $month_create = GETPOST('month_create'); $year_create = GETPOST('year_create'); @@ -64,7 +65,7 @@ $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_ref=""; $month_create=""; @@ -78,6 +79,12 @@ $search_statut=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'cp.rowid'=>'Ref', + 'cp.description'=>'Description', +); + /* * Actions @@ -171,6 +178,12 @@ if(!empty($search_statut) && $search_statut != -1) { $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; } +// Search all +if (!empty($sall)) +{ + $filter.= natural_search(array_keys($fieldstosearchall), $sall); +} + /************************************* * Fin des filtres de recherche @@ -218,26 +231,13 @@ $title = $langs->trans("User"); dol_fiche_head($head, 'paidholidays', $title, 0, 'user'); - print ''; - - // Ref - print ''; - print ''; - print ''; - - // LastName - print ''; - print ''; - print "\n"; - - // FirstName - print ''; - print ''; - print "\n"; - - print '
    '.$langs->trans("Ref").''; - print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); - print '
    '.$langs->trans("LastName").''.$fuser->lastname.'
    '.$langs->trans("FirstName").''.$fuser->firstname.'

    '; + dol_banner_tab($fuser,'id','',$user->rights->user->user->lire || $user->admin); + + + print '
    '; + + print '
    '; + } else { @@ -265,6 +265,18 @@ print '
    '."\n"; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; + +if ($sall) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); +} + print ''; print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",'','',$sortfield,$sortorder); diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php new file mode 100644 index 0000000000000..771f2e243bcec --- /dev/null +++ b/htdocs/hrm/admin/admin_establishment.php @@ -0,0 +1,126 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/admin/admin_establishment.php + * \ingroup HRM + * \brief HRM Establishment module setup page + */ +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; + +$langs->load("admin"); +$langs->load('hrm'); + +if (! $user->admin) + accessforbidden(); + +$error=0; + +$action = GETPOST('action', 'alpha'); + +$object = new Establishment($db); + +/* + * Actions + */ + +/* + * View + */ +$page_name = "Establishments"; +llxHeader('', $langs->trans($page_name)); + +$form = new Form($db); + +dol_htmloutput_mesg($mesg); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans("HRMSetup"), $linkback); + +// Configuration header +$head = hrm_admin_prepare_head(); +dol_fiche_head($head, 'establishments', $langs->trans("HRM"), 0, "user"); + +$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status"; +$sql.= " FROM ".MAIN_DB_PREFIX."establishment as e"; +$sql.= " WHERE e.entity = ".$conf->entity; + +$result = $db->query($sql); +if ($result) +{ + $var=false; + $num = $db->num_rows($result); + + $i = 0; + + // Load attribute_label + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($num) + { + $establishmentstatic=new Establishment($db); + + while ($i < $num && $i < $max) + { + $obj = $db->fetch_object($result); + $fiscalyearstatic->id=$obj->rowid; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=!$var; + $i++; + } + + } + else + { + print ''; + } + + print '
    '.$langs->trans("Ref").''.$langs->trans("Name").''.$langs->trans("Address").''.$langs->trans("Zipcode").''.$langs->trans("Town").''.$langs->trans("Status").'
    '.img_object($langs->trans("ShowEstablishment"),"building").' '.$obj->rowid.''.$obj->name.''.$obj->address.''.$obj->zip.''.$obj->town.''.$establishmentstatic->LibStatut($obj->status,5).'
    '.$langs->trans("None").'
    '; +} +else +{ + dol_print_error($db); +} + +dol_fiche_end(); + +// Buttons +print ''; + +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php new file mode 100644 index 0000000000000..7dba43927401f --- /dev/null +++ b/htdocs/hrm/admin/admin_hrm.php @@ -0,0 +1,58 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/admin/admin_hrm.php + * \ingroup HRM + * \brief HRM module setup page + */ +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +$langs->load("admin"); +$langs->load('hrm'); + +if (! $user->admin) + accessforbidden(); + +$action = GETPOST('action', 'alpha'); + +/* + * Actions + */ + +/* + * View + */ +$page_name = "Parameters"; +llxHeader('', $langs->trans($page_name)); + +$form = new Form($db); + +dol_htmloutput_mesg($mesg); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans("HRMSetup"), $linkback); + +// Configuration header +$head = hrm_admin_prepare_head(); +dol_fiche_head($head, 'parameters', $langs->trans("HRM"), 0, "user"); + +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/admin/index.html b/htdocs/hrm/admin/index.html new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/htdocs/hrm/class/employee.class.php b/htdocs/hrm/class/employee.class.php new file mode 100644 index 0000000000000..4014bb717f221 --- /dev/null +++ b/htdocs/hrm/class/employee.class.php @@ -0,0 +1,226 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/class/employee.class.php + * \ingroup HRM + * \brief File of class to manage employees + */ + +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; + +/** + * Class to manage establishments + */ +class Employee extends CommonObject +{ + public $element='employee'; + public $table_element='user'; + public $table_element_line = ''; + public $fk_element = 'fk_user'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + var $rowid; + + var $name; + var $address; + var $zip; + var $town; + var $status; // 0=open, 1=closed + var $entity; + + var $statuts=array(); + var $statuts_short=array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + + return 1; + } + + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + $sql = "SELECT rowid, firstname, lastname, status, fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."user"; + $sql.= " WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ( $result ) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + $this->name = $obj->name; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->status = $obj->status; + + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } + + /** + * Return a link to the employee card (with optionaly the picto) + * Use this->id,this->lastname, this->firstname + * + * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) + * @param string $option On what the link point to + * @param integer $notooltip 1=Disable tooltip on picto and name + * @param int $maxlen Max length of visible employee name + * @param int $hidethirdpartylogo Hide logo of thirdparty + * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login + * @param string $morecss Add more css on link + * @return string String with URL + */ + function getNomUrl($withpictoimg=0, $option='', $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='') + { + global $langs, $conf; + + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0; + + $result = ''; + $companylink = ''; + $link = ''; + + $label = '' . $langs->trans("Employee") . ''; + $label.= '
    '; + $label.= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'',''); + $label.= '
    ' . $langs->trans("EMail").': '.$this->email; + $label.='
    '; + if (! empty($this->photo)) + { + $label.= '
    '; + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); + $label.= '
    '; + } + + $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $langs->load("users"); + $label=$langs->trans("ShowUser"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + $link.= '>'; + $linkend=''; + + //if ($withpictoimg == -1) $result.='
    '; + $result.=$link; + if ($withpictoimg) + { + $paddafterimage=''; + if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; + if ($withpictoimg > 0) $picto='
    '.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
    '; + else $picto='
    '.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
    '; + $result.=$picto; + } + if (abs($withpictoimg) != 2) + { + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
    '; + if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); + else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
    '; + } + $result.=$linkend; + //if ($withpictoimg == -1) $result.='
    '; + $result.=$companylink; + return $result; + } + + /** + * Return status label of an employee + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Return label of given status + * + * @param int $statut Id statut + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function LibStatut($statut,$mode=0) + { + global $langs; + $langs->load('users'); + + if ($mode == 0) + { + $prefix=''; + if ($statut == 1) return $langs->trans('Enabled'); + if ($statut == 0) return $langs->trans('Disabled'); + } + if ($mode == 1) + { + if ($statut == 1) return $langs->trans('Enabled'); + if ($statut == 0) return $langs->trans('Disabled'); + } + if ($mode == 2) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 3) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 4) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 5) + { + if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + } + } +} diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php new file mode 100644 index 0000000000000..c5ba77fd54716 --- /dev/null +++ b/htdocs/hrm/class/establishment.class.php @@ -0,0 +1,324 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/class/establishment.class.php + * \ingroup HRM + * \brief File of class to manage establishments + */ + +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; + +/** + * Class to manage establishments + */ +class Establishment extends CommonObject +{ + public $element='establishment'; + public $table_element='establishment'; + public $table_element_line = ''; + public $fk_element = 'fk_establishment'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + var $rowid; + + var $name; + var $address; + var $zip; + var $town; + var $status; // 0=open, 1=closed + var $entity; + + var $statuts=array(); + var $statuts_short=array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + + return 1; + } + + /** + * Create object in database + * + * @param User $user User making creation + * @return int <0 if KO, >0 if OK + */ + function create($user) + { + global $conf; + + $error = 0; + + $now=dol_now(); + + $this->db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."establishment ("; + $sql.= "name"; + $sql.= ", address"; + $sql.= ", zip"; + $sql.= ", town"; + $sql.= ", status"; + $sql.= ", entity"; + $sql.= ", datec"; + $sql.= ", fk_user_author"; + $sql.= ") VALUES ("; + $sql.= " '".$this->name."'"; + $sql.= ", '".$this->address."'"; + $sql.= ", '".$this->zip."'"; + $sql.= ", '".$this->town."'"; + $sql.= ", ".$this->status; + $sql.= ", ".$conf->entity; + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ", ". $user->id; + $sql.= ")"; + + $this->db->begin(); + + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { + $error ++; + $this->errors[] = "Error " . $this->db->lasterror(); + } + + if (! $error) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "establishment"); + } + + // Commit or rollback + if ($error) { + foreach ( $this->errors as $errmsg ) { + dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); + $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); + } + $this->db->rollback(); + return - 1 * $error; + } else { + $this->db->commit(); + return $this->id; + } + } + + /** + * Update record + * + * @param User $user User making update + * @return int <0 if KO, >0 if OK + */ + function update($user) + { + global $langs; + + // Check parameters + if (empty($this->name)) + { + $this->error='ErrorBadParameter'; + return -1; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."establishment"; + $sql .= " SET name = '".$this->name."'"; + $sql .= ", address = '".$this->address."'"; + $sql .= ", zip = '".$this->zip."'"; + $sql .= ", town = '".$this->town."'"; + $sql .= ", status = '".$this->status."'"; + $sql .= ", fk_user_mod = " . $user->id; + $sql .= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $this->db->commit(); + return 1; + } else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return - 1; + } + } + + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + $sql = "SELECT rowid, name, address, zip, town, status"; + $sql.= " FROM ".MAIN_DB_PREFIX."establishment"; + $sql.= " WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ( $result ) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + $this->name = $obj->name; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->status = $obj->status; + + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } + + /** + * Delete record + * + * @param int $id Id of record to delete + * @return int <0 if KO, >0 if OK + */ + function delete($id) + { + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."establishment WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + + /** + * Give a label from a status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function getLibStatus($mode=0) + { + return $this->LibStatus($this->status,$mode); + } + + /** + * Give a label from a status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function LibStatus($status,$mode=0) + { + global $langs; + + if ($mode == 0) + { + return $langs->trans($this->statuts[$status]); + } + if ($mode == 1) + { + return $langs->trans($this->statuts_short[$status]); + } + if ($mode == 2) + { + if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'status4').' '.$langs->trans($this->statuts_short[$status]); + if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'status8').' '.$langs->trans($this->statuts_short[$status]); + } + if ($mode == 3) + { + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status4'); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status8'); + } + if ($mode == 4) + { + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status4').' '.$langs->trans($this->statuts[$status]); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status8').' '.$langs->trans($this->statuts[$status]); + } + if ($mode == 5) + { + if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'status4'); + if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'status8'); + } + } + + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + function info($id) + { + $sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e'; + $sql.= ' WHERE e.rowid = '.$id; + + dol_syslog(get_class($this)."::fetch info", LOG_DEBUG); + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + if ($obj->fk_user_modif) + { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_mod); + $this->user_modification = $muser; + } + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->tms); + } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } + +} diff --git a/htdocs/hrm/class/index.html b/htdocs/hrm/class/index.html new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/htdocs/hrm/employee/index.html b/htdocs/hrm/employee/index.html new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/htdocs/hrm/employee/list.php b/htdocs/hrm/employee/list.php new file mode 100644 index 0000000000000..1635ba41cdaf3 --- /dev/null +++ b/htdocs/hrm/employee/list.php @@ -0,0 +1,223 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/employee/list.php + * \ingroup core + * \brief Page of users + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/employee.class.php'; + +if (! $user->rights->hrm->employee->read) + accessforbidden(); + +$langs->load("users"); +$langs->load("companies"); +$langs->load("hrm"); + +// Security check (for external users) +$socid=0; +if ($user->societe_id > 0) + $socid = $user->societe_id; + +$sall=GETPOST('sall','alpha'); +$search_user=GETPOST('search_user','alpha'); +$search_login=GETPOST('search_login','alpha'); +$search_lastname=GETPOST('search_lastname','alpha'); +$search_firstname=GETPOST('search_firstname','alpha'); +$search_statut=GETPOST('search_statut','alpha'); +$search_thirdparty=GETPOST('search_thirdparty','alpha'); +$optioncss = GETPOST('optioncss','alpha'); + +if ($search_statut == '') $search_statut='1'; + +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +$limit = $conf->liste_limit; +if (! $sortfield) $sortfield="u.login"; +if (! $sortorder) $sortorder="ASC"; + +$employeestatic = new Employee($db); +$companystatic = new Societe($db); +$form = new Form($db); + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) +{ + $search_user=""; + $search_login=""; + $search_lastname=""; + $search_firstname=""; + $search_statut=""; + $search_thirdparty=""; +} + + +/* + * View + */ + +llxHeader('',$langs->trans("ListOfEmployees")); + +$buttonviewhierarchy=''; + +print load_fiche_titre($langs->trans("ListOfEmployees"), $buttonviewhierarchy); + +$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.gender,"; +$sql.= " u.datec,"; +$sql.= " u.tms as datem,"; +$sql.= " u.ldap_sid, u.statut, u.entity,"; +$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,"; +$sql.= " s.nom as name, s.canvas"; +$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; +$sql.= " WHERE u.employee >= '1'"; +$sql.= " AND u.entity IN (".getEntity('user',1).")"; + +if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; +if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); +if ($search_login != '') $sql.= natural_search("u.login", $search_login); +if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); +if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; +if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall); +$sql.=$db->order($sortfield,$sortorder); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + + print '
    '."\n"; + if ($optioncss != '') print ''; + + $param="search_user=".$search_user."&sall=".$sall; + $param.="&search_statut=".$search_statut; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + + print ''; + print ''; + print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) + { + print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + } + print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; + + // Search bar + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++; + print ''; + print ''; + print ''; + print ''; + print ''; + + // Status + print ''; + + print ''; + + print "\n"; + + $employee2=new Employee($db); + + $var=True; + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var=!$var; + + $employeestatic->id=$obj->rowid; + $employeestatic->ref=$obj->label; + $employeestatic->login=$obj->login; + $employeestatic->statut=$obj->statut; + $employeestatic->email=$obj->email; + $employeestatic->gender=$obj->gender; + $employeestatic->societe_id=$obj->fk_soc; + $employeestatic->firstname=''; + $employeestatic->lastname=$obj->login; + + $li=$employeestatic->getNomUrl(1,'',0,0,24,1); + + print ""; + print ''; + print ''; + print ''; + + // Resp + print ''; + + // Statut + $employeestatic->statut=$obj->statut; + print ''; + print ''; + print "\n"; + $i++; + } + print "
     '; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; + print ''; + print '
    '; + print $li; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"),'star'); + } + print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).''; + if ($obj->login2) + { + $employee2->login=$obj->login2; + //$employee2->lastname=$obj->lastname2; + //$employee2->firstname=$obj->firstname2; + $employee2->lastname=$employee2->login; + $employee2->firstname=''; + print $employee2->getNomUrl(1); + } + print ''.$employeestatic->getLibStatut(5).' 
    "; + print "
    \n"; + $db->free($result); +} +else +{ + dol_print_error($db); +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php new file mode 100644 index 0000000000000..533ad5117ffc9 --- /dev/null +++ b/htdocs/hrm/establishment/card.php @@ -0,0 +1,410 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/establishment/card.php + * \brief Page to show an establishment + */ +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +$langs->load("admin"); +$langs->load("hrm"); + +// Security check +if (! $user->admin) accessforbidden(); + +$error=0; + +$action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$confirm = GETPOST('confirm','alpha'); +$id = GETPOST('id','int'); + +// List of status +static $tmpstatus2label=array( + '0'=>'OpenEtablishment', + '1'=>'CloseEtablishment' +); +$status2label=array(''); +foreach ($tmpstatus2label as $key => $val) $status2label[$key]=$langs->trans($val); + +$object = new Establishment($db); + +/* + * Actions + */ + +if ($action == 'confirm_delete' && $confirm == "yes") +{ + $result=$object->delete($id); + if ($result >= 0) + { + header("Location: ../admin/admin_establishment.php"); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + } +} + +else if ($action == 'add') +{ + if (! $cancel) + { + $error=0; + + $object->name = GETPOST('name', 'alpha'); + if (empty($object->name)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + $error++; + } + + if (empty($error)) + { + $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); + if (! empty($tmparray['id'])) + { + $object->country_id =$tmparray['id']; + $object->country_code =$tmparray['code']; + $object->country_label=$tmparray['label']; + } + + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); + $object->fk_pays = $object->country_id; + $object->status = GETPOST('status','int'); + $object->fk_user_author = $user->id; + $object->datec = dol_now(); + + $id = $object->create($user); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action='create'; + } + } + else + { + $action='create'; + } + } + else + { + header("Location: ../admin/admin_establishment.php"); + exit; + } +} + +// Update record +else if ($action == 'update') +{ + $error = 0; + + if (! $cancel) { + + $name = GETPOST('name', 'alpha'); + if (empty($name)) { + setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('NameProperty')), 'errors'); + $error ++; + } + $typeid = GETPOST('typeid', 'int'); + if (empty($typeid)) { + setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('TypeProperty')), 'errors'); + $error ++; + } + + if (empty($error)) { + $object->name = GETPOST('name', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); + $object->fk_pays = GETPOST('country_id', 'int'); + $object->rowid = GETPOST('id'); + $object->fk_user_mod = $user->id; + + $id = $object->update(); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action='create'; + } + } + } else { + header("Location: card.php?id=" . $id); + exit; + } +} + +/* + * View + */ + +llxHeader(); + +$form = new Form($db); +$formcompany = new FormCompany($db); + +/* + * Action create + */ +if ($action == 'create') +{ + print load_fiche_titre($langs->trans("NewEstablishment")); + + print '
    '; + print ''; + print ''; + + dol_fiche_head(); + + print ''; + + // Name + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode + print ''; + print ''; + print ''; + print ''; + + // Town + print ''; + print ''; + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Status + print ''; + print ''; + print ''; + + print '
    '; + print ''; + print '
    '; + print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array ( + 'town', + 'selectcountry_id' + ), 6); + print '
    '; + print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array ( + 'zipcode', + 'selectcountry_id' + )); + print '
    '; + print $form->select_country($mysoc->country_id,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
    '; + print $form->selectarray('status',$status2label,GETPOST('status')); + print '
    '; + + dol_fiche_end(); + + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; + + print '
    '; +} +else if ($id) +{ + $result = $object->fetch($id); + if ($result > 0) + { + $head = establishment_prepare_head($object); + + if ($action == 'edit') + { + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building'); + + print '
    ' . "\n"; + print ''; + print ''; + print ''; + + print ''; + + // Ref + print ""; + print ''; + + // Name + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode / Town + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Status + print ''; + + print '
    '.$langs->trans("Ref").''; + print $object->rowid; + print '
    '; + print ''; + print '
    '; + print ''; + print '
    '; + print $formcompany->select_ziptown($object->zip, 'zipcode', array ( + 'town', + 'selectcountry_id' + ), 6) . '
    '; + print $formcompany->select_ziptown($object->town, 'town', array ( + 'zipcode', + 'selectcountry_id' + )) . '
    '; + print $form->select_country($object->fk_pays,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
    '; + print $form->selectarray('status',$status2label,$object->status); + print '
    '; + + dol_fiche_end(); + + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; + + print '
    '; + } + else + { + /* + * Confirm delete + */ + if ($action == 'delete') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete"); + + } + + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building'); + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Name + print ''; + print ''; + print ''; + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode + print ''; + print ''; + print ''; + print ''; + + // Town + print ''; + print ''; + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Status + print ''; + + print "
    '.$langs->trans("Ref").''; + print $object->rowid; + print ''; + print $linkback; + print '
    '.$langs->trans("Name").''.$object->name.'
    '.$langs->trans("Address").''.$object->address.'
    '.$langs->trans("Zipcode").''.$object->zip.'
    '.$langs->trans("Town").''.$object->town.'
    '.$langs->trans("Country").''.getCountry($object->fk_pays,1).'
    '.$langs->trans("Status").''.$object->getLibStatus(4).'
    "; + + dol_fiche_end(); + + /* + * Barre d'actions + */ + + print '
    '; + print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Delete').''; + print '
    '; + } + } + else + { + dol_print_error($db); + } +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/hrm/establishment/index.html b/htdocs/hrm/establishment/index.html new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php new file mode 100644 index 0000000000000..2bf014481ac05 --- /dev/null +++ b/htdocs/hrm/establishment/info.php @@ -0,0 +1,57 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/establishment/info.php + * \brief Page to show info of an establishment + */ + +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; + +$langs->load("admin"); +$langs->load("hrm"); + +// Security check +if (! $user->admin) accessforbidden(); + +$id = GETPOST('id','int'); + +// View +llxHeader(); + +if ($id) +{ + $object = new Establishment($db); + $object->fetch($id); + $object->info($id); + + $head = establishment_prepare_head($object); + + dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building'); + + print '
    '; + dol_print_object_info($object); + print '
    '; + + print ''; +} + +$db->close(); + +llxFooter(); diff --git a/htdocs/hrm/index.html b/htdocs/hrm/index.html new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a103a304630c2..60d57f151035f 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -192,7 +192,7 @@ } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ImportModelName")), null, 'errors'); } } diff --git a/htdocs/index.php b/htdocs/index.php index ef87f437084dc..818da8f9ecd13 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -103,7 +103,7 @@ * Informations area */ -print ''; +print '
    '; print ''; print ''; print ''; @@ -129,7 +129,7 @@ if (empty($user->societe_id)) { print '
    '; - print '
    '.$langs->trans("Informations").'
    '.$langs->trans("User").''.$user->getNomUrl(0).'
    '; + print '
    '; print ''; print ''; print ''; @@ -231,9 +231,10 @@ "SuppliersInvoices", "ExpenseReports"); // Dashboard Link lines - $links=array(DOL_URL_ROOT.'/comm/list.php', - DOL_URL_ROOT.'/comm/prospect/list.php', - DOL_URL_ROOT.'/fourn/list.php', + $links=array( + DOL_URL_ROOT.'/societe/list.php?type=c', + DOL_URL_ROOT.'/societe/list.php?type=p', + DOL_URL_ROOT.'/societe/list.php?type=f', DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members', DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products', DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', diff --git a/htdocs/install/.gitignore b/htdocs/install/.gitignore new file mode 100644 index 0000000000000..7e55df64ce765 --- /dev/null +++ b/htdocs/install/.gitignore @@ -0,0 +1 @@ +/filelist.xml diff --git a/htdocs/install/check.php b/htdocs/install/check.php index c2abbc2a01414..5fa6843978e25 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -71,12 +71,14 @@ // Check PHP version -if (versioncompare(versionphparray(),array(5,2,3)) < 0) // Minimum to use (error if lower) +$arrayphpminversionerror = array(5,3,0); +$arrayphpminversionwarning = array(5,3,0); +if (versioncompare(versionphparray(),$arrayphpminversionerror) < 0) // Minimum to use (error if lower) { print 'Error '.$langs->trans("ErrorPHPVersionTooLow",'5.2.3'); $checksok=0; // 0=error, 1=warning } -else if (versioncompare(versionphparray(),array(5,3,0)) < 0) // Minimum supported (warning if lower) +else if (versioncompare(versionphparray(),$arrayphpminversionwarning) < 0) // Minimum supported (warning if lower) { print 'Error '.$langs->trans("ErrorPHPVersionTooLow",'5.3.0'); $checksok=0; // 0=error, 1=warning diff --git a/htdocs/install/doctemplates/invoices/template_invoice.odt b/htdocs/install/doctemplates/invoices/template_invoice.odt index e9cd7c836fb03..dad29a292efca 100644 Binary files a/htdocs/install/doctemplates/invoices/template_invoice.odt and b/htdocs/install/doctemplates/invoices/template_invoice.odt differ diff --git a/htdocs/install/filelist.xml b/htdocs/install/filelist.xml index fb931f9fcdc5f..f9a296ebde47e 100644 --- a/htdocs/install/filelist.xml +++ b/htdocs/install/filelist.xml @@ -1,5 +1,5 @@ - + d41d8cd98f00b204e9800998ecf8427e @@ -66,7 +66,7 @@ d41d8cd98f00b204e9800998ecf8427e -09889ea5df64284a0e7753cbdf134a53 +7aba69716e92939377bccee8b5c4ada2 d41d8cd98f00b204e9800998ecf8427e @@ -96,11 +96,11 @@ d0a6afda3d75393d3a09e43bb1135b87 -9f1898d4f913c53b7135cb00cccd872c +0f28a7630e864c959d4fb6d6f92304b0 a92b0b6374f698c980928a3bee17ff9a 92c1d275d0117efbece0312787a0736c f8ba5662241d9c908f1f791f72481eb7 -2f1931c293e0ab260b31e2d1b0134f73 +491d3762c5040d7f09f82be0b27ddbea 7367da82258c07fb35aaf3aafd3e1bb7 dd9cf0fdcd7a32f49882b31d894f9bcb eb6e5f08d24f10bdb9f17e6da6f1df6e @@ -111,7 +111,7 @@ b702c4be259106f2e031a8d7a57462a9 ab13e413223fede4e27cdd0d5a112cd4 876371cf283ebd2982d4cacc1640536c -7f5ed41c70e65cc91e731dbf88692d8d +c7db3ca4d5477082bd3251f7d02170ea e3fa076bfc94a80430f9a32aee318da8 c31f65e979da57d157bfb7ec4cdc65df 2a13bfa6db4c63aeab46d3aa2beb353c @@ -127,7 +127,7 @@ 408203a970401705d1735235ba7be850 -9f7444785dc0a2a5670401c4d029f80a +f931df27f98e7f817c266281013860cb b3d708e374e21a5b90cd9b4fc0be482a 52c51ac0c1e841314d48328b7c32b7d3 9d56c5024279a4f5f9b799c6950f18ef @@ -189,7 +189,7 @@ 8868b7d0779aa09e9b52c965e1e96b8a 5c06b9772a487667c388ae2b5714fa91 b2e983fe3f64bb7ec0bd09a8d7225acc -479c9172c6429e0b8a59745beaaff7e2 +f4852e3a84cb84e07ab5a08e082bdb69 bc667a42f1ade75c59cb5ad6103847b7 d63455783346f56c804c166f71bf72b0 31bbae8a1de3e1fb630ac4d83db62d71 @@ -208,7 +208,7 @@ d41d8cd98f00b204e9800998ecf8427e -a5cff5f7aba2c3c8537838168d619b3d +59cb9f641e231673bed98341a8208d40 667cd8a71a675fe06ea29427443e4642 @@ -6029,7 +6029,7 @@ c2187f1d78aecd78bf874e49a926eeb1 -113c537c0a66f07a58e9ba754a7ee2a7 +1c8f0e528720a9c9ded24e76518c9341 6d6695e08c63ce635ca3e2f6a1d6f402 1272ec0d12432850c50005d9c1bb9d92 @@ -6045,7 +6045,7 @@ e3620f73f3a1650f7fdb53e6c44a1c07 -c9851093aa835ac2ab1bdd30e6c9befb +b6255a08ce51ab32895aa41e6230a3f7 7724aa95e287dd12bfcd6a4a9c0e0e72 c2e932610f10f683fb0111a7b7722565 @@ -6060,7 +6060,7 @@ 93b60211370f85ea2df9ee8602e27ac4 -e53980bde7980a91e1a3928370d83559 +e697c15fe969eb5405e16bc49264fa01 0860d2328e5a333731cf95de440f4356 3a728460147fb9af7faf0e587b9fbf42 e80584be003f3f3d859e629c1e84f65f @@ -6068,7 +6068,7 @@ 7438b3ef10b182042dfa722f99ef2574 0899f764c85bbcc13206e3dd8318e678 9f8b43fd1df78dca0827c73e29890865 -ec44fc1fce201dba598024843be29c80 +69583ccb35ec8ad521dd0d9f6814b865 bfefe70e3951f1883a84e7bc4033fe97 @@ -6088,7 +6088,7 @@ ac2861b424e2b7e30a532f37b33d6889 4b9acab98ecbda7e226a1f6848ddfc41 913604462a67f54fd2b2e439373687f1 -b9f9aa3edd84818810e333354981c3ad +cc81befc15da5b8f83fcde8548f3b443 d727abe4a721179026bbf1092cec946c @@ -6151,7 +6151,7 @@ d41d8cd98f00b204e9800998ecf8427e -45b8385dda542a916314adeab20de308 +043214cfec88cbe08e22a93ca425eb13 7b22629626fc5f780cced1f6d817d57b 7dc0092414e8a0160f715413907ef350 @@ -6193,17 +6193,17 @@ 4d9613e1a21fa012ac864d96f1a62112 858d2732221359ba9e0a9965353848c3 -df81fe06744adbdbcf27a69f0b4ce55e +877f5ab5413561ff0dc4afaee336b4a0 d59f578b7eb5f374eda40295072f0fae -c24b93c08c98cf333d2e7652e60456c9 +b928537bcc970549c357bb80ef5ad16f d41d8cd98f00b204e9800998ecf8427e 5c09b3d75fcba736c3353468236e5338 563dbdf25cbfd4e4b50649530f7e1151 -655f7d2edc22d92a676b4f5ea041879e +261d1bb522fccdea41b2573ee4fbf277 0a81d81144952f49baecb31cfc610fee @@ -6224,17 +6224,17 @@ d4bf21d9624e8fef1f9d20465d2e5503 62fc08bff6c9c08fc68bd5ddab35e443 24ec97e48bfe034f3ee795ae9ceb282f -4ec443ce7e02d8c6dff96fc0cbd6c285 +f1039a951ab36cebafbbabd8a4117e73 -a297bb14700fc91ffe3a8ace3d2f7751 -cead2ff721855338e0d61128ffc2ecc5 +b0ddf2ae9be37ebe13ac48a6881616a1 +e4a04d30006545f88d06bd507e542506 25b3ce6e2f12f227c4a1ac8db9fab357 af321d136a1e674037ba2c163db3d2b2 0d79377d6dbbc92ac4ca0db3ede4c00f -9293af8f80fd01193d0379c1761bba8a +05087939aa7580314356261375ceff17 637c350b86faf4b9066532d41dc87fdb @@ -6248,12 +6248,12 @@ 9b2c6de73503cceb102e875a364f6626 -80a3e34168be19d0387e287da1d7f42e +71f0213600f7ced820366e2a29cd1830 65e54e9e6458c353a92eeaafdb0d0022 d41d8cd98f00b204e9800998ecf8427e -ea318b0397fe12ffd8f748d80e09a6ea +18cebf1db58bdd4c52b6b36a9fab1e14 aaeb594d255628a742d183b0c4fff3c6 @@ -6273,8 +6273,8 @@ d41d8cd98f00b204e9800998ecf8427e -e901d2a8027ea0d4a2fd0a2f0c4254c4 -967fa07d1b551bc6bbb1fa5634a783a1 +bc43add6b32c31d1b01ea56190143f5c +09546c41a854e762844c9fa4f2000aa0 abefa8f7d035ae87eb5b45b0c43843be @@ -6288,7 +6288,7 @@ ad62122318a931843599ec66c81cdf02 -0ebc16ded1e4b42a4f1c0d6b9f1dda5e +4ca6185ba6db6546cfeb895c29bbdd34 71d1ef869b5ab59897f399b0d15f6e5f @@ -6302,24 +6302,24 @@ d41d8cd98f00b204e9800998ecf8427e ee74a794201de6cf45f08cc56c789ad7 -214e0edb381e28e12ea19bcc941d71e4 +493e569e803559c55dd06ca35411e0b4 dd8891037d36d4a87969e74f93d88e49 -7513073720e3165c5b9b2a8080eecd18 +655a1635fdf3202e7d7c074a029bf277 b3fd9f9544438ef81401c880177d40fd 5c0c423540accb30a32265a7e909078f d41d8cd98f00b204e9800998ecf8427e -d8f4d806cc9823e961151c44826ffd77 -31ee8e43f5401dc71817b7260a86beab +86fe8e6f4ba1e0da06a5523b1747310e +ee9e658395eb5f6e4e4415ad4b952a1c 502547de717912a19aca06ddd223995c 08d09a43fb6c23ea07250e482e0116d2 311259a2b28384c64ff2443c7feb9d21 -b0446ea619a94e5fa2b3178e293ff30c +c1a2f4393f1fdbcffc80b181fd828d0a d41d8cd98f00b204e9800998ecf8427e @@ -6351,7 +6351,7 @@ d41d8cd98f00b204e9800998ecf8427e -3e83426161f9a2ba6044124f02f345a6 +f1aaa2ddccc69adf4fc2c6e9aad9fe61 7f74cf4fc62967e4f18a2b2d5f49a3f5 50bc7526a36a03c57dca47022c735425 d5093b1fa8a05ed2885905be1351aa57 @@ -6379,9 +6379,9 @@ 20c72a55796b1e64cff84f004b04e76b -e03eba31d58eafe6aad3ff94814bab8c +530655125f0ab31a2406b744e62ae2e0 f15bf7e5916adfd39a30d1d984c28b75 -5c1defd3f977bdde6c68ecca0a596b2f +aaca3ca32321aced0a33feaad8be2867 d41d8cd98f00b204e9800998ecf8427e @@ -6395,9 +6395,9 @@ 3e8b72640f3dd0117bde24b366b7a8f5 56ab66872574c4005a138883a610053c 5c07caec4119e65b0f413c36382fc1fd -45b121da7ae1043feb0990220f7af311 +a651cfc57d02e13f28a7888e42936c6f eb8aec3b6223e224d7e0a3d275119d2c -305f16b73e13c5fd024f6dfce15d6152 +7d586422806dee9c2b3b1bc2040c103a d8bb05e304774532c20b3bfd2640be79 @@ -6587,7 +6587,7 @@ d41d8cd98f00b204e9800998ecf8427e 7a257121b2c9d54226e1e51d67232505 6b6851714ab5e4f9491c2500a26c8ceb -85d3d8fc243475727700d322daf769c8 +8236206d490740be0c025f905d8fedc5 594c6fadbe917f7e36c7b72cfd6a6af2 @@ -6609,16 +6609,16 @@ 8cc4b11d20b0e01eb7e7b7401c2f12c8 10740fb22bfc2ac1b339e9d784cb9c23 e72a1897ed9a078b81e72d66eb3895fc -ed61f7e507113bbde00c18af5b6d8594 +ee2a09d80f4c4301c4c7a35dbac74255 29e218c7e580c35cf99d19f5876b1709 bd68e17f01cde910409d40075ec640bf -abf21aa57d70ffb9f31b5d6071ab8fb1 +19841d0071556ffdf8fbe94d0cddd464 b7c3b27785924f5b023754855bbe3177 2775e6e61e2ab0bdfd17b7ed63dea86e 83554ef1749b5f877cda2173c4fd71f2 3c5adedd71ef8c08b8dfd0213767a814 fa1602ccc625f1e35a7be5e0a2083020 -7621f387a352d44ede2cf4afe0662679 +c4c69d5940cb93e0c41bdb62ff59a2f5 a4a1f69d36f0c22e9eb2767ea3f0adbd @@ -6635,7 +6635,7 @@ 30834b09409d2e8bdf19a7c03ee3e0c0 -8b1537f1d750ea8d2d94e9f17b71ebe4 +c89ef8b181cebf914f489a4849014df4 7fbd04fb747c9df920e68d90c28f6853 @@ -6677,12 +6677,12 @@ 0db78f95e23062feab46593d28704532 d13a1b0fbbc6cafcecd93f460a494cbd 084f9694188a61f84e337a78ed05441d -904fa6ad71728ebc126514a863305f11 +40d4b7bcf8ab72c9640862b4450c1332 02c3c91fb006d3ae2e15455d1d559a91 -1dcbc5b11a925b933b59aa44ac588854 +0fdcd38ce537746580c763cc3bad3867 a5fa4f2f169cad1915a191fc151ad265 fc4eb48545c609f71eaaefb2e061d91b -bf8b3d955aa1deb2e041496544de5f04 +481ba4d57ac39c2afe7e74987c509503 c663d2cee4ea71d024f2defd840527bc 4d33c44d7e7704e5e67b2bc7b183d8ba f0bf2d1c291cff3b62bf2a656b32ea62 @@ -6693,7 +6693,7 @@ 7ab52342b3b370b5b6f6298dc5d4c182 4e6fa59e238b5d4855818e3197dc9931 6cbfa567b0f4153bbc7f74adfe6bb4d2 -6183a5dffea32afc6d961f7d35b80f6e +a50413b4e11d40568247b0f3aeb6edd1 bf50bfa23a12e840e06fdf7f53e157b1 ff02ed2bea96d88f500167a09413c7c0 59877377a38dd5dcee93798ea7923bee @@ -6713,7 +6713,7 @@ 5ab4686cbf0b0d798b37873a6c9bb3df 1889b6eeeef65ae427813873a606a06f 126d87de4a1d8e863a5ad85f840caf2c -56a4403ca54afb568def56c118ac1f3f +f96b3c7931490587edba909bc2a3d73c 4b09fb6f2102d0dc31cccb6a021a275c 56ca46312806229c2d361e9c46ab4533 0b631c9349d4997aca6fa2bcd6a60fc7 @@ -6743,10 +6743,10 @@ dc056bd161ceeab388b54c28790ad27f d41d8cd98f00b204e9800998ecf8427e e403f819edbccb676580a4bab5dc9b85 -9d9ad7310241ddf16640d3f800dbb7bf -327de623b6318783a31bf2402764855e +8ffa067fe180a67ba149c4ae7f319b09 +67ba0ce54c69bd89a57e925941319ae3 07374752b32e65ac21f86c1801ada777 -abbc5ea531df4a7c03949868ee141c38 +b6333dfcde8674d1f76a8fb5b8386627 84b8be2d20c1d6d6811f0298d2234ca8 223bb15e53ca059b66188e2c5d196195 62ecdcff5b99f8bd94f75e2ab7eacd71 @@ -6764,7 +6764,7 @@ 1258865536912e11c70ae0c343576d11 07e043e1c42a0fe90d2226eaacb013e2 f6d4c9c91e2608f8ae916ddf86816560 -c4aae5b40cc7eb4a71878111763cedc4 +1ac25140f51596243217b5ebcdad96fe 78f6029aabbd9f1e2568187f7d2f98c9 a969dd13ed2ab6f921564ecd22121515 ef0ba347561ad5fcd763fabb899bfad0 @@ -6772,7 +6772,7 @@ fb6dfe418a92f6803616c17def007cd2 48cf595e8d99291e756b6f0945c4a656 60c540c4dfb653ef65e67a628645f590 -8caa3b39351927e5159b5a42d5c0f29f +27e975f676e3cda57ed150f82a970644 cc545e426ed2e735bd00cbab8db381bd 98ca2d412c720690b46b8bf566cf4fb5 a9d45ffd6281800146fcfb2e3ab90ab6 @@ -6780,13 +6780,13 @@ 33293e2db3dedadfccccd5d6ac23eaf9 b416db3eacff1ad448692d14aadff327 6e53a89f128e41918ccf5b20b96976b0 -16159cdb43a8ad0715b528bb858a2420 +1c73eacab2a1a619dc70e2f24fba4d1e 0bbc469b628cbc940ebdd59f2e218b6c eff5fc174c1ec328e58b76a3d70a5f2f 116c4c10fccce8d73c9193e742834d3a -aae21d60ccd315a64cd407d301514a94 +f99ce992ef00dd16272190000ca9518d dc63bf62b746ea8d1b1e7833675475d5 -fe594e68a36f30b5fb0931ce4e7944a7 +e5782fe8434c4a711e0d8b3d9c198d75 35cc6ac5381635a8a49523616f0d5e18 595325924223d40b0ea97c9df4ebfde4 aa7ebaddf8d815b3dfd1b3281f26de84 @@ -6799,7 +6799,7 @@ 4eaa5c0e7ce4116e821af9c6ce8c53ed 540b65a840a2f9876551a7963a2aa1bf 48f9b2c134655de1b0f5f7d50f01b765 -e04716adac419184c905fbd611e66931 +be3c22b06cfbbc6e8771a5ba0f7447c3 70c6fc7d08f3c562322c9f53273f1393 @@ -6812,7 +6812,7 @@ 505eddd29e439ed2971f69ab8d38e289 f44ef38f3ae6b30def1d8f4d8b309ba5 68f1afb0ba44e0f93c89b4768001ddde -5bffeecac1842d72c52b88dfa38a0d45 +67e301d4222ce8df3e27dd2b6bacac0d 2616ba6e3e277acabedbe7b36114d851 637f30cfefd948ec5aea16cc25f00f91 4cb7f6d97d38884b63a5adb65dc85870 @@ -6873,11 +6873,11 @@ 69982f8171837cd8669bfe9c2f08dc8f ddf6dfeb77c98411b4d5434f20c24483 c23010fa68c5996cb5977f84a6bb7ceb -90a300e9bd857966226c68dca8660456 +822961d86ae558588632b3b08c085b89 d41d8cd98f00b204e9800998ecf8427e b4e9f07aa5268af49d3bb9429719b201 8293bd60fe13ac64c22f8500b346821c -8c43c3a33ce5882354b25ea6eedd6b0f +dcf77950d1dae6b1e4eb4c8473318bac 413af6ca18377689660d2b2eeed2be98 d2df1ec90f2bebb3ebfb74eba81bcec7 c3b801c60645dff594d33cf0acc43fa5 @@ -6955,7 +6955,7 @@ 0bf2e38d4ce8df49eea23b091ea492f1 -7aeda3f29b8d3517e7134b36fb4f3800 +26eac71fe10cf9b45357d18da527bd63 d41d8cd98f00b204e9800998ecf8427e @@ -7006,14 +7006,14 @@ d41d8cd98f00b204e9800998ecf8427e 4d1fa853732216f28ce54fcf8e4e6207 1277e5c01232300f48a75b9b02bf6e4c -acf8cbedc321fc847761004a22c3557f +9b4de98bf9f90966db0305e9d8aa0de5 7f9e9451a7893997bbda81950b9bf3da -537deaee8ef58fe9387bd4da41e240a7 +934db34fc5470e87467d07401027b6ac 640847d555597c2573213b5dc5515cf1 e8b39a8d6ef02915ddf04bbc93b92d82 184c417ca2d9d734f73867da2c1287f3 -f173dea4e119b8a274e13d67c975e859 -86c7f6e4aaac3b2a30c86cb3d5d083f8 +ae0615307ed643d4c7b0e0bfe4b7e45b +011f89953f9ad322e178a8d183de886e 9836a974ec46db2376f688070eb5f577 4bbee56e9f7b9e39373a5afc8983bd22 @@ -7034,7 +7034,7 @@ d41d8cd98f00b204e9800998ecf8427e 6b8b8ce50599e40cb74603a883f5d49b -b694666f3fab63aa002cf57d9221184f +eb4430a638d6c94ba5e1d0114babe300 d41d8cd98f00b204e9800998ecf8427e @@ -7092,7 +7092,7 @@ 13e922bcc8c5b80bccd436037b6d1983 -00c95231958ea34cb8c2ab03d977fad7 +74bda525f0dda4ec97c808e29637ecb6 d41d8cd98f00b204e9800998ecf8427e @@ -7186,7 +7186,7 @@ d41d8cd98f00b204e9800998ecf8427e 0f7bbaf52bc8737d3a20ff0822895e6a -5ad19942c767e2b7b40bcf7a4557ef96 +2783cf290e6cbfdf4bc3fb56e2d40191 5cba7b9316b591829c756097ae0485cb @@ -7196,7 +7196,7 @@ 5a24a30915985f4921e9977ef5591d37 -1a81e2c1584303fcbd35ffa7959a9548 +38c48f781dec1c3d5af764d1a186e273 581bf4f5d80169d20b9ac13270b44e0c @@ -7210,7 +7210,7 @@ d41d8cd98f00b204e9800998ecf8427e 4dfcdf4d3cb3af826834c1fbb852f513 -9dee214cb227c61a780e61bdb328d8c9 +848dda602b15a270752ab3d14d83e2b6 469386ee98ede1646eb80de2443edb92 @@ -7302,7 +7302,7 @@ 6bcc750e4e3bcf3e3f130e84fa76c000 -c541a34207adc5350b2dc5c1f09b999c +a34e477e026937ded25b3db75628102f d41d8cd98f00b204e9800998ecf8427e @@ -7366,7 +7366,7 @@ d41d8cd98f00b204e9800998ecf8427e 1f21bb9a5810af59b93c076fd23f22f8 abdede0b95ba0317afc2b84d41c6d466 -24061f96041726ee8c39737cf7977c39 +5d52e0ea49c4d289ebcda2e1da293202 8132fb847569fa766adc0c4573f88d01 890b8461abd8f0b87b126e9e770b9909 1f02fab7a9f6f9c4f7e6f55b70d39ad7 @@ -7405,15 +7405,15 @@ 11b50c97effbc90d2bb3a8fdfdf10d82 aec2cbb607f3e669bf11d95c6a2c2a57 9fb34a6db51d3aee921928ca1d42a3db -420ca27e9e8703f76580acfe7dbd081b +b6afeec640440ad686b7ce7ae0cc2a04 98a5d4c239d3736d1f4d477225fa75f3 1921a40ef2e203a9c7e33e33d8481630 -3055a2f7266a60df732a08529a6ca5d1 -eac772a94850fe421d7cb668f16d8502 +20bd3b11f5fcbbcf18440a548e98db90 +74a3eff04b216cdb9d6ec3e20df82f9f d41d8cd98f00b204e9800998ecf8427e @@ -7424,17 +7424,17 @@ 7d040a1858a6f1e8b3d8e7fc68b1b008 -15aec3de90cf1c5a1a4edd5f46cb2bc6 +d2beb46931bb641bf0126092d91149fc a267dd6d9a787dbaa95ee81e9812a81a d41d8cd98f00b204e9800998ecf8427e 890365ca9e5d7857e3532d4c0366f94e b3586b44a75323dbf02f85aea44e25db -6473ee94ef64fe6935f95790230b7574 +5ec9b9433c17cd7e39efe73b6ca47fdf -1699071ff4bb09210ac267d430c05352 +98b2b5f2c5fbc11b2d101f74e6f53550 dfc38f61ccb28814db587e30de81dbc1 e608bfdc1dcb6e0083ef2f07d6abcc80 3c7eb3a309b7b07b8a64dd1c04b1e652 @@ -7461,7 +7461,7 @@ 884f200f728cff6292071327f3333432 -ba371d6791ddb47139e9273fc89e4348 +4c4a05e064908129d88383e08a9a6975 b78b788d5b3e07d4453369e56c1d659a f51c8778bc72faf4f5fd6f52f43b5238 626d8b5925475bd539d310df50ba813d @@ -7476,10 +7476,10 @@ 2f12577c1d455111bb528f3866b65893 -26a046368f569fab6879bf7b4149b5cb +5896d6563d302d330c365a3c64d8408b 280a1ab7fd33d892d6726f352e555c4d 68dc3ea2cd9c6508a925df50fa011221 -8748d27b61bab3f4fe7a2f5fbc4fbea0 +85919d63e768559c976903b253070b04 deac83a4c0eda829eedb0f9136a1fae5 @@ -7487,7 +7487,7 @@ d41d8cd98f00b204e9800998ecf8427e c89f71e71b16be64c27c7859023fd58a 690c8e0cee2b6698e3b48fd0ac4de529 -91acbb4ca5dbdf0dcd92975e15f19e1e +c120700122ee082bcd1bbfa5dd0398bc d41d8cd98f00b204e9800998ecf8427e @@ -7568,7 +7568,7 @@ d41d8cd98f00b204e9800998ecf8427e -e3346a9e88067fed71d467321021ac84 +23752bba338ea1a8b3a230ca8179e4c3 0d1749857d83ca714437ed891e35f046 @@ -7588,15 +7588,20 @@ 6bd38b6af505407d62c60a9eefdf208b -d10524316d94a05190315ed2a537e590 -9698e999326e603af9f0271bb3126e5b -c1ac4d0440f0210376068d50d51c11a5 +d69969e2a9166108538a95b086599544 +740bf2ea7c400568aae6e3ebbb7efac2 + + +e9e895d857f4fadb5d169d98cecc4cb4 + + +c9fa8f71196dbd4da6c319f00412a394 0529ddc77e8c681c33c47b9b7687e810 faa2eda13c5607ace72e34e9c0966a0c 72ddc5bafe07d7b1963a002ff2638ce9 -b8410b68abe62b98765d35b9d68775c0 +55292d144ee7e11471fbba2b249494ad 9e6bbdc99eed41d9480ff63f9c187e81 fc788306c40f210227d440befeb605d2 @@ -7604,14 +7609,14 @@ d41d8cd98f00b204e9800998ecf8427e 6b603e643ce203e1268c44f2560baece 495109ce3cd762f708dea35bff725ecf -d41a0862545eff600497a0bea3f1ab9d +a68a62a40bd64f627b6ee6a3f4aeef96 -c48bf12c8ab59a7e5288dec2171fc487 -766996c5832c22283f845d85c69050b6 +b554b95843ce324153cf63af81c4f467 +49211ad04c8d6486b554f5dfa2549211 b029262dc429f54b44eaac3bb3673fb2 -1f302e022d85d26a771d480ca57c3904 -5b62ce52c0ce74104923cb08c4a2c755 +25cfef0428da4c37fdb47852f49bc1b2 +199b29d1446f63ab1880745ec589933d e2ae08bd4f83213f865545056ac6dd35 43cc87a6b84afe612af178e9c0945279 @@ -7768,9 +7773,9 @@ 3a8904966a2f450f621c5267098f7360 -1c942203fda2bcad764d878ebc0c47a5 +5f6fcd5535f2233dc3dc9fe6312f1fc3 d41d8cd98f00b204e9800998ecf8427e -6d5ed19523464e46013936df91c6ed3c +9d7603b11033ad6fbcb3bbc46d5503d8 9568715bc1f4d7aa42744b4096afb922 @@ -7784,15 +7789,15 @@ be4909eb830f52517bb34572822210b6 d41d8cd98f00b204e9800998ecf8427e 2a2702bd2167fd28271eb4eabca6363c -8da3d77c235c7a7d054ea4ae7311e156 -bb29d8dd50b7570b5744da807dceab8a +fd2dd2fbd7f099628630db64aca7e94f +eac5c0f76e5ff1988532c66b922e800f 26e616b72a49ae4b326a093bd0713303 32e6a6b4b2bc4a78d07dfdcee485c09b 289aeb68be3c5ff2a4cdd57a64257b8e 31431bfb5d4f361b35887e63a0099655 -e03dcf6c18969e1baea2d9828a30f779 +d4e648a77c85398d52bf5915e981484e 3e8c8ff5959ed24ad35c169286978b20 @@ -7800,11 +7805,11 @@ 14182aeabccd7c3a761d93d1564a27f4 -b7fba61cf5866b9933b7ace9bc4f9146 -09d76b5c0967e0be88129f9da3c37531 +0ba364012068975254ac02cf15ccd1b2 +4045e0030818c05ec539a2bd6f3a6d17 -2bd1e1553a9cc566113d900b41bc0fa8 +3042db4b42f2e098badf2c40163287d5 d6d047f9389cde6f11b9175ffda432ac @@ -7817,7 +7822,7 @@ cb26417ed98d172fa1fd331e1985d799 -351fe37b4b23a7ed9d7f1300463e5b39 +9bdff8a4621202d256b03029cdb5bf29 946760ff06abcff5d8863b1e782893f5 d77afff33da4f512b0fb46d1be520cd0 @@ -7878,7 +7883,7 @@ fde1dac27ff95323136138883a8cb086 -2fab1fadb7f83179967aadf4b5d4ddee +bbe63bc9761891dd1f47f5639ac8fd44 d41d8cd98f00b204e9800998ecf8427e @@ -7892,9 +7897,9 @@ 33164d88351d201cc651f7142656c3ea 759762a86ea42322a44b7eadd4b76959 6c456bf952ac5c6889d0360ae3d327a1 -083a136f4b46fc248af19e10563c48cf +188746369ab37b18b1f84b20aced9f0d 80a28b7d54cfb242e531baebbb30e4fb -4d57992c87ecb429b912f6ff7a518656 +6efb95c81d5c8e640155ad63842987e0 fe62c00b682dd677dbca4764d5f0fe97 @@ -7910,7 +7915,7 @@ b6fd5cc801d681b05256bf8b413c9786 104960714a8b404303b3436ef291f2d1 -0ffcb06a700db2a4795b2a1cad18ebe8 +1d56c1cff5f6f94c0fac9cf48fe819ba 2b061d246bb5f2342b9867c346f3f1a7 d592551b67e9dd797f7a36a1b257684b 204000f10fb031ceb45970d4b4996fca @@ -7930,7 +7935,7 @@ ea1a3bd45013d291cafdce135ebbd13c -e8fc223a34a1c80800a0140f5ed6cb09 +f9a7c3d80ef15ebdb16b9f9a4289eaed 221d0b581479c434f039e58da4718a8d a6f5b10b14e766e788351b506b6f6024 cd10645e90733c7d081f7bedaa56b891 @@ -7943,11 +7948,11 @@ d41d8cd98f00b204e9800998ecf8427e -0be05b0ba5c70336ad3873274d006fa0 +191ad6a413e35342ca7cd3460dd9f31a d41d8cd98f00b204e9800998ecf8427e -13c5568a0f6073a044a0fa8c95432c7e +920415a8d70425c1c0476200edc745b3 616dcb2aa65aabb125304d44c6efe355 @@ -7982,20 +7987,20 @@ f47f735ec8627b7b3e9ce6a5e1643d4c 79e09419acc819e70f82f56d7fa81d20 605bb5fb9f548a1cfb766c12c98aa303 -27fe10718d47636d063f37ef9ac4be0b +d5b503dc10a91fc2867f11b806e43aee 0b0532af9e3f441fe8f2e530df0e8b60 61bcd0fc159ba4ac9b4ca405006a458e d41d8cd98f00b204e9800998ecf8427e bcfa3b276dd79437d1d60139fe51de01 -bc057e396358b8d68d513598117a4af9 +b38990d47a4975ee30ed0e3af4a378e3 f9cfd60be746eaea8b3e69fc3fe9fee5 2068f6bb040e517d593f0e5607b8724a e9075781de163cf107fb3202edb3e002 -0ef37e21d2e25895a090ad77e9605685 +5fbdf018aa95b4d6fba8a6520c1395cc 6a6c8a4f2f8305f324705e111f5ab746 9cac9f75f05ba54c2255f7c789a5ab0e @@ -8008,52 +8013,52 @@ a6eeebb304bbe571ffbab0db1d030569 -7e0c6b54f531098e4f352f83f4d34234 +f6145207c408075fd530e364b06a805d e531ddc71cd65c765c78bcadbf10f8d7 ca8137cb50689abf0c3bebe34978dcf7 -abb298e664b2fb11fd634e3d3dbed05a +f924847ab85674ba3200ca27277e0030 db7986081e563555bbb45d35b1dfc823 458d70e686a207a21618c43bb1b9779a -128445fe765c61f01a8f6822e07dfcfe +12fe6ef54baa77f95b323f66280726d9 59ddd81ed9bf99d543f6f3aecb613f99 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 23b68fe48b368fc328f5dadcd75fdfe1 6b1640bc51b7f7eb47b7502f0aaf0d2c 23f198c26ee64d43c1673947c8865329 -7a3a40afaa184399b3341c8d3752ec7f +d425b192e4e4f644e3233a2d63ab5f61 ef10d5d01e0c99da899694a920063a6b -87cd39aa024571ecab3ccadc961e264c +2aaee86d73909262c225b9360c1671c5 fb330418c81c08843a8ecc7b41911c3e -7fbffe58c311fdd7f2c94a75e32d3936 +ec0f990c4626353903979ab05aefc6a3 d9bd6150df07f9517e4ca5056dbe663f d3328f22bef875e75fcc41b404ce8460 -9ee4015d43e5e0d6912b836b06a13de9 +269be72b4c109b1d9407168cc255a548 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 95bb2af8fabef4d78ebdf2a5a9799ecb 8fa3145942e5d0df587b19b538a59e2b c3fb35dd0fefe93bbf0dfd8976709bb7 1ee548ff699369a2ef3328d8c3010048 -6c86fdb742038112276b77762d104b23 +8349c7c6bc6c2d51c9d617d196588c41 d51def48233e07c836e1c7a673186824 -459a9508eb6538bbf7fbdf224bcd4e3f -aa67d5c5a46ddfc225448043268e38e2 +5a7e53549b13ba69bb551e3d13785e3d +8a0ccbf9bbd36a4cc3aeb30517c48280 b7f38fe9df82f9bfdeb39d490bcf2273 c5d8a435b760308bd0c43e3494dea231 -bd5ee5b58b2511b8fe23e96db9451902 -3f6dfeee5347762fb5f9c2993d6fea12 -4a138c319788fb8de9b68cdf175461a4 +b154606cfec9ae71a3084379c3f52643 +2103918d3f7bbc6b25c9ebe75e5ba5bb +8383b83413ec5080325c0104121cc34c be603b1e11232e8e4df3956712576964 afab86bd75994dd422cde6c39712e684 3324c82b9c0e239b743efceb0b1ee4a1 6d984b6497a4521ab43b53f8ffa97239 af2c055b31358dcfbcaff19b8f32d741 0b811b8a0f1113a872111a69e771d294 -8b9a65f71f3a9ea000c870a2a094b5af +f0a5af4ef3fcf089d999c72424dd1534 e1514692701903c4fa8ab6f93685fe9a -183abda9ebd7462f00f4ee7095c84195 -0131eac3feaa89273e8e26c91c2cac37 +7c5ca268a2ea7a6376036f2c81f5b10f +b1e3e3f8550be02bc85065afb34f2465 aa3dd95196d0ec83718e74c22d0a0da3 e2e3cd92d8221808b6348ea0dce50716 2b89db2c940374d7c69527633eb17a27 @@ -8064,56 +8069,56 @@ 55f29464b755eabef4cf655705d4e4fc d7de9e65df06622427243a6b3ed53cd4 c093fba925641be12ad8f06bb542160a -d12217cdca71111f70be333c4eef99dc +5d05efac98c6fd3106f56295ce0b8673 ed3b811dbf2f5f0da999aac45470a2eb -4b3a795b74f619b597f1d2ebd5f0ed4d +d7d541404e019a6d8f45d1347bef2be7 36d8c10a2ce5713bc959bebc6b9bb3af 55323f24685f41d39d6a5d297e3654db -b9c19de6ebfce5bf046caa3bbd6738bb +e5247dca22fac3bb18e72e0171a09447 762641475619347539e2028a53f2ddf9 -9feb7142f076e8cb6562176417105676 -a338de2b2e184a6a79b27c41ef758527 +aadfd180c094b155f2c8ecedf9b7d377 +a3e9bc5dfe51c558cc8277d44fd5c4d4 c7e95ae701ec540f03a566203de781b3 -d9a551b3b77910142a904b5bff66b447 +d67ca33509c6f0eabbd6c661a27ab0e2 c19d107b0434906fbc0b459f61f85117 b273aa429a16fe1379be33876a4d49f7 8869a3a7b2a620a7621d4870c57aef75 -e1161971bb06488cabe9066c8e827741 -5477536cee0c749079f446676f85ba11 -886b27ac5b94fa8a293aeae7226314c5 +1222fe864b75c9d423009dbdad938cdf +9939c5fec9087bfdc82d8dccb2c2f64d +d4bed0644268bf6cd99128f64db17e9a 81ed7b9e30bf240d51d7e60c65e169d8 -8af9297add438b147e7144fc9f16429c +1a1e47204edfd7a39a48bc94a6d87039 94cd6326697d1468356fd7860c279f39 abdc5b264864f9054c2bd3582aa7f290 -5824fe01751d0af34d9a3075de49ca2b +d9c27d2d19632b11e7b5df247d1cb5ce d11b836dcf659c52b30c12fe751664c2 3b21f916c1cc442741493663d4d870f8 8d6ef3890b3855e9c9901f905906f84a e8df1b36eeaf2d3020a71b0e273a4d99 97af8c6ef82a0f244fc815e6e16ccf90 90ec5a83c874481c4db7a861ea540e62 -012cf35d940aed1700ac751a07331a41 +123e1ced012cf5ca86c9b7a4d713bed6 fbbf6dd97870502f3b527a7855cc22fd -171adcd57eecc43d8ebea5bd3cff21dc -a9b978311e891d61a5a0a001933d7a6d +673b7b9a03cff6437a53f372059947bd +b8636271987e671c88b7a23c312319dc 8ff03a197fb775293900b1652cbc2cae bbcc88993e093b880a682371243cc500 -28eb991ac8777246895a581c360a9daa -7b7811b0028140c1b0369fe9aa94304c -0c898de20d09cf4914877ebf2695dd53 +7b3c1047d31736f0b995520bf5c770ec +d74e66986a63465cfd73af9d5dd1a180 +c2855a7d06669f944c7aaca53532b7d8 10d1641217a535f93ec6a25fb693b58f 72edeb3570c0c46201f53a9ecafea7cf -47f5032648762db635d3ac9e03848d6d +39b1a98ee31c34a9a67fd7f2eccf931d f3b0f3b7f9597a5081dd6901be2eef39 c1da4b8a0934373f032daa2da245a23b 9bc9627697f6507eaac340ce462ea48f -d31e5e9b017c68c52f39451f6a4888ee +7d6fa21f3d0ab0a5b4b676a64fe44c6a fb0d8c3726d85a9e032c4aba68fe5ca7 -eb245be274ad480eb8d849529678aea9 -1f5d636a4df5141cf03332bf7192e96a -4c3b11586abcc5df7e395609ee7131be +312ed461e418e5e8b3e152dd2227bbae +3dfd632c14282d44c6d202e30378822c +a77857a410bf6a20d1bc65d57df426e3 45bc4e783f1c8f3b4cc8887ff320ac8a 02140c8aab60d378c25d218f29d4fd51 6a019476090e0d2e7e18ff0cb90d8244 @@ -8121,68 +8126,71 @@ 344d119920534915d078b0bcf8139e6c 537f4288b80ea71ac01cd85436796b2b 5a39128e50a6a619cab4a84ed21fb5b0 -6d59726d14209ced062616f6eabb9963 -65b5c3e29f240fad7628e628e4f4b988 -ef7b6fa3ddd58753aa2f9e99c606c61e +9bdc51515920cae4374eecfd6037275a +a2da3a94a599ef497665bb9273f94082 +a81beb34507c2da511e5cd5783f2d2b3 1fb6c4f678f781062defcb85377e1223 -c294d42b0c532a0d0ed0ecd75b2da20f -02b4f98405e26fe54399ae5cf3d8e884 -dc9564fc481ddd3101734b4e01c40027 +503179eef2a75e444e6ed540ab5816af +3a63b5ca883378d2e5b3ffc0bd8367ba 329a3456692fb25e9ddd96dba6698739 -5b5402436d2e5525c68fe96889c8628b -14b937be198fc9c37d706a131f110c68 +cf2e582534edc6a59ece7d22c939c00c +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +378e17fcf077672377ccbeef64dad311 da1eb7c39da28b862a798f37efa7ee43 -538ab10324a9a151d1944f94b590e3e2 +b2ee3e61485fdeb685fc7f73bf802b23 +7d6b8f45303f24ad769fb402b9416bb5 dd8e45a37c5ef0fc6089df59605c284e +db59948d8443a30f976ef562646c108e -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 6448daf1b06217c7dc989bed6f3709a2 fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -78faa2226aeb9f90e52c0f6239002838 -69cfd106af7ce7110c61b93f7f0a1968 +34c7fde492170f80fe8e0e6434f3eb0b +829a72b83190364f8f94374443eea9fa 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 59b195fcff4d3877045fee21c364d524 @@ -8193,55 +8201,55 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -f8ae1145d1789cc4f49042e9c9b8c394 +d6c2e5a1d98c4af9f39c3e6f602f9f65 737685ba123e361bbd63da12001d1853 ead226130a7b08a13a2aeabf710b3b7b -7e44776be6e3c6d6cf1e14df5499c125 +2a441d2cb8444b1051bf199845319bfc 2e6a497a7e9cc16c543c8691b7505ce8 -3ff6460227ded412fd9384126ad371e8 +a39f58718f334dc2bae68db45ff92b87 19c4c6055000b1d4fe6f5735d4c344c2 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 840f7c27d3d7920e11ef771581c42ea1 255944687f37fefd684d3ec9d2fbb0d8 9e6b10b82ff6650b119aebde1eb1e0da -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec 045853f5d4a94bb75d809d8355dab2b6 -54d7a28c58f4312aec39202174880572 +0fcff1379b65914e20e00b24b81a5e6b fb330418c81c08843a8ecc7b41911c3e -bbfe995401a355c459f71be7d355d4af +e6737bc70917737b05e2b3cc3e87cee0 a8853724a7797b14ab7a125c5a64aa3d 30c6a2ac8f5dc2c78135a1d2d958c7d3 -0c8b5fa7e69e59bdf0a4dc3acffced55 +846d37ac463e033347b10ce9c69184e6 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 483de5a7392121b04ca4b28d9629bce0 9aa8f16badc4733edd5b5d1b099e7c21 a1314605a33f143e8730909f6688403c eb84b44b99e2dab255db18f924ed970b -9a2e494b0015d39ff38593c80af1b23f +f59114c9b51282592f8c26e304872d54 f1d4b49dc349f942ecce7845d2bb5562 -bbf6109af99a85f4492dd98a94a6f7b2 -5650c49c3370dd17bca99b655f184c76 +34e7dd73d29e8efc0d0a013026575768 +4d1cb0d2dde73ab7da101afb1eba3f55 d819c152ecb177c120f1e3c9eaabc2c6 cc6c17551a0b45c91fc5fc79f276258e -500aff15daa34730554493980806940b -1510fab77add6d9b505698b3d2f7abb4 -9cf350ea476110799c0f33a2281a19f4 +832cb306580ca6ce4e267ac8892c8732 +9ed685e1553ee8262bb9cf750db98968 +8a4585aaed5ab770db248832f2e1a7b5 802cd3b09bda10a75bbaf7f4597f9364 31e4db724dddc41b42b165ed8c66f3a5 e80b6464c4a540b59ab03e8b66369968 11851279ded53a68d299e1dd00c0b7dd c6aa5d300ad94789a9f2c4cabc6cd8de f5e9da89cf45e535117232b359317405 -19aa2f949963e51bfcbd51f21ad8838f +c07ed48d4b65bab104ce0c4dc1cde684 4b57bd5427c18abceb5c20abd89f5ba9 -5cb1e21306f9b67ae5817cf248ea2b80 -e39bff0a25907b8b65fc68ef96c7e160 +e70293904baa38c90c8be8ca5aa447b0 +06eebf61b89a60cd11340a036f47f3cd 1d7a55d13ebc889af056ef71120d26ec 119d9afb003f18c3adbfa0f2cad74211 b99f23c57218db693329dea5e53bdaca @@ -8252,55 +8260,55 @@ bd3718cc7fbf6dc1b46753b2a07892bf 9d370bdd2d27879fbffdf88d5b937e80 7d428fe710ba23ac644fbeae1e05174e -6201731125e1425b9680ece9fa2f53a7 +06ff7a812c4416c03336b3d0ff683da9 cdfa3838283c176556fd986e1d077a37 -eba82bd2e88b7d544b96c6d99e3a0fb0 +63dc3d49dac194089653e65425d6e5d5 c9310d0a5a4f7e1f6b85201c0dc2fc5e 6e04edde5694fc8e6bbb47aa579d974f -9d3c42abc625b3259d4e5371f06263dd +0ff8f5b9e25ca077b7d7d698b2e76e3e 97157f5de97d427dad060de635f0cbb2 -4d40e9d36ff84f7214a61043608504ce +b1dd4cd2ca514afb48faf71803fb072b 74a51ee9815a4e81828f00e102f2b977 0c1d539dd0e536ab43cab029104330a2 f4edcec9ef405af2798f27a4d7902e12 f70756497c931aadd89edbe485e88fb7 f5e8ae5dcbf8191e1830afe13c85f33d dc628590b54606da6a6d3510ea4c94d1 -86b10d96c3a969dbf3a625859ee245fe +1f81e0757051db526d536d732ef22e3a fb4f2e0c1a0a003c40b83cec58eb358d -2e93d30362c8d78a190c48a84ee14fcc +eba7f7e57d85ab19a005e825dd7779c0 236eb01d61d0a87dc150f17fdd070f65 -52bdee3176be9266973887c2b2862dba +df71b03d06e518df446ee6e9792dcf89 1402d10037a08d56070eee0ebf921e4d f8e9d0e2f7ca86f855a1fe6a39eab4d1 -09f6758e377ebd553ff2a713b1e14f90 +25d873287aec9a21451e9717306db54f 1461952a71c3b0dab73956e09db90725 7a75cd5ac5590263657b0fe81c2e9686 742a6fcd6d5322ea47f1f7c8ecf85bc3 1a7bfdc52688934752339f4d77e7e84e 4bfee5904f91bea7f89e69b65d84edef 41880d289bea521ebd8f24215e6d5f07 -10fe8c6fba8b8a39a3fe4015c16a2fc1 +577c8ffc2f6319016ce9d416e7929d50 aaaf43f06ec3b56fa2ce44165d8b2227 -ece08cb7ed6810cdb3f0c1c917ec986c -7942ec5d8cbd1ded094458fae7db8f64 +e775cffe814bc94a4328cd886366ffe2 +87c46b335353a6fc640ae4c902b7f278 7f1cf10b121b601826c8160b97d9201a 18c683d449cb983a0199f72f41bfa394 -eb93565549b324f373ccb8ae14a9e82c -f567192aeedd26a512a273c46a1b2e01 -4620d5383d98264739be856cdfad21fe +511bf9b42503b99cc5df0cb7b229a287 +610f3c4ba9b4ef8d830a46b8a1f93853 +1d62bb5c969457e698342f5f8c22d153 526eded1162a09941869ab46ef83ef71 bf1409395306f2b2924a67beac05dd56 7ec990a748195e943c1d78619a7be987 ecb08089d6cffff8cce5bc9928dbfda5 e0a2135bf8ba78d71c0162491021d9bb ae2a39ed84e9a8b31e97d34efd50bf79 -6e5d7e32d2d4c4c9bb5b54e9b974c2fa +46a53285a864300207f4759f5a35b928 95562f393025b7c7156e666cb8b45bc6 -7da38e511cb16a90594a443f9575c810 -67a5de359f633e9e24a8ef12bd1fc575 +f722bd816e9904cf0c1a20c807b43493 +81e4b3dc3d76e5272b16447d10ae43a8 2ba914ba1f287a51e96117c8734d0370 98035fec612b1dea0f11fa299377d2bd cc44d8f6611ef62af800332274ddf91d @@ -8311,59 +8319,59 @@ 1bb02f5007b998c89755a783129afce8 d7db058dfc7cd6d999d30e337b78fb5c df5f2db52f342e27dde87f01bcbd8e7e -cb066077c3f9a76a2d5bca265971d2dd +df44b34058c4cbb5c49a9493dd42014c 98e1082970a865bf1264472c0367b2ea 83d58d7245d7473a79ece8004d881b7c -11daeb226361692832cbfc06ea1f4c52 +617b7a71655bef18290227c4bf1bcf31 c4000c3a5f961950001bdbf0eada3ea1 7d36ebf391461a17289c2b5be7cf3e85 -3334f3288a65d910ed596c68a2043d00 +1d2b135a0149df6a6cb2e76713216b4b dc5d5cdb1ddb2cabc4a153dc8153de91 -f3146c00e2d0b6667d17c5eebc31360f +6202f865512c891966572c07fed1bb3b f42193f1b045aa8b255d4c544bbfbffb 577770bc1b047e531d1c8915b91c1b3a f2a97948d26385dbf048ef0cf2c525d7 b46d5511e9d6998ff9c889cb8c0da1e8 0206639eae0df85877c2e2bcf3a6f449 5e31f5e7cbecac3ea5023184356defd2 -a4f7de71fffb7fe66bbe1ead04e43890 +d71799a2249c450279ae7a1ac3d0f805 f8a9ee9349754eca7dd8fa4a3b30923c 208960ca78917b6337d736cd20344a7f -590a8bd1778eddcb5c069279b124e929 +132a5130a93dc5d9c2427643a6a77f9f e7c013349082da3d9d5648c430c5fa17 -703ed24e2722902f0bce8d3a3f7a59dd +378829f3a958e6a275729ee6bfe3884e 403bc95d966adfd004f72ad0b8d859ad 426904859bbfa17b03832bb45bb04199 -1625f57e5654ad47f05fd7eccd6fb90b +f366f1450962fc633c712a57bcffe300 c5c8e08bddcd4b099e4421c7b876d3ca 2bad6855dcaaf4b18c3c92f32d94893f 81bfbfd57357a74c3f3af6987afe6f12 6df89d2d8ac7b9a5f06251fa71023e8e d2eecb1e8e4fb988dda81bbeb97746c2 6986b606c49e4c713e68f9e22eea0545 -7d3d3e6035c01723f19d42755a382e96 +c92a97950deec22447c477d27006cb2f 0cd221c2bb64eec3f3b8ba5efd62ea57 -dba59ec36d373ca112d6392ad83b0006 -dd488606462dc194ebe947c4dcc2dade +bc2b11200433ed6ba13c2b7b6adae99d +95b9193442f1d15db4c8183833ca0b14 e9ad12e8ccc33746292e9e23f1b8f140 cba7b7e8e5181e09cfcc945401729cb6 -2ba0518b06449c1440e2b4e99f206b4a -4887a6d3247ae186478768439e194ef4 -bd2a0c503f02d6245394150b274f4d3e +d0c65ac03d5b84bf70da4651a599d923 +a89a9c412846d94b22ded4a4b1214e1a +84ce4e1c0ec963dde4e4763f0a1aac85 5b5244f55e8874f9677d30a8decd9347 2a5e5c20e225efad5f6b841ad0847617 260a28780209a054543aeee4e3431afd ca1db9bd5d22039d6b84051acb6a1d96 02117a18e23e6d3fa6af33209fb0e6b4 491fa67114d3c382ca11c8beda1d2481 -5ed950ce4cceab6d20489e7ac57531bf +b8c1b21a0a71c89c4ad86f0caad6bf5c fda71a80dc11279fb51ad436388c1256 -94faf36ca44e55f0562c06b20b801c9f -425ba45315eed3b973749855951b51d3 +b2e188e8065680615a750004643b9886 +d4f2c2105d4c3202307ff7271e0126c7 f0b4dcb4ff338aae365219b7c90568c9 0495a2ce04fae425dc6a1d880ceb1dbe f7261490003c49efcba34cb82f632fa8 @@ -8374,55 +8382,55 @@ b3b43d5b59898b53c3438acc767d5fb3 8fe26f5460eea59779e88aca24436dbc 6f17157fa2d3d23e0552c7ef33efd818 -214b4bf175d9a576e99aa32a33ab3ae8 +364c9b4bc0b3ffbbed25ffed1975bcad 381fda47b3c28be5e86909a54ecf6f72 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e 9e04b2cd1b93f421705034d5206749d8 2cc2731ed536bf38737bfc2897163b4f -e6bf5a738bcaa7c7bcca6d4aa9dedb97 +e9d9615574990c4896b9dfe4feab490a 5d9b7ccd6766e9e943b206c4e288cea8 -03ef6810bffa7841d4a99f232564f8b1 +7402b6940e9c0b9451d1961728a1377d 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -544d1e567d9c598375d0b2d08cf632a1 +3aff154bc0917d13e720e626aef6d884 d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b a4689ed797b5bb6aa0712da0992c463e 87204bb4bc4b2de9530578fce343498a -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f d91a412e4582686aee55e22120f10420 -a63bd5dd26ac98782168488c85a94aa0 +4cb220fe081dc71e7a79155fb4baf1f9 05a11b19b5162789760c9838a936df75 -7b66369f2447bf5361d9460cd162a092 -24076c897f856af4bf47d86d96078688 +53f30292c85bf4e6ec62ba51a1411794 +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff 453b10bf9feae2447a1e1a28d2d6ed05 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 1ca4e724a542dd90368a4612a878aa7a 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 68633b9a396403744b2f3e762bbf5a19 f326d01ea1f9cb89d96aafdbf65dfcf7 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -439b41e3fa181ac18f501a9f331fca6a -de65eb4e97ed530f9a08d0322b8de7cc +3e338d94a6d5b803d52b5c431597e35a +bc244d4f47eb26a3a24f2e61ed6fe324 3e3baa2a47af2ba7525ad71522d6ed85 3122c8015a2583d254fbdead8e4fde52 464e3cd1b9ccd7bb22bfdffb69ecf33b @@ -8433,16 +8441,16 @@ 678a224c72ab87f381b25228890f9eb6 9cc0a9a23709b0640fdc94021a6b953b d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -e422e39f79913300450eb2b1a534c0bf +3ef9403b403f368448802a108a9faa69 c3e50ad0d4c93692a2810e136ada70d7 62922eb1ad1501e02b86da4f0c8f1126 -54dd8fefcc17f9df92c5685090720478 +f9002a564c0dd7ff3ed4f7974a32c568 a395d5fa15b0fd8a40e70a9a71e1df04 -51de93aa4306f467a0089db4d2ffe5e6 +686db095e45737b7253cc56f3ae90a99 e272b24123a940834eb7384c732c3c51 e696620abb33dd46cbcc1d87e8f0abca 7db2f1cdec58e462f71191b33e61c71c @@ -8462,16 +8470,16 @@ 5568084ceebffcae386fc1ec48e7ffa8 01d7079eb9464d34ebc58d2987977733 681bb6760c742ae699ed900dca34241d -28ef3589fb3b052ea0c95358a09f5198 -081ddaf3beab038b809eb6db2957285e -4bef9d9f98b859f810c3c295e4494498 +e91158781f161b3767242ebd45da0518 +fb08e158e49baf04efa53b9e931b2710 +149cd6bc5dea21091638b42ec3340592 eead927af63207df007d30bbefa0bb40 d7ce2327d263736100f77cd6eb4cb24b 75fb4c310c4f0554d3ac9859d0c5b646 3314a3c5291bc6ae803c15e9bbf5198b -7ac550b131a480505f0160feb1984344 -dd92cd5ed8097a6e9c9695e90cc9f360 -22ef825d97a6b50b40818f5ec3d9bd38 +20e258227a894b386eede1b35678519f +fda688eba93b22d6968c70f168bf6726 +27b1a2f505b85bddf00c3be9a1f82edc e32ccf9a79a12abea200e2a94c2a95d3 6f3b6f771da549d8e22263e795ddecaf 824683c2bba8c209bd757096e7b7e21a @@ -8496,51 +8504,51 @@ 924c656e4301df08646901c0ff6971ed -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 4e186ea8084c33de3fec3182f57150ec fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -5539cd1403e4efd60edd5498b95e5144 -58c41f60235ea1a5fb3991bc4fa6a24b +a918453d2232f6042139a51f4be59995 +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 c95d9dd5cdb6d9a6824a6bdbefb48531 @@ -8551,56 +8559,56 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -75f7a995a409dd82cda1129e31244bea +3fc8f6eea78a72252d5beaa95980b119 a8c0d300734b6d141fea36463cafb665 ac0b80589a46c746d461c26c203976ed -035e6eb42c043ba5af6accc410b52b11 +46574f10a368b3bc5dd28bd954e438f0 301653ecefd6bf66f64c9d1295320592 -199a9c93ab681670df77a92e8a152891 +ea428c8c8795d443e495cc24c1d4564e bfefaecf0b2d4c3cbca546a629f13a3d 07bbf1314ee53209e4d8cf452881caca a844ce312e01fb23c7007783d7e8444e 06b09b671e4f3c2c4f6d6543f6d01e36 6860a3f3b0469b68220888089b64141b fd3a3c865fdf8572f4afcb889760a65d -39015974e9a1c6c4589591ae58a154d7 +4095b242985be141d15d3dee76e155b4 817e3122945ecefbc4ce8abe613858b3 e17c63b9d34d92e8079dd835dcfd50e4 -6c361dd356bd383d023ca8031b4ad2f8 -31898c1fe7ada24be26bd7142e373e49 -768b38f2f8ced6fe7878d67e8effb5f3 -27e34fde56947d8ccacb40d95d6d5c74 +a8d8861b0947a0c3b0e4b783a8c91878 +ba4e18112a68a41da78cd63499f03a27 +98ee8520e083cd3278a60b8210d5856c +85c2fec90c3e685ac938f0abedcd5af0 0d0f009398a7487d59b485e07c6fbc73 -e70aa14d470aef28733b11c4aba13fa1 +45c213d6037f4cafb6f20e00e41dde29 e5f10f65ec52fdd1433f2a477b70e5ad a5affc357e84c82d0cb507e7d977faad 6b6af95ceda28abd4dc15b6ca31163d8 856330df4d912ce65a7471b677c00e1b 86c9af02e6afad6b682cab386e7ea8c9 3edb04f22096528f3007755fdb835f19 -7ebb4c84508fc27b412111a824347556 +7bbc958481dc3893f3cf8773d423a431 64944593ac8346ad7b11d39a2271b7a4 -4c9a10303debb2b3c8bc16ac22e3eeb8 -fb9d20ab22467a99935a21ff18a27835 +e9d05511b26b0ef2129febfed311fd82 +28f76487cf245a01c1aef56ed36952b9 0fc0876df57f7f77cc4ea959f60cde11 87d2058dc22f63411ce8ac827f7448c1 -2b788321ab02b92fae511a41d908ee2a -11e3cb037686b2cd0b7df9c481590312 -9ac152e843481d327aec088d002a5cb3 +0a23c46c92cd5ce1e5d14d1024f23c23 +b55b4d1269910ed9d04300d6bd1177d5 +18de668a964f71520a4c13247f012fd6 694ca7bee57efa02867473a6d8a2facd 686ec6633c3b45fa9982eb392deabb4e 71355302efbca5596c245b4f75b1a24a -ea27c50d59f4b4a016cab14c783ebfe3 +40d150eef5fa77907360c362ed0f51a1 49bb3d81ae611eb1f8b7868143b2c6e0 32e21134466b972be3ac1268599f9b5a -a744bce00ed9a1dcb9d55eaff5434e7f +e95c5f8ecb76148b002032075db39a4d dbc7149f4d61e7d862146daa4f28d9c6 -7de1eea10fcca31f68d2925ca4c266c1 -c930ceecc0a71f664c0953bb03824138 +a2f38be9f4d829be2f19131667e6acef +c8b51b30dbf56b8f6db92072e172189c 9cd23f8d97fddad9f3408b5d5152cdcf 578c7ef90ce4f50122f14d6630079c47 db18fa6d13acfd83d28575f83a3f395c @@ -8609,57 +8617,57 @@ f4b0c998c31f5889f65deebd633f7fe4 33f56a87ec96204fe40ffbc69fc9aafe c6f42df909428c4ac4a2a5a0d1020d2a -4aa8fd6ec900cc3a9dea82f633273d67 -9b8daa5ee37a6c06c852d668290f1fcd -a9fd12754a461c731ccaf3bb49125bc7 +fda8fcbfef4dc90fd00742cc546048e5 +14fefc7629e7e8b1aa195c290306cbea +b88bcae402852cf0a1ade81c22d70ddb ccd8e25db8a9a768172fcd2e45b95162 -6cd8fb971c3d34ecb6cda3077c0ec82f +2a83de4de86c7c4cddd5490d96adbe0f 223494e86e72306be4f941b847db565a dfa97a9faf2ba1a451e553c77076d2a3 -aa2358d42179cadddd15d8352db5f65f +e7321cb16b9e21054e745a347a57efc0 5d9b7ccd6766e9e943b206c4e288cea8 -f1da541989d72a37bc503fa1ecde4e6b +a05de2beef80af2512e8f3c61f25dcc9 d4b33c76f50f3d94ad1af21601d68e7e 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 b23a1732f01a5c23da70dc85205c1bea 044e22c98deb3d6da5898931cee7224c c09f84e25a1c8970c5572077805ac0fc -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec e8510da20738abbfa73214de54c93984 -2d785842413a38762fc194334e3633a3 +e572268f81dfafbf40cc085b745e52e6 fb330418c81c08843a8ecc7b41911c3e -ba1e5153fcf6e96df24487f8e7a3ff83 +549b51a8af5c6eabe8b7fdb9f981da00 36fe95f9d0f092d61a637e11e3c32a27 c0c0cda5b564e56624844d49d7592502 -05f1523ccec48c3ce24b630b960b3a42 +a1c9e5d5a5cc8920f578a1817aa181b0 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 e652cc0024d38444e191c28a95943594 17da2830504929531702d918d538bece 3d8ba71a2cf2af3c2a9e9bda1cba64e4 b1d534a15eb4b0b99bda0de853ae40d6 -be2a6591d6bfee711de3d3df5e202388 +81ac81600fa899832975179408bd4ce2 05a11b19b5162789760c9838a936df75 -2fbda69e2a3f012225508714b51c0f89 -24076c897f856af4bf47d86d96078688 +bd3a753cb12c1a7c828fecc73e5b052b +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff 5826378cfccf1f9dc0798b3357870fa9 -fe515bd6d1f29593b84f3d34109f039f -22fe87d6626de9d7ef505f8997309e1a -030dd07e74db277689a78529dc1186eb +e50f64efdbb21cc02ec473069dd5d5c3 +58ce4b88e87e271384435fc25c0f8144 +3450069da49e2b34436578915d3812eb 254a30763f15f9f555e82ccc4accdbac 1ca4e724a542dd90368a4612a878aa7a a5e8c5e7b6e275f6fc080d12bc66afb7 cbd8a157fa609eec0ae1d041083cbd38 262b3b0bc7533232290f81311955da86 f326d01ea1f9cb89d96aafdbf65dfcf7 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 49f5a91ffbc90b04607fbca87a866532 -de489808a43df892e70928d6c8c1af3b -587159bbf4f62528945f90269c3a7f53 +c149e810ccf8f48a95c04a544050cab8 +126ca4a6ad5a178e0a091196ba5b7a37 71976afc3ec5e0f9c2e3711d8261e0b4 5dc4c70ab6811882ea50d20e2c4ea6e5 f9f034777e38a444b4bde55bc7e37b1f @@ -8670,7 +8678,7 @@ 449de434949a3e2b8780a87e7b179d3c 3a1f51816608cc8b2c9ae16fb92b4ec1 16504bda24ef73dfed5a0ca25a2649e0 -57e911f6a4818352cbc9b14842fa6afc +6f3a1ed7c63d57511c1dde760e76e320 efb80873052a0acac270873400da3e43 @@ -8678,51 +8686,51 @@ cf387e494e1e47b7da074828e0994d78 -00d770ac36c1ad6b43a34d0f90f45a11 +79e35bad8654e5df8c4e9546da9fb559 ab07c46fbd99585cf69935bef969c5d5 0dd290bbca23f1341e63156248ae06a8 -5d79a6c5b00b1b46d1f52b4b43a829f6 +25485ee150a22e1a49407c26c037da7e 198b3a29bd95db8f58b32d7db4bff003 -0e42cb9139c1cecb18bf40882da184e2 +38b9cfeddef49251a216d410d7fa855a 58c19042214fce0286d38a8553680674 5f9bc55c61786609f6d57cc987d8f688 f2a97948d26385dbf048ef0cf2c525d7 ab89fbf62d7046c7327249be47ccefeb 4eb5ad81317fab87396acc720d75138d d01407b81e6e2b6828c77cc12e908df7 -e1161971bb06488cabe9066c8e827741 +11d893fe91006d73a3558095fea02ea2 20b3e0e6e75fd590b98bb3cb3773ea01 -e37b2888a049752461749305cba2261f +c10315e367f8b9a00c84683b55e7b18f 34ef2a5c01a6de0d058eb647a73cda4f -66d599a5d64fdd125525f0ba69459838 +9a9b37f72b28548b6785b6b1b9baf57d 7df456c127e3cb8ae8ae1a74f56c9c16 593a0056ee80a54a01c01c0c266034d4 -c0aa0c1b0a8218a9bec70fd09f811600 +b0b74e46aa192d770330430bbcfe1879 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 c055194f1ab2455af2250ede540f75b3 df87ce706058e3da66cfb2d15979958b 8ed0c3b65f002cc1c9ee534820e5f961 40e0c792b4859dc438412503a3cd5a5a -7d8d7ea2cd51941b244855a8c9dcc5fd +c954418bd592b9882830e1befcde1281 2b8391c74ac95a9c89c539f0e332ad49 -b62ebea33a09fdfd3cd7eee4ced9187a -db17b7dddbc7f8f6c0c0906c8b8bc62b +5df5b3e78e06355290ce7d76b900f925 +f4d054deaa28f3e99a6d0914aab68185 311ad06ab23f03ff3440597edf1da3fc 0edeb4fdfd326d018af56a8424a10428 -8fe0462446378e7cfbc4814a66437619 -48a90a6ecd1210a0f60e8efa08299fd7 -120c2c37e7d3db4cd41824139478567e +a2917a00203975ddeba877800e723ea1 +5a28672d7b6bd9aca2b7a79b616369bf +ef1f2c378f4f4b96dbd7a370d52d495c f074e9bd2d03d456bfb5c45d912515f9 15558c69fd903afd9e88439226123622 768f3e2b92cc551d7136bbf830e93951 1085ef3d0869bfe5d3d113ad6d651da1 6312dc067c98595bb72d77dfcc9344b4 95c15ca3dd5f1f6760ef60df52b6dac5 -1538105a599084c46759fc0103f3fc3c +81026f55013298b6e61a890c55ce2fa5 d360b1161b553a45255a5806f55382eb -8b75cf8f0252a48aa1c4d2af802b17f3 -575d2dc8514dac008055d79898b96b7f +4b01e02157fd54947a64cffdba8d2d18 +44648ef9b872cfcba9ce4649b09a274f 2c7e63fd6233af8fabc598cea968cd6b 16e0a85f28a66c9fe5ef46a42e9775cb 536398fa35f4c75fa3c3d65c98c37939 @@ -8733,55 +8741,55 @@ 312c298b22e1902df441bf41c0598c88 bf2fa0709a1afa93c391eef32d37f171 a9761ba2043c4b97757891489f325dd4 -344df4d83ea29eb8f3295b17040f6017 +faf406bb0e3127ee1e9f424a9db81d48 db1b7476ea8ce223faa772b7f66621b8 -a28caa2416a41f9b818505186c025c07 +e29675921ca8b0602917a823d5028e29 afaf8c79e4a90aa57382f99ed2d40f1c 67ea5ed5ea373574dce57608e11f429d -236896e291993cb701f29f4dfc562172 +63fb124d0f5976ec609fece7f3ad23ad cb363e312cfa50f3d9536bdaf33441bf -3ca9d098eb608fa5c3069b11f475d881 +018d30f9195ff56d94346d8d21780af2 e5e7ed101e5fbf690c1f58d77b666720 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 66dbdb37fcb836537092935a31655cdd b1d0a182408ca65a6bba2eccf83f05f0 16737b3e033c599ba1de2b1653ff5591 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec 0ff5cad40b13007a6e4dd81f9bd72dbd -9e50d916c35aa824279f0ca09ad90973 +006597a6e9af4637e424f47a28a7b247 fb330418c81c08843a8ecc7b41911c3e -73e794ac80f6aecd1298a31d38d54de1 +ccc22346e54d37117a732ab094d41986 1116f9450413c4fe11aecad38e8ed25f 7e2ccffaf9bf9dffea7c800c687a3a6c -97338416f7ad4bbdc93a194b4a1ca013 +bf512a71c20efd497ab01bd83f07737f 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 2104a3716b6074c739b153108c99c597 9dde1229f064c66f6497f31dde78906a 6373b95c48af4f71972938535912fc8a 367f6bfe53285d7880def87ab63b790a -756ba0b32450071ed8336d6d31794f2e +31f32d0cb237acccded5584aaa05225a a05af8369cf1eca3ea4b3b0cafa3ffed -1a5e128366cf4e045d2679f34f956be9 -4481308c948517420735347eeb7cfdf6 +020f5f3eae4387d4dc019eccd30a2d1b +85d5865b208ca3ce1c68e597d6834f92 69a140a13b73949262053829615d06ef 02289e9b37a7aecba5c0fa022f167487 -6dc685615964d68b3ccb2f7d08058566 -05d052d88d6627ae08917327de247894 -ff2a1e1463a2e8f10288639a2f0e3175 +fda33aa5946bbd06f06d3889c81f135b +e32a6738b9127c8a9c976478fcda233e +ed2cdba45964552b59ebf9bdb1b566e8 121f5d278e77c82d476ddbcaab81a331 d35a21763c1765d888ce5e9f7192d161 b1ae2db4e6abd7b1b88a48e222cf37a5 a04d9cb8e3a3b5e923c349a2dfed9290 2af14f6c4b858b8816b24c596aaa0888 f326d01ea1f9cb89d96aafdbf65dfcf7 -df7d0a03fd8a798030dc7f885b36844d +0003fa5cfecb0311b7f260d15b8c55a0 f07e3aa557243cfef5ef06bdd8dba07d -062c661a13250ac4e5739505ebdb45b6 -5dc5b1df3c26f08416f27b894b89b548 +b9499528fcf9dc3b194032dabb39dfce +6a44563847fd7fd414a91594576d6ff3 d9f11c2cc6a7b5929a915d7a998e925a ef8d5f107a66b6aacb79a8a4f5d01757 9db68f434b6113836433bb3a671e71d0 @@ -8792,57 +8800,57 @@ 449de434949a3e2b8780a87e7b179d3c 5f0890bbb168309b359831a191a3e8cd ea7921a38541879d8044e9729c9e87d8 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f249c5416780b6370b92514232af8da7 -0a86e4d4cf2f78188088bbcd94636dc5 +27d3cdf8f704d01d0b46f8579d39b967 96d264ca8820d06e79142a24331876a2 236388ae2d5c562bd3b7123817527f73 -7e60ab0c29e2988abb2c38706a25d810 +2a7d1b0f704d29951c30ea866c85c530 0d26a4183a05beee36f73348e05ac1a9 -b72976e76e3b5b1e06e3bdfe32f21bbf +74f2da3d9db3fd92bcf151c99c38c332 7372240ddcfd567371833e17c55cf3bb 5fd0cdbdc0238bc2f9c0fde2e1cec05c 45ffe99a918a7bbc4a6042bd1f7ded89 edcd6f0e266ebd3f8889d44444b1f874 6ffdee3464337d9022910038309669df 2213ae80db2f9c6a475e1209d31ed2f7 -699b645ecaba7ee82e5a2b9c8e04d599 +0ae23305ea3cfd8406dc0c57deece00c 817ce0b47f0dba9656d1ad1583596161 -360250f28958a294923f493023127c1f +39cf133dcfab23f3646c1de536a6c44a 5ed5c5747e7602e1b128fc541e0a2ffb -13885e7bd616e8210d416328c572935c +6d3c96840e498d14d87f582c06075e37 507560124bb9af9903a36e155fba3c96 94bb9cad9889690d55670af89e832ee8 -1bbbd210a5b9232c6e58fee38086c5f8 +5c83c1f4cfc547129cf52ea69fe2a19a 4c7673b351fab33e0a33fa2910faf0d6 c36fa900ef2e082506bccd1fa51eed31 e93c689a6bd1cf8e7670e4aec826d763 d19ff90add77cc081a9daf23f5b604fe 3080ff9fdb247eaf98b234710abdc34b 87a5230bbfe882e0fbafacdd6fdcc67e -e55061d5b57b555a836c9943bf8a0ce7 +9adc818af1aae210b0d7d81c03a676ee 41f6a7ee8a9f798c0af92c1ca1dcf5bd -8b1f59559c969a8b8733993c72569c3f -df8be38ee0615e261ce232877c0a80a1 +1baebe20cdfdc3217fe9a2ca774cadde +57976b7ef9e27bc6d12064dafff2eea1 64d4f3497d67b4e8da246b865501955a b66283810f815e888bc6f5ae1b52a6ac -9ec513148be43126359a4b2929a63e43 -ca0d391cb42af1a44e3583eda0d35444 -b3236f8c827a0eb88cee1c906b5bedea +d35b6c40bdb2346fff2069c5616acd9a +f4f6df6dba47bcf07161c5eab2fda0e4 +c3777bb05106623a66ab54852c8dc6d2 77d571e5b03acdb7a2029a4f9218a323 a40157ef24e9a8c6ddfd3885dc186a96 056998dce70220b02ec8ed7855ac8b8f 50d7642780c847932b5928f5ddc419bd 3533fdfc61408e851bdb68653ea870f0 cf24f0f04a6026a4d06cdaa7617586ac -fa070151663aee0383a3c518d6a628d4 +78ac49e887ee1d6d5dd1840b6a81a3b0 2f46b0cf8ce598febf0c2f66eff0b230 -be743d008c1c7503dc8fe449ef70d31a -63bd42d2a260631f2b4eb7e32bff21bf +b7e633ee1c659326e118ecc31f6dc763 +4168e4479deb6e95d53ffbced50238f3 53794030a3a02da1d3ebd2b15b95af35 -8f8b08ea0127e8dd80c06c9e79896a61 +8c97316eb2f2f1cecc299b68969243fb 6f3ad06950f1c62f4bd86e51a7ddae95 96efcb427a067568896a54d9cba6a836 2d1ed344ed1f795dc8ca3acc51cfeaa8 @@ -8851,64 +8859,59 @@ 4c1471fc81697146f2072c4c55b16a9c 24ec07bccd0232ebebd94716dd6abaf9 7f96e18c0ac56314a33e35de090c5045 -cbc1e4a4d481e1d180266b8a84c3df6d +6eb12d57ce64ecf36d5a78932208d1bb cbfc8102d5d4b206ce17095f41a08013 -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +a287d462bc71f579eea372c586ca1e65 +9f5ba8d00d619d312d40c07f38b35c6e -0b184c77fe31ae048a9527291610ab4c +e0758c864058df5f23cc35ab0df1d31d 055d1c1ecd19be7fe0fc879d5b9e3920 2cc2731ed536bf38737bfc2897163b4f -9bf96050ded29c68658a0bdaf7fdb3e5 +1dc894ddc8e2fa310a70a3bccf815df8 10bfcf3c45c4b93043b846371d2de319 -3d2a1d008de0e21b9505ce8b6342162d +2dbd45b0367937f1ef79d8cd02d8eb4d 4ed0fa2252887fdaad281c4fdd581138 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 5f236327d99c1d860357c98d6123b40c 8105015382c2477cc7e91f83ef6c4e61 5d687f7e28621e97af2a7b1290efc658 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec dc396506b334ea8af343c8c8161be20a -103ccf0be8fe475c66984161813980d7 +0fd2a60ce0edd282a64cae89f30106cc fb330418c81c08843a8ecc7b41911c3e -13420baa6e004ffb9bb8851bdec6573b +7f5889f7023d1c96adf6c6917fa4c7c3 4362e150d6fd5db1d2ec3bf6033cf31a f6a494807c8bd81146bf7308b9e74507 -cdb4a3999101c8a97f346af5b2c871a3 +e8b8a56f3c8046b724afa033496599c6 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f 4377ad93f7965f894e7d49f0972a144f -672666d2be832522a2d1da2808663ecc +b26249640072d8246a812bc6d7a4903e 05a11b19b5162789760c9838a936df75 -7bc61a1f1daf334bc893dd1f0b05ca37 -e4e2a6f4a944f694c2930314578cfc73 +74e5138e0485400d0958b5c137a8634e +c2b2f7000a5d742699adbc6be9b8011a 5f93e31d32cd99d38e3d59c80b4137ff 28e10eab33216fe841a693440d577e21 -b34ee3fcd8a6978cd33ce47539e8e5a1 -22fe87d6626de9d7ef505f8997309e1a -261f809c9e46da5c59f0e5c3d66da997 +3892d45ad15c38243a4c8c570f3db7e0 +58ce4b88e87e271384435fc25c0f8144 +d929cf33013487510df075f5cd5ed46c 8cfda215fb90242c0bee3c08f424d05e 1ca4e724a542dd90368a4612a878aa7a e92ab1ec80639a8bcba78163e7f632aa 125545332e86e9da0c16e857d488f35f 68633b9a396403744b2f3e762bbf5a19 f326d01ea1f9cb89d96aafdbf65dfcf7 -3ef47d126feed7366cb5ca7fcee9fca8 +16e708648f259125b73168462459fdf3 c57c2471c7a6eddd29d27909cc422e41 -19de93c653769b4abc72bec70750ddbf -b35268616dd215650f008578de78244a +1305dad2e2014d290bc66c328ff0a8e1 +2f35f2744e4e6626a2390abb5effedc2 2b7b7694e9c574c9017760d04b71d385 336e659b54ee694568f9e17c14ba4a44 6f225dc643f02ed2509b857ca08a1695 @@ -8919,55 +8922,55 @@ 449de434949a3e2b8780a87e7b179d3c b4a7bf2dc4b9d17e3bf96711789653f1 cd854c5b10b4fbfc95edef5d88b16bf2 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -bc44f9076de8f3941692c1139b6715e7 +6b36869fa70561852f0dd2237168b73b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d addb82a5473d88074f998158dcf6d184 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 6448daf1b06217c7dc989bed6f3709a2 fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -78faa2226aeb9f90e52c0f6239002838 -58c41f60235ea1a5fb3991bc4fa6a24b +34c7fde492170f80fe8e0e6434f3eb0b +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 59b195fcff4d3877045fee21c364d524 @@ -8978,7 +8981,7 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -bec84422f0047d771c9af28213629bc4 +f4977effe39cac6245f3789b7dc2eff8 f1f34d8c0f864daa5e8ab56801027430 @@ -8988,13 +8991,8 @@ b72997707e75dd3fb9bb3344408f0fd8 -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +a287d462bc71f579eea372c586ca1e65 +9f5ba8d00d619d312d40c07f38b35c6e fb46bbe6fd59edc488ae4cf9c9e59be7 @@ -9002,51 +9000,51 @@ 64bfc7f928c8265b954a94f6ba47a472 -686a81c818a0a224bca0aa9518e30f7a +24e25ba55b35cdcc2dc5a14d7d10570a cf956add0c79021627f8d296bd9c0bee 3639365574f377b3d9192eed3012b81b -c1bfeae3937b6f48c77771c5001cf6e9 +e6bdc0042aaecd4af937d23e028fe6d3 297d7b4aaed48a75f49c2a5d7856b4bb -bc9253b980d8b35dd5a701efea21fb9b +7e6f23680749d50953f078c6718e402c 3f97ab7226e1b96805f110c23a0a4e8c 91db205f032419631535b76600d49ef3 3ab8cb2ffce4a45ccc2bd36bf7188ba4 3999a6c16fbac8f142b6ba5c83843135 e66c5201b53aff421ab597e250adc59b a7f8b687d5627915cc22a52b0332af77 -2d07e3dc90596e3bf5815017b9fef1cd +4e8f553ac2056a7b9e7e66f9f8cc3b8f 2c978233c9c2113210abb8d6b7815be6 -9b76759382b2cb4c46403832fd11da8d +bb854c1ff453090ff74b5c40bffed07a 02b66c8cb37d08bd011ec596985e5b07 -d34df2be536aa5f1959c5d23536e72f6 +17b01c65b668f83ee0e343f558f1f717 b5cd71ce52f0ea483266db95c9dc08f0 0c3ea1ed6f3bef86e72457af9d477b22 -805bb38537bb72d4f9b1377e78212aea +c093d74471eff6a5f33e586d3fdf7843 6bd7bd915222c47f064d3cfee5fc59c0 f10cedbccc9475f55d46269a683f0cf4 0a8e6c7063772f6766b3265f9b54bc8a a951ffe3e490fa57e2d8b58326957f4d 8cd714c35a68b56c9190c03579baf70b e2073338990d8009a30b20f79c1e2658 -02f87fd5322e9ca3ab84f2baa2a26d66 +6a1722dc73e6612827ab1dcdd24d0ae0 50360defe4eda5645728358a612f8df7 -16ca8987db92c91d71d494e4b4721d5c -9373f76eb4da633bd14e44f1006dce26 +b959612b1474a1f2fb2aeb746072551f +e700debbe7f28659cd6ba34da1ec09cb 5a6bb3c42b5a0bec8c86824f1975083c 87ca04b6f32ec9c86ff4a9496a7e2e83 -61056a28a359783cd881f127512996af -8518f9148a890e14466038f254c2f701 -7bab9e644fdcca3dd68f097c80e8f263 +0563e414f40984e0f2ad2a584b88bef4 +443c0149b9f505cadf88de780d7c5462 +69a9ea27bd1ff96e536096fbba4d3033 1eebc6a132b4831df2374914d2398d06 abeec7cab968b8b816c16b0dea5dd6df 988b1fd1092a601c62d214658970a600 07bb126b5d3a17c508adf9c9201baedc d9f0c52c0880cd2a167ea745276e7d34 f89420ea2cea158b44d851d13331691b -e4a6501096ba4fc1f0f379f30594ac34 +71dcffbcc86f23f9cf452fba195be1d8 6699eb3eef6a6a05645ff11dd7646491 -a4feafb6c78b04c19f3425ded8f01ec6 -d141d44dd458f40ccb09a857d53e1111 +028f2dff098e653e92a92e51a4d56f99 +89bafed728ed1123e0a9884966bd38df 354a01f32d385c5166d852822ad9d471 02e5e0d91e8cc1b008004845a60230d7 b86122de22bca131f7b1e591d0ad05d9 @@ -9057,55 +9055,55 @@ 198738d85a77c59567f81577a6235b7a 476d5ab66502092cc71290f7b3a635a0 d87251d2fa6e1c8d95ef7c0a2e21f6ff -eae486731cb10ec858687482099b54f3 +07b06e9223c78d3d8156d51254b0fdd0 fb318dd514da9a7e91e4835a22a8b317 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 4e186ea8084c33de3fec3182f57150ec fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -53bf12dc00002400cee9505c3c4a2738 -58c41f60235ea1a5fb3991bc4fa6a24b +74617c4c134f60f3087c0b1f0451b538 +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 c95d9dd5cdb6d9a6824a6bdbefb48531 @@ -9116,73 +9114,71 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -c294d42b0c532a0d0ed0ecd75b2da20f -02b4f98405e26fe54399ae5cf3d8e884 -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -14b937be198fc9c37d706a131f110c68 -4dc7f339b479b935f54185ca937b5200 +503179eef2a75e444e6ed540ab5816af +3a63b5ca883378d2e5b3ffc0bd8367ba +cf2e582534edc6a59ece7d22c939c00c +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +378e17fcf077672377ccbeef64dad311 +b2a770a6440bfa70194e2bed28f4d39e +7d6b8f45303f24ad769fb402b9416bb5 +db59948d8443a30f976ef562646c108e -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 +a287d462bc71f579eea372c586ca1e65 86edd8b14802f697dde804a0b134a9f9 -14b937be198fc9c37d706a131f110c68 -392ef1b0569abd200f863d93d88ad77e +47e41f42a075152d70958fe89cbf8d37 -37ed2423117fa214345519409b790293 +8c5cd3077f35b4d9a54fa1e2eaf99029 37d8e465a4c969aeb37a190555547cd0 f42d1bee9041dfc962483f895dc51516 -37693934d0491da5e6e72a865fee2435 +e9df7e30e9fdbb6344a469b3ba149587 3a4b04e37555e1b591460bef9515a31d -6f3e35798a1962ec9a056cac680877c2 +6ce380aa4925459fd2018f1b969afac4 e75dd31e0976099cfc0d9e00f9381947 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 03979b34915083ba410a0007c328ad2f 7ef7a01bb8bfaa1bcf2a56e60d5dd02a 35d341887139a758d99d30648927ee09 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec f15b010a942b145c786fa8acad689cb7 -aec6ae4bd3c5941c6e2c8a50f252e12e +25c26fad23173a7dbdec5924b8b1b004 fb330418c81c08843a8ecc7b41911c3e -4201d532b15c490bb6ea56b3d7d4032b +751c73c02279b8c3741aa37bec82ba2c c247f188b836bd51267c422c407ae500 9f8037a9a12a3775f77152459d1d56eb -99e612e491a6475aa946bd01df897e25 +05728779c925f68cf37badeb98b828a8 1898ba53941f49ece5a58b90fdac3ebd 0d9854420987f4e57f2b1f9d3c4aa726 109473a1938eb45b52bd3826fb672d9d f1a79c9a55705140a6d893b3690085d0 8533867c20217e5aeae7d0dac180cd11 580097c19dd53748b11f75fd6daa95d5 -6e5a54042600e4afb79f09f52f3d8bea +0f68c23818e6bc4499f54ac914e4282f 7a64d641a544fce0c38f713f0664d193 -edebaaf030b310580975751b4b7007e4 -1700083ef9212badec296d94e212cd0c +f511f6074269da3134eed7e12c84de03 +798688bb6771a235f9f222336ce5f4ba 2c27edeee3a6e7883ed719fe44d6d145 a47439737e5532545747c6f73d6b90cd -43db758beb5f856b7e9b6baea10c3a50 -39ae77d3255b573476dbf4bac144c91f -32cdae7ed3b21f35edbddf5810f28711 +b83baa83e617bf718a588fb2e026aa49 +40304c1f3cff2f503ecd99a6ac503613 +af7f6ae4b129a71eab154f67ec4f9d59 9d81ac794e19939a076c93c618837b30 791d08fbdcfe6f2029c0c400d4f3778f af08cb31c426c69cee3d5be5dc8702c9 5545078e333f5fa834e187b6d571738a 1364b5c7f6f46e8a9d5fe21a4aa0b8fe f326d01ea1f9cb89d96aafdbf65dfcf7 -acc68e425ce7d196d394a296bd193161 +a6798cd4ef3ea5a0028b7e33867373d0 095b99ae7775132e9700de77b2e6f898 -b67199996d1f95a5961244f2e9b1431b -4e8c1a65dd260044e60bd594dc9f165a +27f2d10ac233068065707bb949750e31 +f56bdc64d89a098500278cca09fa304d a2ae9917403521ede786d9e643a53439 abfff4dbeb6fb2a25396303105f5642a ecc8a0bde690b00e0836ea7764a2fb4c @@ -9193,55 +9189,55 @@ 7f54f89d0966306d4f60a669e23b402a 07edba7de542d83b61a622e33d5a25f6 57c2154f2836596753680dff1c63f6e7 -54c89c67f919574d509c1566c6dfafee +977750e7a21659d6215e7f843e69c058 7e2d917c34973b82cd21c55635057d46 -e11c5151b866a5ca2c5d6e81286f4bd4 +bc93932dfa364d57694b5107bd221965 15df5a3b4ebb165f9986273c4ebe8798 d91271f2eee42c07a5138547a0f6c091 -e0455d672a8e4a9c3bc177b39e54749e +534aad3e7ff4b4e2fd40ad24338e359e cc477bf80635d2022a70f38dcac5b6e1 -03673f79cf22ee1bee5a588a8a27bfcc +91a570ab57e4e0ac714cf48c40e8e323 e2f570e2e66df747bf8f6b3db227bdeb 642b1d3edd6abf2fdfaf30d3995d3f4d a313c383e151fb72d0eaad1757188000 7d8c8e9bc16ad8accad451a2a6c5a046 716fac49d69b624c15ac9c91f370187c 32ae8012fb080e21bffa6e556916d602 -a12cd5e8e20bf30fa844fbd106e7b0ca +c2211488a1337a74d003a9ddb3873a31 270b61424746a236c6ada6678eb0a344 -408470b9760ecb31693e3e124ba21abf +ddb2d71f37194b210d54203f580211e6 5460d3ff345466ce89636dbeae2a34fd -18f002c50ea1cbcf33facb7660991897 +dcda5413c3dc3ef55f5b843256bdaaa2 fdfc437c24ae7b6ca2b931569363aa35 ebf4f23c07bb09dca7337a86991819fe -1b632400c042bfe9be49ebb25d1fbc8e +d005f2b3d8abdd71761243ac5bce19cb 1856c76dda9f60666256d04b1f964000 fffe909199241a85bd97495f34b80378 e8af2be464edfcb655c37b7915b678ef b86448d50cb02dcfafee6f9723c1dcc3 3ab7d54a87b3c68cb046ebb54eefd70c a63ab8aee2fbc9a1107042a070b1716a -68c3c0c712e5c1d21d46285dca52d5f0 +5d9c6213e92a9c18858795ff00848db6 2a5b90cb833fa873670d7322eb4eabef -2d807ca607e492b30eafb3d8914b95cf -79326023ad040ebb246828a681033b2b +152fb2933996d8803475656021ee1adb +d1312f31922c4819a5582de37d0e05a9 817b0ca846a290585a5395b65a65d68f 24216c82e991c6828e21333d95b808cf -95e57c35a792c252a2e8b35861c61dd5 -d5d9a12fb58fd9eb1b81b9bb6933f8de -35d645f11e3ddd313256b498d69501dc +7b522a98d7a900c03121f5c35d905d84 +f5e34703342979377ef0c6e0d12d5299 +236e91cfdc41d006da0b3f67e78ac64b 2b48e1bf7846022de872d815250a7b05 79da3afa1b6e18f33269de3e58e20500 3199b9e77ad97d719d306bfd9fe1f5bc 94ba7022b5a214208b24339a91e8b417 75025c0ce9c0230f5b2a777164d34624 78baf615e8d1c00a89cc8eda5229f342 -e8a0e5d9c0b2cacd8163d4342ade690e +e1055159f7b283cb7468daf14a8684a1 c6fa5046b17fc49c8763a64a2190559e -18edf0bd49b184615ba8344dfa9f5666 -2d5be814bbfcd9268d903ddb7a98f289 +fc98a808ed9dd80c9d4c5091473b8a9d +d26a73cb7efe81080f769a3ef26e0f14 70a872670c64c2f1bfba189669cf2899 441e0f2ccdbec200a6056f9fdc0c3c97 73eee42ab2bef0da14d9c3fa7e1f1e3e @@ -9252,67 +9248,62 @@ e644544bcf0068e86a44d37c204ec963 4ab7bcf0d217d86468075ece0c83929d 850f81668e8529bc785988b981aeb25a -cb9edacac9feda06dc8441fd267fe15b +dca08dfec11f90b90a5ffe1e4344e5ca 86d18225c3ec4d2ab47d5b96594e1d74 -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 +a287d462bc71f579eea372c586ca1e65 4a73b1420652c433015ba38d07a82126 -14b937be198fc9c37d706a131f110c68 -09cd93b89ceaf280cdf4e3ed95113d5e +7e05aa55be140022b44bb77adef4c3d1 9d0003b476b04cb18293d40e8e5f9e4b efdb5a6169890e8d2250eac7fffe7942 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -2bea354421fe050e91df715efbbf39b6 +9cd49e7f744d8de62eba542e0195fdeb 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 6448daf1b06217c7dc989bed6f3709a2 fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -78faa2226aeb9f90e52c0f6239002838 -58c41f60235ea1a5fb3991bc4fa6a24b +34c7fde492170f80fe8e0e6434f3eb0b +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 59b195fcff4d3877045fee21c364d524 @@ -9323,14 +9314,14 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 3c1901d15b11b7c8d9411305c2c10e47 -f0b73e105427c026e55c1eb06adccac1 +43f67ab455d8d7d37792adf1b07c5d9a 0f4cabd5c702824c0432a5b16dedf3ef -f22819b1a3eb265c2e589bcc71fc7562 +79d85b51749f47c08f869e8d88792b96 e5be41a111cad12948b3c30fcd5a41c3 f8c35e3878a1834751fd9ceaf8e6bb7d ed92d742de3415fde0de3efc2b84e990 @@ -9340,7 +9331,6 @@ 616c29b85368aae480120bb30455f2e8 d87b686508e12bb408c58888689211a2 5e5684f776f1a7354578715682f38651 -2ec28d7d8a03797203f724f8e5cdd8d3 fedf292cca2809a18d78f474c1334447 b1d9c0b57b93cd0b5584fab53a6c227d dcd4b0caa14caf886102e9aca04e8b7b @@ -9349,14 +9339,14 @@ 48774123b922c982e9db9735f78cb033 f47f15a53c307b7b6b14ce44989bc3e6 7e99379d64b67784419dbe4472109e8a -b5b11dfd8d85a817097aff93636326ec +f02aa204b8f08a2b24b5259e84d3ab65 5707af36b38fd6a63cc64e6852320ac9 d2a16e475bb3d3501ca097eccf16f3f5 4a208b83b250a5fa06add548e5f4675f 82a6941cc4dc14b88f1053af0b499e4e 59addea31dca998c1b712c1ed87d3f9d ba8ea3ba48fae1c8c7bf1e4a44d31dd1 -9747da73ccbc43226cc6b5a74ffc4fa6 +380507f4784c904ee80136f10dc4c93a 85086256e7de8ee29545bcd5c1063a55 5695f95ab75430e71ca7e91b1d4a7993 5df22313fdd1f6434b42a5a11f635460 @@ -9367,51 +9357,51 @@ e5dabc12813a485062ab5b77b5426679 -1a8ce93f9288fa37df53a35e1dfdde6f +8f2df396846f56c36b7f5981c55b09af 632d62425fd80b2ae185fb09da005b35 41a82da1a38fdb0731f1af8f23e1b884 -eeb5081b297e0efea247ed89213a05a3 +42bdbc393938fe75a1d853bf20f51164 e349f1a124686686a7e6e55d5e728e66 -7d7947925a62a4dc3de04918b3876448 +7c87dfe04f9013e7205e49361b771a8c 36526b8dab4e59d4f4ad236d6c90907e 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 a46e84e226776d1c036b5c45cf3bebc9 f760a8a4dbcb446b2b9d4a57519b97a3 8586f1e6313f1760b3c4b35d5446662e -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec 5b34db46dd8cb293738572404ed3b225 -971521a0a3a41ce840a88a0179d49f98 +bf649dc0dc28169978f52fadfd74c2ed fb330418c81c08843a8ecc7b41911c3e -f8462bfe02b86e870ea7183dcf53b2d7 +338c2613ad6cc390448329775b4d2468 f0777bfe665957f9c9cebb90f151c62b 49070aa4eba7e3e1b439d12caaee9952 -2559959902d060ca1ceb8d7a29871043 +d11f46d9d4869fd71bcb552f8d51522f 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 d1d57eea51657033e41f1634e96c2560 53ef803ac43a6382f578eb37280e612c 83fef6c66e36ad20cb4fe764f9f68e06 a4171eccf1d40752d26b29b5153b11b2 -a0ee6c43a52bc1229636b74109771bbc +0c962e7cdb40d7dad2a747913d2fa93c a80d982a5473732ba1961c022070788f -effb241913bf2477516477291789d0d7 -c40e12c3e7e5a1367f1c6217c38f1cf4 +87397eaf064ce70b2c5ee2f26a101eb9 +054e37b9444d3500de55fb2873fd01ef a0057248da365d8652f6b193da290302 c12cf1d469986ba2dc003196939d366d -efb32b89df497db2be8b2b094f5184b3 -9529ef58f9d820b6b140fb0f6367a299 -83c894aea542188b6d72b6907849f786 +a0b716a86724f2cde471e7dc5a99bc5b +55ec9a397c40c4bc20ab7a911bb56d65 +decda49a23434f20a901c6c9582898e5 af5b7c3ff0f794fcf79548c1ec0cad94 cd19eae6497fdab036c304d1de48166f 6a99d337f18961deee4388eb086941c2 09294bbf65aa3b16330b0b16119474d5 306523293000765d47944a1d49176227 f326d01ea1f9cb89d96aafdbf65dfcf7 -1dbcc3e832e6dae45827b9b01e372d51 +aecc83c5c5055247d60a4ad36fe5d27b 0266e81927355c5ace41047baab6f273 -f35cbdfdf620bc6e752ff70881a0744b -3c9dac5d6e08ee323eb0713413aa7d23 +00a227b4e7ea9b1ea5ebae93307cadf2 +92fb47ee68846daa048091fde37e7fce dd0c0d28fc4a2ed9db92b4ba84a9a561 62412b0b947b92addce88be9b0d465c1 e3a663c28cda435414f95b1683b36d3e @@ -9422,55 +9412,55 @@ 449de434949a3e2b8780a87e7b179d3c a0c8b26b80f18f02804d0e01e64c031a 436361c24dbbb8a017932053886910ed -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc 96c57fcb231c8ac82ea65c0892a50555 -0d577e482960cb5459adb57b4aa803af +41d78d8a65914f0ef18af000e6a63052 150ef0a3188079477ca03d406201c48b 046d11412aa0f261834b9ae1e91bac48 -b15b7bf3ac07e453058851977d51e213 +a4fc1d9078c00df5c8ca169878cb4dbd 868f7d6e16df1caad6ea1baff31016cb -bc3e3b3476143094419b5db2e88c175d +28cced83490f2d718f9c1e2c61606266 3cb79c768f575725f294e75ef620f846 a4c048ac4494e32101da4774e4d56102 f2a97948d26385dbf048ef0cf2c525d7 4fabc8a6936621fc03a2dd32a9ba7531 5f8b1d14fad5cda81df0c2d95fb0b9a6 302723b8a8150728e2868ef843784434 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec ae976b8b3ceff8461a54f6440a533b23 -696d5223809ae9ef74d5340d97712366 +f62445c9c54f7bc3a3790331bc282c32 fb330418c81c08843a8ecc7b41911c3e -90ba34f01cf900c232a804be94755cbf +d2fdef24cece2f67b802f0ff0a9246d0 a1e2fe9ace3039db5aedeb81476f34fd 54ee3269dc7dc1a5ad6b8e105b6d1c4a -8b23297081ff7cd9dfc4aa728c9baf0e +2b456e7e028515f07a6887c35bf6ff11 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 0377bbaabc9f554edfd5252b8280b6ef fd4e96a1dfb6310eaf9ca8e3d5d1c03b d4a4ee924ffb170772d19d8fb868d8b5 6189a60e665e8910cf6e08c7b8cb34e4 -7d4c9b0fdc8ca72ffdd4ac204add47fc +521554f32c542b54887e7b042fdce454 9b01fee9c9212da2f9f5d7388424cc9d -369a11697afc5fc08c9d9a119312befc -5cb30f4a7b7794b22249cc63086ce1b8 +6689a5cb779685d445bbedb7079f68f4 +e3b584458fa916fc13d478c9d06d66b0 5f249fd236d741add5cd1989e73a179e ba76df4a1a0806f87e68830f08b4c334 -4486ffd5730ec74acb7f165d032a354d -2cd212404efd4df30ef931e3c7eb334f -3342d6e329506071cce933f693a7c26b +74d91a7555f00214e4fc66025c26e7c6 +c99f08ea02baca67b2f7d3b53d831686 +025679c597154f7ba721c6a2bdc0a376 3db9a24b9c05a584f57e76bf796775e8 30af1f1daa6808bc69afab5eef6d8777 05295a96fc118adfbe34fed9ab5695cb 0eb4171c9641b54f4b0e99d38ed774d1 e2590b64c46acd99b18bf01068bda97f f326d01ea1f9cb89d96aafdbf65dfcf7 -89b689d8bfdef01c695a75602168e86c +be1e2d4df3f16e6e724b6e8322e2e34e b62965af8cd454ed73aa42db77882ce8 -e34f203f621a58e6a025f8d5776c747c -b79ef3622f679533a44325aebaf50f74 +6d806208ab89956ede6d771dd22caf33 +18f85545aab45cfaaf39f9beb9170e19 f11caf85f97048d91c71324fa554e8cf d7076d1ba0b16124aa157994fdb7ec3e c16ead4fa40f9b157f7c4f0ec8afefd5 @@ -9481,64 +9471,75 @@ 449de434949a3e2b8780a87e7b179d3c 8bd26ffb64c2d28d90aefe0d30932b98 c91758455ce161836aafe2a059dd9009 -7bfa336838a135bab143a6b5b0758af1 +32b016e33ecde84463dde239f1b9edb8 ef990f1dec41193b1367ff9ff985ca67 -c294d42b0c532a0d0ed0ecd75b2da20f -1db1d7ff0f6ef232f1aaac2c2cb56b43 -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 -14b937be198fc9c37d706a131f110c68 -65d76d4a51649d67a90d5c49c8ca7430 +0b12f786acead1817589d807f26db930 +a287d462bc71f579eea372c586ca1e65 +93fc25faef2e4a631602c033427fd12b + + +02f561f8057e8cadb399c18635e6d799 +d635affc1ece9aea78418df8eeaa6315 +a74186274ce78332973e48f79e3c21a2 +22a4f8ef288cc8029481984e6ea2ac8b +090e9b99362f9653758ae819aff75512 +5410dd2cdb6ca3af79ee9d2dfbe90ead +418697d8893dc092be6f18415df3efbd +a1d25b7f08b331845b86c40c2ce5074f +9eb5f6e1266870f5c28554b6722a995e +7b57014d652d44232899ffaf1894e8ac +dad6705b5a32e68b107566565d958801 +772d360cc224f9125941df93cb5c39c5 +1a11cd258abcd332148d1c2c08dcac6d -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e 9e04b2cd1b93f421705034d5206749d8 2cc2731ed536bf38737bfc2897163b4f -27534eb72e590038e0fa11d8df5a15d6 +05639cd1f431af20d67cbb44362109f5 5d9b7ccd6766e9e943b206c4e288cea8 -4c2cde2a7b3cabf2a3056b98f5e0ab9d +6c2a478ad90eccc4dc58825b3955f8ea 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -3d553783df165b8fbf3ebee134c980dd +3205d55a96cffd3b1b029104458ccbfe d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b e108d4f278f102da00319763761567e8 87204bb4bc4b2de9530578fce343498a -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f d91a412e4582686aee55e22120f10420 -282e62eaceade858ea0158c0f8bca19e +78851b6f8f660d86b00238d80980f375 05a11b19b5162789760c9838a936df75 -7bc61a1f1daf334bc893dd1f0b05ca37 -11f3242d58ace647e398a9844855545b +74e5138e0485400d0958b5c137a8634e +17c25bcc2889cff3d487e3053feabbc9 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 485f95503bd19520f6ca020ae9f337db 1ca4e724a542dd90368a4612a878aa7a 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 68633b9a396403744b2f3e762bbf5a19 f326d01ea1f9cb89d96aafdbf65dfcf7 -e5358509c768563b7eb5ed56913086dc +161157a60b6d31aa2eb6787c8e5b6001 c57c2471c7a6eddd29d27909cc422e41 -5ba7ac8405f49bca38bb086f6cffa95c -056cb81138164d85bb0d50ab0d312e86 +4364c1e5068618c97951cfab09ca12cc +cfd54dec6e531d2713c649687eb771cf 8cc192424d2a8a3a8439cf6c9e9c866d 3122c8015a2583d254fbdead8e4fde52 6f225dc643f02ed2509b857ca08a1695 @@ -9549,67 +9550,67 @@ fb4a6f0b8120de5bf4484b514147bf27 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -52caff2f9a03cfbc8f6104bf2403ec25 +06712412e2918006f5ffb08e351cf4bc f1f34d8c0f864daa5e8ab56801027430 -c294d42b0c532a0d0ed0ecd75b2da20f -523ab8741e3df41c6147df2003e726a8 -21f130550e39e481ce9cb357516e6ab1 +11548ca929c3b33650644377a193fafa +d78f2f3c7cea8650f256384b115de5bd 3332e7e07f91da6313b26cb61dbca6ee -5b5402436d2e5525c68fe96889c8628b 2cd37a211a31a13ce61875112cd9b50b -14b937be198fc9c37d706a131f110c68 -34e9924a5543f5c9f8d42f68852aa1ce +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +6f99a2ec953cb62fbd44e00f8d7f1573 +7d6b8f45303f24ad769fb402b9416bb5 68459fc84ea935a6d7c3c01688685585 -73e9edb0163694ae2e0a80744ec41138 +78ac41701d68b2929c5083654857ae83 -0ffa472d5ef751a84b9c10bd5e7b5700 +b96ab3897fa257c512682880b7b78918 8a54b70546ddfb4c37311eed7fe97f37 5d4bc708b7463a1439b6e450ecfe14a4 -50cb15cb36ba9f2ed19f40adf6a47429 +8dc2592780c57ff8e1844b9685952aad 10f30659042ecce2c07c210ac2194652 -6824d83658f42d96b9069b6fc83a0798 +1e3c22aa2adfc5c06708acf0e4b7d3f0 14a61298c64c7c9be5640d0c4e4fb421 110e015c9a8e5ca0f74c16973fcfd6e6 fdec511a494d5027c2acfc28a9699401 b724824ea94f4d3ab2ef94500dcfb952 d2f5adfad0a886c9fd4f01bcd8e2b407 4e5fa484c5e828a1850cdcc41c2e21ad -299d941a9f02e17c8b02434fa9e8030f +e780b269169220334ce8a881ed8df86e 8645e85dff01d97ec7a5592842fe8e9a -43676fefb1fdfc39d88827b4ba9392f6 +785ac550d923a2372210f8ec6fdde91a be34fcb006606de6d45c9017d0e6c0d0 -46d424d421b1da5570db5547a77ad14e +6009271825117e12a5a0c602659cf797 94d8e090abeb11d9024dcc7e3eb86871 e131a7ffecf41104dee00ebbce281fab -13e6a2ce352dccc6172c60efe0bd80f3 +b52b425ac660948cac6079e24ad6fdab d5878227c86ff4802e669af1c7596a5f a1b4f1a132ee1c2910d45a3ddf0b116d 46696aca52e1960099b43cd82dbbc95d 3004b16ebee23d327f659b2a7473435a 184f8b89087e7c5bf304a8fb05056c81 907459d92ccbbbeb7cedf07b093bab8d -900d9aa8de0eeab5acfd4db34d3ce735 +283d11015b1e9abf93cf98db0ac9973a 88b274f352239ce9434388ff31bcf56e -ecc6587f01a3e2b2fbb938a01ed61ff6 -f9e5e501d5824bdb2edd34487ef753e4 +abee0268a8e107361ff47312a5e87a6d +ce77e314a51b996a81e15c9446978458 953b6481373f49567196fa44c135b46e c628021e320e7a63491f3bface328003 -67709582399a59b174d58d7de1362fb7 -8023455375808279a7d309c595cf9aeb -48a16119e02b8de2108e34c83b18b326 +5c2e760538e1597f18d4c7743b92dd27 +fe1811d2f86bbbc548324f42cc4ed4aa +7558a825e0490735e28cab2de8014817 3678347d4536b92af9d398a603ec0aa9 ac2e49c27102ae56b3deed5e8d7c4175 44f79429dad38940b566f2f1537df733 47ec124cb943c866b2782fc3b47ef4a6 3a4777f67a135a1cfdf7a47069d350f0 1b7f4ed47e2733ed7daf1f068dc5a43a -833cb774486fc673341c35eece6a9327 +a15804da968df59a893dc273d4ab4c7e dc01728427612699c305b8f285cd1262 -4f85a3bc141a740f1d3931a7581d5048 -79cb9d37e25d660b3dc8c5de296332c7 +811b43fb9701e272813f4ce0f8dcdec2 +19fc6c7a0821552c6a710175261e8d91 87286fa247ed09647335fabb2a9ea2c8 0b44cc53b25de22d65ec652eb81f2709 f941b0dd2760b7fbc53b3ad0e10e50d7 @@ -9620,55 +9621,55 @@ b75222a8f89443a5fdd5270fd5cb15bf 8ccf673ff2d8d21f4d4b27fe023b422a 1560ee8237facda4df210cb12b9153e7 -e7f8a431579831db43cf42cb3ecc7ba5 +e7f841597d7e6fc358643b5bab47094c 6ad1e01b6d442e0d1300992628e095fa -37a644fdadbc320cd7badcb3f2160581 +8204668d38a45472f4e6d12de692f2c0 40da036c3ed6060360c70640de106608 e79dbc779c33fba7f5c1a7a2f7b57bf8 -af1916d0892dc13be2174e6d2a6acb59 +9d450f24216624c693008f7e5f16e7b8 9c9c90168c862a478d6fea10cadbf68f -f03e1ce24e60569fd52286622d5e9898 +a471db266232d971a875494230cc7c48 52427798b2a5dcb70d70d56d3e192716 1d053fd20fee7157bb530d6ed8656535 0b5a5f0f19db04cf9782504c32fde043 bbd2e9eb5a38d949037f38c2b160f5e3 ecfd8bb10368f489e38e4a6d70cf19f4 14486d10d969cfb5063318a4d1fdf997 -60777f0319f1b3dae65db8ae22ac8b83 +bfdf26f7b6a89a2378f0c86830195f57 be16e99465614871bf39a938b331739b -33c88a07438fee635a31e31f1b82b1ca +48f087a382b785b2b48900bf02fda7de 3833a731abeca153bdb91e6ae155a90a -03be67f2459dacb52f4419c05d9cf9c7 +98d75e356fd2b8346ddce25d95e0ae71 e9fc552212d3dcde62ce079b3ae7da14 690c87d366aca89d2768a17c445cb045 -da307033d9af4e73d15dfff967f301cd +791e669d26928837be4fe2ef749411f3 0cd2d97cc04d767f61df46295f3689bf b5685b4431db742c4d8e5eda463ac680 36ca80ebf0280ebf1d58db67f6491dda 4cbbdb44f239d315bc124680b44e79a3 f286f5bb77bf7a5d6a3133d47ca2def2 4e48782ba5e3db06fe07b7a077ec5639 -7039961c9bac00c7d741ba4411aa01be +62e3883c35027c39bf1e314e7c24a570 09e9a424a7a3756529a6a9802317131b -b536e6b3720ab1a0bd19d0cff38bc56c -38c5e9d111751c319c3b15390e924b17 +130c00d386078dace2cf9ff36b9f5c02 +34b0430074749f12cff0ff3c6ffeb334 819885d528aca06ddc71e73fc4f53c60 d95092bbd49344e2a07606621b38780f -019c8545f027aa2de1002d8f97911304 -107c60ff2789cb0af7faad68c7cfc5e3 -4c0c45c1fda83bbdc69cfa4ae7365f72 +a24cf2d2bdde87993488aa5ac2311bde +058fd071b124431edbe806c875a55025 +b1383da3b366596a1c0417fc06168e06 0a4b3147837c4b2697386b70940cd60d 6c350cab97cc78a5355817fefdde8d1f 0102a1534d2964a0ff588ae23e2effb2 3954cfb000ac4f676ed6fc06af23dacd 984ac2a148088665cbda36e3c2d1e226 84d22376b36901d38526d6ebe0e10281 -b904ea77e96218942b531e429d73ca9e +05be9a7471ce388b5e2e5fe2954b1424 65e9e1b5f51015b08fd5e36ee6766fe6 -18cd624bbffb0755b7d6debd18339380 -0eebc1b879f218ff0bc49f20bebe7d62 +ef25f47ee67eac94eeeb0dd9b5d569fb +9f783348297844ee23cb6f1cd01a212f 89da70a234eae57c52a2c2c94993f02a fc98abd696e8be5f5f266fc5a88e952c ab4ecb5d3233c1e528042934ce93a740 @@ -9679,55 +9680,55 @@ 76fd170989412fcfb3cc9f0019c0f184 ea995e584eea2e034db3f28d8fd9bb6a 1b0c0949ff8e57770f7e88e433b4deb3 -f4fac5306d75577287c3e93685617f2e +75ef924e15af16ffa6eb2ccdf9d8ddf4 7457fe1789a9f0f07205824fb97aee9d -c32c79d19fba449a6293b9779c854a57 +a025ed1d0dcf70880fb1c0c9afc6ac1d 8c05bca341db9c1e806bf122cd6129b0 f8f7a172a28516637112bfb05e9b0bbc -cc8bb28a1c987461257eb130d150c152 +44ba92975e6660ad82e875ca2bf70c9b 443bd303b15816349244d32e532803f1 -24587a4f7f28aee1e9ec50831ebe0471 +772113b2cf9a9a23788e28aaa3616e44 4a9dd02753c248d33d39dea3efa7acd2 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 425da8d00f099c5e145c34080a297f90 a4122ffd8f45e924d0008ac3b433753a be6f11bef46d99c22eb5966366c90559 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec c6596953a71008b40a07dbccc4246f00 -989b7a105e98561e21f4e9e07902bcfe +73a17ac88ca0270e05f2159971ea7d85 fb330418c81c08843a8ecc7b41911c3e -613ef77327120476191a189d589ff35d +42caf35eadf47ce63212b7293613c26a 901903fc1de65fc69091fd2329c420ce f5b0214673d66b795a0b2384d50a0f6e -16469179573686b8a93127543b96179c +93f882d6f3b53b2356fcb729ac5a66b8 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 71069986b806fc1ff7a81389411f3758 812a612df294643f768e53dedf53d8a8 912352c3ea040bb64208b06524d3e69f 59e6bc72bc79cb2058f3a3142ddbf65a -8f2146768829eca23aaabece6b2de026 +259c1b20b9f05320ec796e70839fc4f5 bec38e846ba9a13225c6530b1a282c4b -cb9aeac6d97c3f64441c933400ac7c5e -da6e81368af413212a22d190a7e87f05 +c5df93c6c0e803924ce6e3768655ed6e +a8f1aa8e916a8bdc0840628322b2109d 29274ab30398ff24199850dd8f263b78 91d7a4a1383f1b0fc2d3e378d46415fb -a58164e67d27a30b24604c0a0b1bb162 -432b10c20f8a08bb5c9e226c82ef3ff9 -f639fc0842e405e701daeab5a78ee0fb +b1cc8152608356ba4ba7f1391d54fbaf +ca7c24aefa1e07793edac9f3ddbe80d9 +a5f494a9067158c4b81af693e44ca2f4 12ab9dfa0dd2b8b003da7ae04c38bb2c 4c37f0937bc0bdf3829712cb5d05255c 096f70f880dc63e09b098ab89df0e483 6178270f145f619a39ba9638617557b3 fa985871fb4d0f74795b3c61bf129d8d f326d01ea1f9cb89d96aafdbf65dfcf7 -2cd6906712928cfa690ee48663264147 +b7b25caac3ac1481adcc45577b1fdb59 0df5c94ca0fefe23e45d64cfb4e3a943 -261aae0db831ce67279d2ffca7015545 -47da69f211c95f6cba5dc0eff1fbd761 +b25fa99e7044413d193297bd3909410f +8354a1df4b6e9dcfa5e89a6c44d82e2f c734b464a1378316c70ab63dd8a36e34 46f4fd2960c180e57bf42a4003b95789 d855926b2e6609fa7bce6078ee3fc9bf @@ -9738,55 +9739,55 @@ 449de434949a3e2b8780a87e7b179d3c e7c1d3a1b5e1cf7d3216cefaf1f2685d 0d4ee93669987ff793623dda488a0cc9 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc e4fc2e43ec963c474b2f6f9ecccf3ea1 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 6448daf1b06217c7dc989bed6f3709a2 fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -78faa2226aeb9f90e52c0f6239002838 -58c41f60235ea1a5fb3991bc4fa6a24b +34c7fde492170f80fe8e0e6434f3eb0b +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 59b195fcff4d3877045fee21c364d524 @@ -9797,113 +9798,113 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -001f89497d83b75fd374517b88d782ee +f8a9693752fbd4548c1ac8da7c8107be c3e50ad0d4c93692a2810e136ada70d7 -2cc2731ed536bf38737bfc2897163b4f -cd00474a5d3f6c553107276daaebe05c -5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 -545b1414d82cdd476e8d6676161e3103 +445a46a82a229836e2a48281bfaab919 +1d9a45779fc4c9ddca70d2112c570cd9 +005ba3bd0008292e2a85386ddd1fa04f +6134c80e606fc3eeedd5bf6a39c3e77a +e53cc4766956ee5ea80f16d007d510f6 83d51da6ce128a36cd2e5d2dbab76ce0 -f2a97948d26385dbf048ef0cf2c525d7 +4ac3174e1e2b105f8a57d7cb28a3d399 8cd10e297876e0c2d47a576dfcf61a2b -044e22c98deb3d6da5898931cee7224c -599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 -d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a -fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0f546518edb041564ac25ba94055b263 +8814f2d26ff511d967f395d57acd5685 +50168662e94e4db72ff2ed9dffcc4115 +3a925c7039a115c8e6ef0d90f31dff5f +a1da5aff187e7e5b5f81bb9c2d661d5b +7c00b3d8a22adb8465d426fe5761fa35 +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +d78ac4ef6dde0ad5fe7658f9d1ce627d 1898ba53941f49ece5a58b90fdac3ebd -7353c73dcba6a3beb03620ccb68802b3 +4a8c0a31962422325855a971a1c7710c 5568084ceebffcae386fc1ec48e7ffa8 -17da2830504929531702d918d538bece -681bb6760c742ae699ed900dca34241d +13f83052a3d8a7d4436fb7aaeb7913cf +8b01757f2b296289c0f7db30ec11d96f 59862f5cdca62471f71fcab151781df3 -ee05f7fb91d29da2977b7374f9cff85f -05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 -5f93e31d32cd99d38e3d59c80b4137ff -df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea -5b4aa669a151dc30f4dba6f345177d91 -92ac14a3dd5307e6bc4429f625ac3f5b -07692372f9f22331da5ca1cc604206c4 -f5c74ffcbb82b66d295e84cb0c11b477 -6448daf1b06217c7dc989bed6f3709a2 -fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 -c57c2471c7a6eddd29d27909cc422e41 -976677f9986a37f46dd8cb078afdce50 -4dc8101030bd3c2080accb4bcb04f9cd +1e741510c30fa2894a498d766b788feb +9c64532d564956b7d3d3a257d242b3db +b23badd5a8357651688c3f6df1316769 +8b1c537db8ab0fe4c3f8927b2fb0cb9e +54d6d201342c97b3711f80827d656538 +9fbe301bd2b07340be501d7484824647 +a6c44b297a558b313b308619d0156073 +119f3dc07f5def810e5ef2db590bc1b3 +02f8d83c5adfb6d65ebf8b68fca9b672 +218c313a6e7da245be69de66b962f49e +cd47d93ba321bc08b38a92a265f6b3b0 +2ed2a2b1bf98711b45ff827f312a4e7c +60612a3459c02626f55f8d6d0d3402a2 +2cd7d3f7497c93d075b5ccb792446c39 +7757d7cb0a69e68eb61016da1eb117e5 +5c421382d1ed9e5e1f86f3bea1f29cc9 +dcbe961b1ff65aa4f20d45fedf7f134e +f533529636168b23109deace45243288 +5a95f66a1bae23db97588196ad92077a 8cc192424d2a8a3a8439cf6c9e9c866d -228b0316d26bdd36e56a9158eea64ef6 -59b195fcff4d3877045fee21c364d524 -f6118b412225605b9bfe2d33480f8f4b -bdb2338095a4ea340c6d023c861169c6 +e86011217ac83cd8b8952eba36da554f +291adbc7d79c325be982f0c0d155a12d +037be0b259ed6f2c8c88156f1287a353 +03cb1e67010459bfa029a017a1772908 b59c994938b335efe318af6e6cd7d977 -449de434949a3e2b8780a87e7b179d3c -3ecfa35141eae057f996daee3608c0c8 -d7385726059a0035f5c91a2c1602f235 -a95fc4e5f314aab5e20f6265a8f35682 -f1f34d8c0f864daa5e8ab56801027430 +b898ceb0904d8567be7de10c55a0729f +66e0502fccb30a28be66dd050968f0b2 +ac055953468913e48cf4428070d1db18 +1483402c0b4004bb0547e572f2c6837d +6d68e6d9d94c46be0cc3db9e41e2f99d -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e 9e04b2cd1b93f421705034d5206749d8 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 87204bb4bc4b2de9530578fce343498a -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -7bc61a1f1daf334bc893dd1f0b05ca37 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 1ca4e724a542dd90368a4612a878aa7a 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 68633b9a396403744b2f3e762bbf5a19 f326d01ea1f9cb89d96aafdbf65dfcf7 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -5ba7ac8405f49bca38bb086f6cffa95c -4ffa9d84aaad0e85fa501f82879cc18e +4364c1e5068618c97951cfab09ca12cc +3bb50d344204ac6115c3799e8e7d51ca 0ad67108567f99662f7dabc9585331da 3122c8015a2583d254fbdead8e4fde52 6f225dc643f02ed2509b857ca08a1695 @@ -9914,55 +9915,55 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -044bf44c5d7d18859115ee1c381a6128 +f58703fa42071506f754084771533803 4f3dd930710082c606d630d8399cb483 fe0cac1dcd26398b7af88d0463c11bf0 -5ce211155fc5ed69d2c580fb0ca5f1c9 +fca2cbd48c60d97608b0bd8dc7f72ffe ef412501addaf9bc480e7de2bfb2d445 -cf91e13332c13625c1cf2ea4636ef527 +85241cbe975bbd8c97ddcdd93d5649c2 24a463840569e7c31797c226dbca70d8 83d51da6ce128a36cd2e5d2dbab76ce0 25e1ba7efdf7ca4514b81e86f1b0434e 6830bc73f64c593602b0621587983a53 f45ee6f7e075dc07091427a65d80bc3d de802721fcfbac64dba34c4e57db1d77 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec f224691cb7bcc2759a3892662c9db80e -22594888bfb7449667e2bc9e473123f3 +7993356c4b4d0e06e33e6aae2d86d338 fb330418c81c08843a8ecc7b41911c3e -b541caea5c767a4f5592528667133bf4 +5d07d2a675f1aee608bafb069211de4d 004a58ead0e46cc37a0012f34830d7e9 63a1a0c3dc2beff496d15938130fbc1e -2385f20e749585b5d5662263217ea2ff +974a5c0861d9dbc8812376eb626d1252 2364fb2d06a0eb002e0053bbd30989b9 1b07213c7405612a72c82628826d7d5b be187e899e7a47ffd467e9ce35b8f4cc 17da2830504929531702d918d538bece 6b2bd775e06aa7cbd2f7a8848f5aba67 992fdd617035a1127aba5caa02e9bf7b -c350f2eeae2f5d929365041bb54c9a13 +42e733a579888b558a3e2469456ccbc2 6421a8b039e088359548c024a50070b9 -10da288c55fecaa85ef7af08f041e3f6 -dbee74bc9545487c0b6806e498cd2aea +e54187fd82fe00c9c2271ba19d36c01c +1900a6121679c88999a0b9d2fdfcfd8a 5f93e31d32cd99d38e3d59c80b4137ff ecbbb1603ab59fbe960202b3470413c5 -893511fb018dffe28b1f0c479ba7bdcd -c102737cc01f004013986c097d8c13fa -70e1da0a51b6247be17eaecbd9417225 +767dd7ba08cd361151b6d8390298a342 +59d9c7c8cf2b1a6d3429e1ca7ff1a031 +65c7492b9042f2489146986293c84674 e2bea3db3349c137767eab56bb706958 aa04bdeb89f5b4ddbd80395ebe09c29a 7560df62010de03bd1597143b8909d9c 501787b615deed8af323325510e4479c 2bb94b0f66048dd210f0b149544f69a3 999992f3bf87ecc74a951085c24ab54c -fde64a2155b288f66c1ae7aeedefc3bb +70dc7c7ae05155db57ef2978e8c065c2 967f6c4724c7c5a3807ac81fd7d42d57 -cef93c9c42f305fcedf9bf3ae8d9f7eb -e89af39677088e95fd2c457d10487b12 +c5e22bb5166a4b69d304414f519b359a +1eea27d8dc099de59fbd653e5bac258f 3bdff0ea3ff709e917be270c3e96a1e9 c0ce2218241f69e739b177fd5c140033 9768913e4af639ec2118c264a5ca3583 @@ -9973,43 +9974,43 @@ 1130ef43c1a7437b844db1579e3c434f 9544b3406665c8454ca7ab39e2a6393a ccd751e3f9c583aae56b1eefc3bafbbb -fec167baa346c43989cd7357a091ee68 +0545a8fe6b0d4712665045332c5a73fd e77cfae1b2c9124ddd567cc6f0bcd7a9 -9eb7de069f59815934e071aa4bc8a400 +d04237165096c4ab4aae777ac08a63c1 d644237a73e898a62393491905b4ed87 -4160f02f654932bedd29edd671b51d46 +857cfdee8d1a70d9357f829ff7465ec3 b39c038e6e8b0628c90d5114271dc50e -72b5eccc9277874ce99e16752aba159c +8b1af0ee9bd757f406a9085e52cb3e1a 18381fbfd3da6eb62195dd3d7c2025b5 fab0071a1a02bdff2c962825b43c2dfd f254234f7743f533f091e707ae5c6e5a 93d2324320ddf2609d33828f0070e552 -5b5402436d2e5525c68fe96889c8628b 07dba3c5fa878727518a110582690996 -2ec28d7d8a03797203f724f8e5cdd8d3 169e53e9bb18aead3d080bed0fb9a311 -14b937be198fc9c37d706a131f110c68 721f864f34ed9957a1da79a505146c16 f03b0dcf6c6febaec231650b079d2f69 0dcf4ac06cd149d2c5828b8563cbe01b -1a6ce5cdb1c6c8e0101031ed7aa4cffb +436545df3d1465a5a48adb9868ac07a4 d0e4982b7bc6a1cd62b339dd4edef863 a946d614786a829d9964c0e27d143e0c -c294d42b0c532a0d0ed0ecd75b2da20f 08acb8a8ca3a1dd92759d583424913af -5db0fae663b6387d4176b8cd656f89b9 -1f9c4608541c8e95cd6189b122aaec7b +525957b57a0fc667d697fe991b9430d1 +20bc5f32b32f8e0916ce1a5457227126 86a67dc27f4eab8f63ed174e5c3b5d6b 7c997211d0f9484e255a5c00ee139c30 +ccce0cde4bf1a228f603f64e14dfd505 741a1338d8cd1eedcaa67bb2a3988c56 f698b9faa688684b6932c41c48845c65 -14b937be198fc9c37d706a131f110c68 -3d09d84e3192b9ff3f2086ba9cc60080 -d1fe9d7d18e6a94eece41486639cd0ff +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +73bfa19aad8a9d2f4456d5c6e05bc7aa +c586c55023f5ff1cd37e7bf4795ac916 +7d6b8f45303f24ad769fb402b9416bb5 +9ed2bf9282af9c376568885348569e87 b9f82ae7cb411ea9546ce513e57af1f2 @@ -10029,51 +10030,51 @@ c2d7742f87130bde6c3b91332f04c837 -a3e9281777bf6379e3e532d4f86f9918 +a2319b6bafdc046d8782498e721068df 76391c0def140fedc6931ffbf18ab295 4c6700b866e64fb8761e87c807f31801 -7620117a87ac76a0abdf1e3f2a0dd2a8 +2f5b0a47cdfe19b77022593d65a9ccb8 a75be484704fc95dcd1bd88579cdc6ac -83541ff8d9a8403b1c4d65fec49f1def +85ba8085df5fa8598b2b64e97db1f12c 93f3338fc21f2da47f79c1446f3f5da0 9a61b8f01d920877ac43574d7a89d139 0a27701667ce4d505e2ddbd6a16b8cc5 8361914c0ee551857cc25cc0fdf97fe9 d0aab202d384152857a67a5910d74da1 7dd6c7b2a261d29947a77e876c528bb7 -978c57249da23e3f3d93de87b2c135fb +b99ad87df98f3a06424fbd9ebd338e80 5e43b0e94632b0f67f274968d54e1066 -bea204cbd818b1018e5ba6a410128f11 +79176c1d8bb3143c78f0830dd414f606 cc5a2dc3e5de619ff865e9d7c81e128a -c09c45f624a9bb96d696b4e736810495 +fe7ed9ea8c32d40babb3bb89739b8880 cf47d01f997d687b8a1bc38e0cb6485b 31f372c93f03315c680f0ccf7d1df897 -5b6e8355297f48719eaa508a1dd0242b +b9731741850079b9e831f8a6890ec89b 254cc450c35f98ddf34271255f4eb6d9 22ec38a9e1c8d0a8ade2b378df4dfd5e c679cf1cb4b8e13fa28a98eefa89e436 caaf489a26511afefc97a0624f47f2e0 e296aa7dae0e0d5d91a2a7cab148a042 1c9f2e419e96a7abf36d46c2cde71e7a -88aff64c2a387f2558e14f5dcdff75cc +e0e6e54c2cb89b008ee551ee9bd97804 24359d62453ef0883ebce7a118371c6a -68bdddeadf40d3061dd009fe77eec5d2 -487ac2c661ac6747c4931ffd4e094d6d +7512bb4a63889927a99524df2da76f7d +9cf7b617ca05a4066e7e0d5d02db6512 bfdffc1cf6e42979f52384d3125b72ad 5136e39159be1875f8f6ba4489500d09 -8028b9965a200c62fd4a16eee39c0e19 -6dea95444fa084d9f9f33be87ab60a07 -2edcb98d384fa73b9452c76b88602e06 +05cf692312e366e5f262d956d0c11eca +70cd971784454b3e119e1d0e90d1de8a +24717a755baaf426eed7c691330616a4 45dbd2119c3d6fc009c327ef5510af98 c7e70b20d22458e1c7625cde28fd7c3a 8847fd5eb933c577a1a58d65274df4fc 26d9830c8d765010486530413e4827e6 ce9447e5187596bbbc50d0906cac35fb c35de5bd5cec0c5e363104a2e2e4bef7 -198b5c8e1cd19cb1a5338b8cfd7e11fb +7c452999b4237bc2856f5c3119ffed49 9af1f73d600a2a75987f983e3cfa6d1d -dfbe3c60c4f1647c6956c3960f848fee -506490e627de09b3c0121d57b10a76da +afecc22449ba878a459caa37bef63609 +21a333e51f000e1ff0aaeefc9312caf5 17835e9b0f75e2f6dcc0345f888cdf4b 5d8da5928c310fe821026ff6eb52477f 50aa8753f776052cdf34c558afff98e3 @@ -10085,55 +10086,55 @@ 737511d96be3c80851cdd4018b27fd21 138735e3488e4289f0efaca31ebd99fb 9860471a626d8cb68c4f882a84bc7bf3 -d9a68560ac879c04862d375e8163dcd8 +275b46de50035e1d052d6f2798871d0f 3afb85eee792fc054a42df621767b520 -5f817922fde15eb48895573dfaa51975 +cad8ddff1d4ce01b74a4c89b39950974 7cec430ac1104bd3b19e5890319c7fa9 fdafaf7353ac65d8c09de8af2a8f3d02 -02de4123dc8fcd35b12d2de81258b94a +c1381bf5be0a69e660a8520b87db5f21 f29476a4ccd176b6dcb06054bd905662 -bf7415a185821421221aacb0adc59af7 +70ce0f35d14c6abfeaa210d3d1be0036 38e0e2f17c3b5559b77b0f2406a3be1d 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 6b0bd777843664a8aa07dc3ff7c4e056 af10bf1c20c1f623bbc427dffcf8d85d 5d81b77669a8e33aedfb22e0a89257f3 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec 6c946d22da24cf980129bca6e8dd85ed -0f859bffb657420f91289f3404c3ac5f +0c36ee899709c26ef7a38003fa609e23 fb330418c81c08843a8ecc7b41911c3e -70bab55d7cb9bda9286475b0e83d5667 +743e2013f8b645af5a9affaaba23e2e7 c89a0952620429ffc07402cf29cb6343 db6c98d5d67b4033e5b2c0669a0defcb -440254be3afebcb1e39048e3d150f20d +f7c72dc1b9159c90e8985a0b5023367f 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 98e462f88ab14c1a545de484f1b66166 72ccc97c1267b7432a5a34838c729dbd 8568e4d03cdcc1874f6f39e21f994007 70b002fd1a16e5e9f19e1ca9c51797ba -0ad29ff756130d52f6263650570736a3 +a23db72fe18e54fba427eb4e66257e76 cc12ebdf72077be80525d64e6a7ed5ec -418be20b4d4d50ff450dfb18734e4722 -11972a00c6080c23c92f9dfb07d15d6c +7b3826dc0f092040df5f5356d8ff8e09 +9193f8cbd4f4442768a02e8c54ca1fd2 c101b90fd10577eafb85a1e9adb6c0a5 8c3a12722573cf513d5435feb7f71adf -54e9748ff0d518f522fb93e68804396c -6937cd0dab5849cc6e6090ebfa6d4ff6 -54f0ec2e4bd20af4a2c9ac8d15c5d3b1 +237f3ad73e2160a8b54aaf96262ab5c0 +d9933cfcb7f8c7ccbc4bd7f0042f1e46 +0fc0ed7a2924a23996079448796c537e 5940b1e0d9e4ef0693e6f862f1fca63c 976e6f39654ffd979a1633da2107011e 7e73be5f5ef1f54d09eae743625e6e72 23688a6549a080e528796537be16b9fc 2b39e01ef2d55c7b3a24671fcd570e59 0b5290b5856769452f96d8557ae4af4f -b5468bbd78484c8d55f8cb41dba6bc7a +135327918b1b40a9d85e0e11c22191a6 4de88dd01e059e9f95fa2110ae7f8009 -1024af8ab77e45327b7d2346f5f7986d -d79ce4f27f06d0289029d762e1c6ab01 +c5cefe593185d53e4916a9ebb1db00e4 +d108704ee03b60d892f36b81181c0ff9 eed8a78914dc69097046ef05aaefbc39 1f1976a8a42bad235f1ed009fbc606ff 4404ecf29a07974f4cf843216d86641c @@ -10144,7 +10145,7 @@ d0739d358ed00196d99144e88cdd7f7a 3e1b068f6c8c349c1deff0e88c8ca80a 0e72f1e88211f93ee64eebbfe1564d1d -b13be9ebaee90884f0445788681ac8fe +9d02a0c2396beed8f487a5dba939317d 1e261eaa004ceeffa908ff6569fc2119 @@ -10153,51 +10154,51 @@ cf97318c23bd26d18d237b60384ddc66 -1460f43ddf5814a3663461d0beb1ef5c +e605ad7b957a19d8fe36c93fc33dccee 5d320d584645765ff1a2708f271845f8 2660b72b66426a56722e0907c756ae68 -79bba0d100143d3830684fbe1a9a7fc0 +cdc6878c246cbc6b8f17ab2411979043 e83f4473fff2b4082532ad331f1b1f7b -9389e860be256922eb37d0e88199a8a0 +a8b512f6071708646d9a300e34959efb bbd623fc654d0934ff37ed00c28de1a8 e25797bc9974d0b299076b48287420c6 771dd023b76d580a4e7da4a064ba3d0f fc033883d6d13c24d580e557ef1717ec ca07f1bf74a5f4a2b92039d15a99c224 d08b34780ab4980ce0bb45d9130b6a7b -6a62458b8fea7eb058c3a932d6ce7a0d +151bf9e4c6174b12870e484fd6118b4e bf6cb3413093d75713ac70cf41034423 -ab594236bf2e2a55fda6cffe5735ce5c +60c087c4745633837a1cf463913f9a56 413e0555429b0e7292bedd1e52f4600c -e124372c58861b189c5ec1d4cb40b06b +233aed69397182ef49de87742d88bedf 4d29fd256a903cb9fb12b7795385a7be ef3b8f2d379827209d56fbacb1dd0292 -b27f43f0542902f3cb417db5f3cd5b98 +59467fe98c12db57d65e60d1621c95cc ba1cf48d1f6d031d8adf51752f179275 3646fd310e96bcd7ad15253c92d3d083 30d2ebfac928b67212840b7560e43f0c 5a71ae000c909a6928a183bb4a2d941e db53803710393c0486f2e99c7029bfca 390875fe099502f31e29c8772af30ef1 -97a45b0930edaac8165252d084ba0832 +4dc2ed86e4551a07e4ff21e17d1a29aa 65a69690e67238c7a65cdae57faaf825 -5ffb6a54b7cb00a3b3094b84c0d76053 -7d41815aedfbd86c8d0ac1aebd7fd21a +415260e3759dc4f23f9926b7ba5b64b2 +ba37223ce257f3662e2be96311962fce 0eff879e0e50e8ce01972f38551cf1ea 6a52787b07ef94e8737e8d822bb0ecf1 -acc831f5d2aa1117c678b0a8f74b32a4 -d18ba6977fe772f40a242719ecc449e9 -e457cadff463da8d5ce8617c6f99fb1e +f27618bda8ad19e01c07c6f3db26d92b +7e3428d77f981288b2a3174809ec7ea4 +d09bc0973279364ed47cdefa6a79c155 8f8a364b8d31313a165b00cba801409b 4663e58b350137c5a7d311f08ab90d09 794c2d9924dbe3f2fe7679c7069eb5c8 11af8e473e963199d9566b7b376b3050 622fe99e2e633f0d3e1b6184ff06b958 3f924c148e0c0f512570e1a1c65d81bf -f6a3a43c74a436c4303dc9a6f079342c +bfb6d02a7e828b4654cfc5cc18aa866d 2d2a97a666b366adedfcae6b76159247 -0e4ab4daa9a9227ce179d13e344d2d8a -6f04c7df289a8477a4179a8b931d6da9 +6802765991e1038ff058fe43a58ac024 +e829de6a10c74866f41c0fd415c1edae 4d96011de54501b073ca0dc8543778ff 0e1a650c3666abf86528bfd3562aa763 14497fd6edd5c6ff712f50e79dfc66d5 @@ -10208,73 +10209,71 @@ 062c2a7a4996394f673ca9d98ef3bf7f 05360e7849dce6f236187fadbeaae20f 42432835fda1f793609eaca22b834d19 -d465a5533ec53c1b957840c88f7422a2 +ad6aac2b4e1f77a3b57113392fe5c869 69e863de65c7c11b4d4359dd33933737 -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +a287d462bc71f579eea372c586ca1e65 +9f5ba8d00d619d312d40c07f38b35c6e -c294d42b0c532a0d0ed0ecd75b2da20f -02b4f98405e26fe54399ae5cf3d8e884 -dc9564fc481ddd3101734b4e01c40027 +503179eef2a75e444e6ed540ab5816af +3a63b5ca883378d2e5b3ffc0bd8367ba ab59d61bbffe26c3fdf53d3c6b5b05d9 -5b5402436d2e5525c68fe96889c8628b -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +cf2e582534edc6a59ece7d22c939c00c +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +378e17fcf077672377ccbeef64dad311 +b2ee3e61485fdeb685fc7f73bf802b23 +7d6b8f45303f24ad769fb402b9416bb5 +db59948d8443a30f976ef562646c108e -fb147cbb17dbe7162bdfe77907095f58 +d9f9fec3917d6b53367053b70488dde9 ac16b396be4bae4e72ddb087f590c2e2 7634fa5841088e340e78dd026a207001 -47d151d6c9f7edc4b8abd57c104c7850 +57092700792f07b4546c0943ebe8a1c4 53f1a80837a5b81364f828a9e284f4e2 -1dcf4436524efb1a8a13230391447a27 +93da2c233743613b21beb6dd691197ce f0bdb95e6126f2d5e550583f455f55d9 83d51da6ce128a36cd2e5d2dbab76ce0 31a8687a8d2cbf8992c607e1f21e0a7d eef423b5c9410bec537cf0b8eaf84d33 bf78ef45d31ebca84115e960baf244e7 adf891c20d96e4184023d04552078088 -b4dc1d5d3383cd97553fd3ba3df420b5 +99d11807fc3d60ef8532b0dcb0e7566b ede3fa28a1d3a5680ef13c9e227b42ba -e5d9dd14cc3d69083f2c281ed9a48c3f +18783aee3a3acd1e542de7cec9e576eb c20563eb5ab144e4caac3d422a3f7a4c -6fc249c7cb724140382a596a1b373c1c +9ed840b9544e41d2db4391c20dccd674 eebc91d4fab1259c05415ed82cd19879 007da2b3bc701f7be0efb50a99d72e98 -7597120b5a11d00a52eb601534845ec1 +4086f5653c691655e505bc0fc5cc6481 97cf9622d28bae2a510eda4aecbe0319 d3988891f5f080e84de28bbfde083477 508ba851c0f230bfaa3c32b813d1fcd8 979ec7bc5aa8684ffd8ff718bdeca9b0 9f887891e44e6ccd4160a5863c49cc26 9ef6d1074b9e0752a3622a84e8905b34 -6d2b54979cb5388a8dd1815643da9e06 +04c89392f04467d77eb2a2517bf57322 620efc55eb30835ab25b36b1f23c7290 -bcb7d212efff9d2f016db69793c8fa33 -742b0e2ef45c74154110cf689a6a0f29 +fbeea858e27c8b3de5a1c75afcc9c9bc +771c64d563aefc79aa6989565a94920f 1099de7c892403a38bcb3f388002b114 a9bd45c8e4c6e67f48f99a56ef46b676 -35bf75e1e9a05b941031c4f40d49a9e8 -8a0018034fdca48eb496dce3958b16e4 -91441652fe9dbc65fc40d5dc679ab051 +1bbced61a157b36189a79c706f547db8 +60dcaaf4d25545cc93de4a34c5958b25 +be156233bfbb3efe91d096016210b107 bf0ffdd73c0e91aad6aa4e4b86f2f4a0 0bd9d42b67a73a9b4df222e4245a5fcc 6ecb7391c7998ccbeca8f1209166c7e7 090ad581e9e8c566eb52aaa42dc8fb72 3caeaa1071c0c238662aa44dd4e6ba7b df6baaf86ed9f3d0e4b94c391d77f33f -343ded92c22f650d69a9fcfb35378364 +ca74ee128540b79d6796998342fc7312 a33b50027d330ad44adcd5e9e827bd42 -81bb0c6d4650c32d2fbc032040c48b4e -7568f35163d68aadbb84ea44330a13f0 +309cca9ee7dd88c3fd4f5442e19dea63 +4bb861c191c93953e11e510fc40536c8 677f664243cf071749383041adec0414 a14311660639a521042796c468a23b1d 17645bfcf4473c061cffa6613cc4626f @@ -10285,16 +10284,16 @@ 182eb0be249cd128f6aa5be40849afc0 defbcdd0247cab8d6f14fa0ae50220de 936cad9093a2d6bced1c9bdd5a8c8f9a -75bba8fb899d23990e498f170e323e78 +762207d326766599a5862e6f616ee67b 2a02d65f7ee53f1a006212dd415343c4 -17826ac0abf776f5bc6d8c68e09c17d5 +5dd7d20f01960b03734721e766ba8100 dc2cd95b6531d5b5cc7d52251523506a 57282ab3ba26185cd568d1838e0ab8f3 -b12fb144c4254826c2d04579be5b5f45 +d5f0a740213ba25091cf3f1cc4905229 826aba4abd3429ff665409aebda73e5e -f2ba671f9d17aef7228fc204ed1b7398 +ba85b46a82d3f8c4955e4043245e961a a094115816a8df0c006766c4000861c6 3e5ce3b248f7dda5c1eb88b75a642f5f 25088723418dcc167b4665c455714951 @@ -10303,12 +10302,12 @@ b05c8370bfbe8bc89c37c083624b5dff 910620b9e594d851f1f8a1f286890aec 601f004f8adb4995ee968e7a3c01b5df -d9c71112e2d9ed882f346e18ef246004 +006f9f9a3aee411c145e072f21dea29d 6b93db41124ee6e53e738d483b6f87ad -24c57b650c2e20498aa850503992564d +7f8510d9f8d1ddce0364899ac4508960 fe4355e5361957737c127212b9ab7777 3509f62c9752bbac4f9bde2df2c7c8f0 -99414bbf1bf1e685f4f730c760b96fd4 +62e75f5e1fb98278a1126f706f0738be 20422b3e39bd1f7a977afcc1b14f3103 0a0f23a2b23ab6686de48bbba96bc1ce 27883e43e8af16b177867e0b22809805 @@ -10318,12 +10317,12 @@ 07fa6f601297cb41a1a6668d8a4137c1 90c202b94dcd09173f067e8bf5164b77 4b3416e5ad27f1623f5c9222cf93f491 -4f30c615b5054649acfe658b41c64664 +8b2e7f4dd5a2e5d494f167f6d0b38cc6 6f11fdfa4b04669635edc07ca6efeca4 48a83412d06860f170a73a68d6d1d607 5c3ad5663f3d6527148247ff7312b385 -2e611ed7fc633ec32354afd2809d8312 -3b991a186f3742555e60e6f61785e885 +acca800c8cdc980d7fdccc5e9faf3e56 +4f54e2cff46f1c74c68cf63780efb881 ea89357f6a833ce27bdaa3c633b73559 838ea08d95f65f9a06957a7d066f0891 925e7c28144a75b7e0fbc57715f523f8 @@ -10333,7 +10332,7 @@ f804018f508887af815f81d054905620 6e9ac5f9954ea167f40c686de9be6b7b 562889c108c03eb1b52e7c4819b3b125 -d1a2602d42b8e7df617ca9c2ad3fb71f +0573bdbe1c4fa3214e77435e3bc64f9e 285145b8adf6d1d7e53a1c102b25c177 673f3e0c4062e13cdef27b581fb66461 d74248250355b90443c5340490731dcf @@ -10344,64 +10343,59 @@ e0f4c93906c140661ee859581b1a168f feb14dfc2c998cee54ba6247bb784862 48ec52231c3493ab0344cba74e220a61 -813838a5f1d8832941b8ea61ed2c7271 +d8c806886f45ef4647f2dbd94e81a84a e17ab7d7f81ddef4dc5e5ff071a5152c -c294d42b0c532a0d0ed0ecd75b2da20f -322d2f0d1f63bdac9a7179e8f597321b -01ecdb579e7aaa2f7a35a9d9f9e706a0 -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +8e7647cbe7536c0a885439de89bf2d16 +9f5ba8d00d619d312d40c07f38b35c6e -6656b3e6dc07ae24df1501e0932f5ce5 +b2af4183c35c8368957a7e64377cc57f 2da9b931d17ade2a435827c23455e872 54f046768f3455e3fb35867c5b0f1ed7 -9be923895e488ec1757cf0a45a39a5fb +579b992f766daae40b1605aeaadf619e 08e9fc5f52a0c53994887f92e1fcc44a -4f1b28f5fabec7c2e7cba7b1baedec07 +8bcd04bae3ad9c4f6d9643f29e9b498e c7888707a258ca1950680b39e80cd6eb 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 cd8e0a63a6201e157c9382e9ed179a09 0c2770f61da58d89d7a3e470abcbde21 56f667c49490cffec8ff2af43be01505 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec 23b458105b635bbae85e8543b714f466 -2a429e1a02d9f3305cf6db2eea26714f +ba86eb94b183aef4f2799ca2634ef9db fb330418c81c08843a8ecc7b41911c3e -ed56660e07d6d83851450fae4059f07c +c27d3f95f804e12715a63ad998966bfe 00031f18fd4104d1b3e39b63c3d6dc2e 79089255158765aeec5fcef88335c136 -58c57248c7881f25664f38bdf8a9cd64 +04b23547bf3a6201101e44f05cddb03b 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 2cd9e20c479aa18f908135af201a395d c949765e7e8fc39653e1d97d91d47b01 7b38146af31c9a2d81c95b41efd3855a 8eb7f101d38e1a354b316641fe4ad6e7 -377e3fe36becd2edafe1a82c880b5e6f +a8be8c5ca25dd947988ca9303c489275 5168ede7bbba74044a5a8745af74676e -a7fa3d4ce82fda303db4c0e92a25ff8f -050543336f887a276a9c6e130f1a118c +eddd90e362600b18430210de2678e89f +d8c0da3df4be8cf922d5ef2432d44c44 19e47714f4bbb927bde7107edc730d9f 09fcf901f0bc76651c15015c36971ba6 -22ed1ea1d7eee7eb18438d47888a926a -a8b28dd3467b6f9462fcf4f8b4fd2619 -62e9ea41e1c061dac2602181fe68acd0 +54796b8197ef6dfca9f7d998219c18a3 +20be3b587e448c9e895c857eab0e43b0 +af01e7f97733e4cc9f43563044dfa05d ee8a076945ed7cb442619baa9be2442f 15587334eaa9a54668859526ef2a173d ae0b2989e0a8a56c8b4a3b9a77429586 87fc4e5a3fa058627fed5ec8543bd51b 5c3fca1a0fe9b4eb6ffe3c9d9f8f7062 f326d01ea1f9cb89d96aafdbf65dfcf7 -e0a1d61c2106bcc5f3b9725a1eb5afd1 +9fe1ac554c7c1de5066b3d7b81f22639 06d2f80c85c95fe57a57f846f411bae6 -305f3329e4c7cae712862c6869f738c5 -c0fb37d9b7860c7cabe50b6ee00ddd7e +6ca627368273e87b0d8e15e7545a160b +593da56badfaf10ce8795be74ed1ff79 2be4d4a4c067b0e7d6abb9364ac01a7f 64d8c175fbdf22de3a58f0fe7a5d568d 64cbf57e30411b123cad22aecdec8857 @@ -10412,55 +10406,55 @@ 449de434949a3e2b8780a87e7b179d3c e0ba63b632488657acea03751b852a64 c8ab1ce70a23df70ca4f14487cf22f69 -e381c02e0afe8e2e8f09da697882807c +28e1b5322211ded0107896817fe3011f aae9d37af7193f531dd6b5ad8adadd3f -9cd84209473651f97c3104ba68683faa +389aace5ef7e4ff0b68a58638c29bd20 b62f02efdf9ac0a86c18a81908c92501 eab69fb2035665be0d1a792c15829bec -c4e28aa0e00eabde40d653f4f45e8edd +831d40cba1c92e8bd28c98c34ce247b9 804ed0670b3482332fc7410c05f2f835 -a26fe15779d39140f8b3e9d391368e42 +942ccaf3d1c8683ed112385b9b7cc2f6 4692462d58a2fd80d42a987c7ea8aee2 d90e588833456a9940a42f86e8542454 d52c7d2657535ea3b294a12cabdf39f5 9a0d9dd121a0bccb33e4928ea6f5c04b 5adb21f679d4fcb748ca9c7ca58893ab f2aff6a51a5f3b1e5070d8296c0461bf -266192aec98a0387a8023d984029ff76 +9582f4b3d033986832619b97359d8201 3da38f4ea86ed7257ddd3008e847ca93 -14b56945bcce39241bafdf5900176d1d +133dc348a86a495c2938ed78de122070 123a86fb0a51a6eb103794ccb2067ccd -047dbbd17226b58dc08692395ac3fd39 +410f30b698885f34c74e908963581a3f c632a366dcaa89159c561a5339552432 2eda9af82d13ef3affd1c4942fd3472f -56bfb296ce3e472c9ed60c59cac8f0bd +f5bdf1242284d362828647ebd96dfba2 765bb7cd6ac5f4a20b68e8027c9b3885 f8f96ff7d44cbfc3936eb112c11a2462 df070d5cf97903c24e69d1b203cd6131 c8d0d57fd5a8a90d3dfff59f1ff9c8ee 3e3f45be57bcb65cafc6165966deafcf 5fc61c1ea6a87f56d1e825e990ac0c3d -591d5fb87ce8f828eff137f82f6b070a +1c59494edcce7fa08fd90722764d58b8 fca9396ebf7b2d75dba9615adf461163 -f071d8490f9dcfb84809ae212b48ba8e -95c672d950e58c2f823cb29d16a17933 +b079e3a29f77815a5b9173c2feabb557 +7ab6aba718d40a2d6a60c8afcff7b082 02d605d8edf28de0d16ea863656a65db 371a05c7fd519e92e711b412705409ae -74d1fa4fde5edbf44b0c31187d32780a -333b68fdfa93dd089339149f79ee30df -91f3346e73ea2f142701a879907da30b +0ca244d08e809687c9f7e79e279a84fc +c417682e9f6d01290365f42b78edc704 +334a5d89c989883df00d10b86b384f9e 9b1fb82ce3b0aca36928900f127917af e7a5b910b574a29bc09a1396d1567d38 a6cb6f452563d756b01b256916a59348 d91fc3113104d8ba67c51b2476661514 de4fc74e022f46aaf85ea0ffbb360a25 540b636ced7493d4b7ead20e7c43962e -21b3b4c2539ab8e634694c48bfa437bb +8ae01631961eb7a276be73a9051fd502 0d9a2bb9d65f21b755512afff479d8bc -4facaf16a4afd6222fab22a6dbc4f93f -bf1d49b310154027adf1145539cc9d07 +9a06edef2a49690033289089d6cd9b07 +7960432eec8021e35327245eefc4fcb6 13c5ddf75492c68962c91afab763ab5d ab399d53ef38c91f15f5b8401f1919b2 ced9fbcf9c28efff2dd84d3b0de4f469 @@ -10471,55 +10465,55 @@ 9b0594e3a334ebd57337950e1374b48e 3260650c0ae93ef2b410b2c4d71511c2 ea971260dafded2f5fe7aeb3f5ef5d26 -ce7f65478ac60238d60f16e432c5de9a +30efed0e9ff5b5555b46115180371c5c 61d7d9b8502d45fb6dae1a0889effd14 -b53cd6293e534fa9a1647621110670fe +40451a6173526794176acb864c2fc4a0 3262db34410c13ae4d777e263d779217 31d65a4ce3cf788da72de88f7a6b2d06 -3b8e62e491e04f7a0cb9a405355e7d89 +05ae9f00f719f3aaef5bec5bd86853be 4dc3511b315c7d298a44c38ce7af2126 -e156cc73788016169fb0b981aa35c926 +28d327e71731c909c076b309ec901332 256de69b0185b8ac1e1164f52be30df4 7083dd601a0dd21afa5d5ffc09440d4a 5a302a8547e9d98cab90f51dc839a878 151c5afe182c4e64644b1489449515a9 78d057e8e8be68913e0cf967773afc71 f5c8597db76285b1ade05d7d6bef6955 -186dbbf4b11a9684557157006bf2a232 +94fecf363679c8ee6595eb087106921f d4adc458cbbf4ae1ae05b81bc08dc2d4 -4aa381d9960a082fe174a717f922caaf +cd56da9abe9272e55a18e1ff59dd4b25 7a6572951716b3e4ebee8fe54ffc4023 -8b88abc6a7cf70ce1acfbc1f92663f7a +fc70bbf4fa6b1fa0bbb0335f779570b9 a7181cacaf1235aefbc2b3aebf8047dd f5f165bb15c6391fc12ebac3e0a0f3e6 -8119a59c27aac8df56ce4b2c4d5613e5 +8ee2efd2f7aa53ba65adea0a1946030a 40f20ba0e389d91edb8b29b71da6c2b2 7508982db7d5e9e5c7fec3f096de32b0 08209ad0a5c53c953fa64bcb29dacf90 a083abb5e95590fe1cd60565bbadbfce 769fa149d74c5645c53a89575a1cea0b dc02836368ba0678cfc7289e18edc4f3 -7f005dc1c4048f02914f491339a5669b +ee618e253aedfa719a95d72dc404842d 0c4ca601c83dcfc8d0f4f45dc773e2f7 -2da0a1995db50d0752d2e509a3bca37f -215c2affe164ae37a7089481fb874de3 +012b10e345bcdc9dc702a284684fb2b7 +e89ff63b9c6b27b12455800068bee19c 10c2dcc555137e38039193ccedfc0cd3 bb194e9b127b46bb2271d19ed84603d3 -15be1fe8f10c081149a3003de6ec6921 -a1c2c9bfc0b6f28497c1869f91b54afa -d816d6622fcaf3c5f4e8f0a516128d20 +f54ac1724115231e8ade619a8782e374 +b1432edb772d35f2950db364b6154bc8 +95eb96950c687de257c61cc86bffd485 548bc532286b35f7a6ffee2a2801502a 199dcc4ae427c0d0e5fbde6c0d2d2f99 1be19aee93ff0725138722e0b534e207 df05fb48ea5f4eaf82df101331b39e84 8c8991fdd1f8a737640549006175fdce db71e7656127c95fb902fc19efa94945 -0db4c61ae8b84b7812fba61a45ea3826 +28eabc15dba99547f5f302a46df90cc9 b19954c856288b7fba6053c64471aebe -2e8be846099c5d7baeb4118704b5c7a8 -32fd9960b92f92505a61f1032c2bb842 +d1581462a134051a2b06e3a3e33f0f32 +c76b5db17f8f117cfa0a3b045375090c a475fb087b707ca8fa0d87a0a7e38dbd 7c8a83bee9be22e875c81d9fd80097f5 5146388b914ad2a67ff419d124e12748 @@ -10530,55 +10524,55 @@ 739dcbdb1af7be20fde77fdb159f53a3 9a001cf479a5f9de7ecc25311cc65302 056b4d4acab5eaf8f5b5cf2c568b1bcf -0117a2510602eb75bcd4a2dbc035a0fb +cb67a68604047b11312538d9a75423a1 87eae3bfbea127d8e90970cf3fe8a9a1 -6a3f53e106a9855477acf063ac72a81c +4cc9580e715a23e03ebd5d0d02f98ba1 2495aaa5b99df2676b6409c322d2d2ef dc3e7510d95a4e41c33aaea7347f7cf2 -a6e0277e377b1e3d616e6ee2dd878b1f +32ac2d68b9657dd18e2b73929e5b9821 c4ee7398d07dbb57e9caddca4813a666 -adee349ef6622b70a76756e80e2467c5 +600e610c0502f431e628d73363f10970 0221d29ac695e320aa365ec04ae2985c 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 0184a33f9c3389b35fcde8600ff95417 8ff0acf9aba961d05e0715ccbbf04736 dcae4e329492e2d99f0578f6e6c9397f -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec ee2fbf76bab8bb7fa64c3fb5c1f8da89 -333be837bd37efd00269ae5bcaf73d6e +5f7d5eb287f87b84a3b12b680a5b92be fb330418c81c08843a8ecc7b41911c3e -9bd2f1b9f94f34b489b4f604f75c9034 +28f31bee732a0bf5e12c489c08f70d28 f27d3b01a2b69930de1169490ac21d39 606ec4e8caaa77b3b8428f6d048ebdd8 -ad31feff80027308a7ae4f17a1b14aae +2185e7d1d2e0257c466077e8c32a91f9 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 84aa8a05ba6f4023339aa1fbb9a3eabc dd079ae8cedc46e35d279c27543a81be 7709eb325cb2fc85c78639890ebd925c c668be265797094334ea182a0824494b -a92ebb74af2774ebdfdcfe7e56109808 +d7618ef878fcc5fb51bd88137dd4373e cad19d84a46e0e9153e4a0fe0e6059a2 -4ce126e3a1d64bf191bcc3a693a4d1e8 -07b4c6a0da6bdda6961e9362edff649e +78d542183f7dc43cf0ad4febaba14e80 +76eb5e38af6ed0393868555475cf3a5f 9af8cb14d88c4c8e0c58571545917dc1 a3be14202734967e6859f61f03850e47 -7d479610d62b7c06e474a7cae6565d60 -e159504fce68ecac57037ae2393e5de0 -2a838e25d2bb6bdc96edc985f0a150c7 +1270f8bc9bdb3cbd36ae2768d919fb3d +ee59ec630478e670eab50fbd61477bff +c4315f3f31f39fd6f395deddfc2e7f65 b0061480473128d4e3faacce851d5b5b ee23c6c8670ec36d43be842613bf1516 986d6c4908854449bc9ac2b008e75a7f 83c16bd1d6727db3aaf2d25e72d37977 62f9203650557bc104780fcc7d9af944 f326d01ea1f9cb89d96aafdbf65dfcf7 -93ac5288276460d632069b043ee9b2f4 +a5bae1dd788536412dabc9981d316438 65cd279199c6ec5e320dedd7544c7a08 -a65b43dafa8181d31d7444209d4e76b6 -b31a45fe5b315405019d9abad5544128 +fd7c096315d8e230f821458516443589 +074c1fb786f0a605640392863724462a dee392760d4c24a3c7f6a9a218422148 4f3b5893f55d2462354b05f22afeeecc 74ca1c6583f0481aeafc21696c6df0b2 @@ -10589,67 +10583,63 @@ 449de434949a3e2b8780a87e7b179d3c 4e561adb5b30f6f32722022523612456 066cbbeeb72e13ce72244a35760d8e4f -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc 8670dccfd7a31fa4c44bc8fffd978739 -c294d42b0c532a0d0ed0ecd75b2da20f -725c0db804f21f04b78982da61ff2d7e -e9ab65cca74d0d1069c0bb6b50074d1a -5b5402436d2e5525c68fe96889c8628b -2ec28d7d8a03797203f724f8e5cdd8d3 +36d54cc80744708ba9ec226b550c8daf +b445026a015b310e55204739eab1d577 921ab7227ed3abcda2db9bf141411751 -14b937be198fc9c37d706a131f110c68 2172e11a30b062324fc2a90d1f6de9b2 34ea25003f05ded5624df898f2c1ac4b -3007373ed2951f690530327240c5f115 +7210212c531b08cb22055f395769fec4 -1f16414a30aa0a40379d1cf47ac9a6f4 +3dcd7f6ebcb8c13721d94494608c85cb dd301d88f6d45a5b41cc61fd0398013d 707db11ae318f0427fb4de517d7e73ec -42b67a1a0346b608e443e12f29b69e8d +37eecd1179765425b3c0ba7df71152db bbc2657930596c2b154f00988ddcaedb -b439730a1adbbf881e2fddf1e0c83748 +700cf29f7e2bf55c009cba529e1311d8 e88891dab9672d1abf2a93d6083e18b6 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 f979dd15c52b991d1b7f7bebaf1904a9 136b84df355623b8cde74d6e8f46a98d 2b9513da76017124bddcbe355cde8b1b -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec f207e426d375d1a5fd4be856861f2a1a -86348ea789ef1314a6e53a41b454f065 +6adea116192ac7731c26d0c24346db9d fb330418c81c08843a8ecc7b41911c3e -87ff59e320e9a3038f5a4a82bf3cd622 +42c308614d57e7929e8831e861aaeb46 a2efa498bb6ec2e917bc885ebe972a2d a53138e64ad08cc1eeccebf36b7ee960 -57556165ee5bc8d1536476cddaeda687 +8678b550fc3e1b54584cb1fb8526c765 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 17d68c416413db1e496ad110d8a68bd8 f2200cc41cb26e664754ccdad356e8b9 c3fb35dd0fefe93bbf0dfd8976709bb7 0f24e3f9b662529afcd2611dc32f47f7 -4a6daa4bad5d06c18e1375e326e5426d +28fcf85f29b6d66e69be37342b1ef2b9 97cdffb50afd0bd901cc9b4260e41f6c -3e2cfc1dbeef169bb2bec99537ba3acf -1c7dc815c1409f1801dda799e0c4b93e +c320e189357c0a45b74d8a25de90857a +5352cf064fa3607504409fe7cc84472a 3d9f9e874cfd7dc5eb4cb48ce2767545 ec324a67cb8145820e9ea896a36b29f9 -bd0bfc8b701484438eb51ca355c9e2b4 -cc7f2006caac14a1e4e2ae4cc0875814 -f1583dac9a5e2b71250de9a8b2e34377 +f721863a4725d02319ed4879dcf92263 +c614918642df8a8819e1dd7edd49ddce +f757a92ab1bb8a7d9212b9164923cd01 8536e6609b02d26a3181678fa36d9761 ba65eb70925e2e80ec40306484253483 eb7629f4b3e417ac96b46ea2457ff477 90d13efe717f8457b7851bba57dd5a44 4b0317bacbf44db749d81e899c0d0540 1bc2c11dc61564329b6e8db3603fe42d -9e6347a68f6318ed12e65da37c98183d +ec37bf3f902eb3662495668553f89272 0aa68b2277a2af4acfa5e470260c4e0d -351174de3584d284c0a2f111b1c096a8 -298b684f1124cb649afa6081ee5b31da +527222ce739124433f5aca935f030d18 +986e206bcc02718c3cd04e0095e62206 aa3dd95196d0ec83718e74c22d0a0da3 7b3cd67f5f1c421536def5926d137a9d ed7a4a7839b90c6a2abc4bda4006def1 @@ -10660,55 +10650,55 @@ 449de434949a3e2b8780a87e7b179d3c 14f0f8c0c9ce76174baabd31994fda59 a9b8e7319dc463d1e2bc9d41dd80f1d5 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc 9e65675700f44cd62f5ce4c4f3aa8226 -704c314279365af2f7c32e3c634ec423 +90dd88c8b1fafe1a2b93f36e8219ae9e 09e6a05a8cfe5f1533fe8144beb1d05b f423a14d136e03186e7f43e2df7c3744 -ca81d1f11cc2b18f78819d3856c0117a +4e5f5fa0ca8ec3a93d2061399c61e4e7 2a2912ece2fdf7a2e3c0c9ba78d3007d -50047740e8970baa3cfc5d3431f0f9ed +272250f7b5f5f117598b5ad29775034a 30f79908815a64fd943b8085d018e472 56abeea9ab436058834bac282558fd24 8fa599046396625428fddf3cccdc1bba fe22473d89990b28abe768719a9309d5 16fb90752c058fa355caed219a1db6f4 92f2d8f8299919cd0d2fe2ee8ddf6594 -3096e6efc0f60e8072255213788ecab9 +52c74036b772b36f3da5b0f30cfd4feb 7416a64dd5ed04c73228284cff4b6e0a -f41d6cc473a9edf9689bba196dffeaf3 +185a78a293a14d6ffc849d6f91b63fe8 df0c9e9884678ca5fd289648f5d4af47 -4d09328a05ef25857faec9b18cfe925f +36027a7c1df765c78f8e9c2018881bb7 d8880eb89d2c17dfd2040914d4b41bfe d99b7ed121c50b6b1cb0d9ccbc65bbc8 -1b70c21c20d31a6dfcbb39ab299afcfd +4ebdd338fd8d79e60c7dc7a455854647 f5f46d2641ac2af573c70801a388a5b3 c5ffae12b8dbf993f93b82f81e07b7dc 5cd42f6767cdb4b451fc4f8e297dda01 a593b69458210cb28c54e1d4b39ee75c 0314cfeae04a5fe2c53b979688e15fe2 dfb1bc2fafa4eef62911dae18a41f28c -212d48ba08bf3758cd311791838056bb +9d9a893113bfa52b0e1e4434ea304f71 ba79d520b3293c9582b0646a29cf18d1 -56e80512ad1d9bf5e1ea6baa776aa748 -b2a363d7ed5df1e955d8f5703db1ee9a +ee204960e7c9e9f251a6f9c14af0bcaa +54e94d0a2c6da3464fc52793dd31a74b a3ec4dfec292f3fd441f5e5d3010c20f c26a8142ff296d988cfe13332fb14bfc -ab305cce806b6aede7aacb7b0804fecb -d704c39224c814f121dbd4768d18660f -645fac5cb8fe7cb33064128459eafe54 +8181b7cc8039893c7db69f6e35adda51 +e7baf0389ce6728637443d9962e57b83 +99a72eb49507e17b6e1ac9a0239e9690 f7cc76455b53c9fb37c27554ed0967d0 55d24007a85eb0d6649e589f8b7c2a69 351d775a3d652783a5d015060c47a446 a5aff1132e18ab1546a154bcc75b3691 7ddff73aac78b8badf4bdba11cd541d2 7cbeff2cf852ffd059a2371bf23ec176 -d9c8363725cb3312dd3bcd8455939ece +695a5ee4a8341fd08dd10e8ee0c01237 b6600bbd673dc1a967e3d613935b691b -c867458a5c775c30db28c085c83c1af0 -cc7759c6e5d64dd12aa85dfd9d0ff480 +0569afd539a3d7f7b99511cd179cc185 +39bb4828de43b5f2a8155ce7395ffef7 116c07ff8a67e2cdc94c62376e4290aa da0fb653b20f60acb1b32e763c94ee84 8079141a1827f5d200d3df625684982d @@ -10719,55 +10709,55 @@ fab7ad4774c8821b32f59a87368821de ce461eba9060cfd90008040553ae19d8 c19f8ce8e5075509c5203a5344f42c37 -2f730e10e6ff1e342e722e985b54d863 +8e77915c4597f8f884195e93997644d3 338d9c56e6653c910dac441e3a519d25 -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -244ce95591c641e140899ecf82e3a091 +6134c80e606fc3eeedd5bf6a39c3e77a 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 33f2afb3d4f651ff3a4856891f26faa3 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -de30767cf0a5d454269ab9986fce13c0 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 74f49c52ba746096316a8fabfdd197cb f5c74ffcbb82b66d295e84cb0c11b477 6448daf1b06217c7dc989bed6f3709a2 fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -78faa2226aeb9f90e52c0f6239002838 -58c41f60235ea1a5fb3991bc4fa6a24b +34c7fde492170f80fe8e0e6434f3eb0b +bdb86969718f38f7c3ec9d78b8708f02 8cc192424d2a8a3a8439cf6c9e9c866d 228b0316d26bdd36e56a9158eea64ef6 59b195fcff4d3877045fee21c364d524 @@ -10777,55 +10767,55 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -4a55e4d7f22e7d44ef5aec63acdadfc6 +5311f11bfb6f48d45b579989963be072 cec5dc207fc9e4399548607def63b953 481d05b63d8ecea12b14c26156a6f286 -a89ac2972c17bd2c21b6e71f900bbefb +2c21e0cc9f70124dd60382c5849d9801 0117e9eb4ec62ae70cdc2cdb032ea4a3 -9c4a32938bb8475020d126dd27add3ea +b81b467bd411968fa82c2154930af428 41cb1b4912e7e63055cc42cd34501683 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 7ad74748bcdbfa3f6d5fade21ad3abaf c97628c3391c9fa7f0628260d579799b 32469a0fb52c4ff01ae369e67964bd6d -e1161971bb06488cabe9066c8e827741 +32d4ac2fc85cd81163d3e5a3877c2c8b e0ec416c7a5ab7c6ec37f1451273a21a -6df07d84b58a137e49213c42629dc6ca -fb330418c81c08843a8ecc7b41911c3e -23fa1196e7e0bf14078a6439fab7debb +d5a61aae8249911d500db5a7b88576fe +081fb0fd1b55ff714d4779e63e4bea77 +ff0350c1a83eb0d283c498b1b915b536 d9b279a5b8b4444c22234eff94697dcb 9a09d0e39657eaa250296b8b7e11a986 -64437501af41e6600d6817c47cc9bf59 +1fcfd5d89b406c6248a629712866e053 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 1a2f787c54fbe6b561fbd776a25872fc 3c474980a7bb1fd8a758009a01992640 b5ac41b2d7993ff82acb9a8358a17202 6177e3c17c2beae1066e42d26b0a921b -587567f577fe01bd0a203203b11e082a +c47b778b31bbc39ddc2c933ad2788575 312e64c5493d745c91c4bf83e3eb0b01 -c3666f4bf323f11ef7117f2952a0d6dd -260f5ff084bfd5c323b9d0cb01a37c18 +b4fa02045bdf797ca90cb154d0ec63fa +5f477631417f724965c004f9434cb18d 57160d6901b4fe33370e429c4cb06aac 04b5877b7648ce36557698aa48eab05e -053842730e380dfddffb45bf4684d34f -37b60d2d094535b36fbb865ba1b4d779 -8bee2c0a737282254675a9452c0d445e +ed7b0a314c45978c41f6c88b54c33268 +70d3b934c48d4fc82f2fe8487b88399e +430c59370c4a7ef39ccaa467e99629b8 27eaeadcf2739876f33c94d429c8a19c 1f2dfe32a45c0cc407b1e41483875c6d 889750973024b5b9ee80157128fdade9 48a054998227d1b323709fd33f76506b 0b2ff41b32ddac3abfdd5615b520392d 4a64102233f5cc6a326d74c738ed1333 -2a0e599244a9d226987f6316bd4470ed -b0056be7d136075c92352bb09ba6db76 -4f46917d26218717d682a103465dd0d4 -fcc762cbe281878d82d7fd73350d5d97 +1ff74927c61de2226faf161f47feaade +4f4e8ced4b1c098a97ac133e3cf16aba +8d499dee22c1b0aa3bcf3aab7b562264 +92d4b14e5af7fc2cd850f1fc26819501 a2176e70d49f029e4ef345e258cabcd2 1ec82f780ad10ccf1017f53ad0a982fb 9a2353991fa9c9eb24f8a542ac8bd396 @@ -10834,57 +10824,57 @@ 29b63a9f892720cd883ad2e1936fcc87 fcf9a22383bc602b4753feb9f2e09129 4468f3a8b5d7713027614c35c4edb4ba -c88f0b05f3446517570cd23270b79c9b -8dcd2c6de97e085c2f3129bbab2ad105 -dcda25012e278d3a5725e260f37fbeeb +ea657fdc5456475fabe2196f5599c26a +627f0cb9b40a5cad12eb3fc54055e34a +d4847efca6fc5676a965a94360258c7a ad72b32fa88b149015f6e9e0f8fd9411 -8fe8a1661fce90674ba71e87e478fb97 +fefdec042c8287c924f7d412433f0b12 59c457c3403be06b525dd7b8c427701b d68cfe7e1c70fc21a50eab0606fb7ea5 -51cb1664bd3521843659cb05fae8a51b +97dc3ecc0046aed1ad5edd25b6b54373 826484beb032b1d93a3741e5607c7070 -e404ca3a2e8446294b1e470e47d53004 +170a3447dec13b5255279d8f9cda7312 2ac1903fa962c3d3b928b911581cf300 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 644d4340e8a233b2490f8f399a60bb16 cbe4722c302b0de603f0a6786b191b85 36b265e2c6ae9a266426658b4646578d -3418d50e2adfabf40c3272735e88bb53 +8e5d65934184f09c60bab131b3eda509 11321835cdb2fefd6e81e49b46e3a283 -494d686e5feeb9726ed87d6d96dbe693 +8bb42b9d4a1756c1109ec7326c82c266 fb330418c81c08843a8ecc7b41911c3e -48d5fbbfba60dc8cf1d182fd728c9283 +4c1b10958aeb625192a7a6c28536e16d 75c36a756bdd4b4625cd7a68a6c9d496 17eae49005c9eb8ec8aacd15dcf38b6b -7bcfc21fdbb79da96f7374f381bae4f9 +8db87c99c9359f086f6bf5bd9eac9827 8fd7ce4aeaf2b3be11f39bf9b2be332b 28de826c00f8408c18c1060cacc44808 015eef4f2ab821df5c61bc738def628f 431b1b78a4a4fafd05d4e0bbc2c47263 5bb64010fefff4ea7f80e1ab6a6e0122 e6d541551ff358ea366fa5705aa03f33 -d6580ceeb4576c2ccb4f78a1a2ec77b8 +c1d953128756a7da01bd104b2d8cb906 553f742a0252568f24b9cc15e948f336 -7952397f4d6f94f800d8c6d06b4067e7 -25750dea41c887e9ea61faa23b1516cd +dca34b43d04a94d319bfa034c531af0f +4b48d7be1eea3640653b4b0dc5efe085 fc591b6dcf00663001336aeb2459e123 539a0357c179e6ed2094b7ca1ebbc344 -ad0d58fc24b771522ca045e1ac65f943 -93a0e71d518587e3bf856496319c775a -521b394ce8ec2f87ae79770ccf5dd58b +340bd8239ef9566f005c8085593e2279 +c0f772041db7e81650e2068587476450 +789184f4b4eac3dd80414fd933797b37 ec4d6fe04de1980f496e9caf6fabe534 0f18fd5af1f9ce788f5053e652842feb bb7be4d52dba41ff906024591864300e 4f3542ab71b20d7d28ae60817b2eb1d5 1d998745c1680fa335fed152b242cca5 a72a089766a7cf669f6b68270ce8f5ab -14aaefd3cb1b4bbfeafd6bef7c185285 +7f8461bf7298a4f3b95a478054c892f3 4146dd4f46253b59caf76dc6970cfb61 -879db84b3a960660b5c1dfb7338234c8 -cf9e4c942d0a11ae766c0fed96b23144 +cdab51cc365677bff479257c690307ef +97b2d586afd72ce6439462b10716bee2 4900f43900b2677888e3f7ec9a376c99 9c8629c3110dac7a00b21c554e869282 607e87ee590ab6b6e3c1f2017f310bb9 @@ -10895,55 +10885,55 @@ b6786821a9641b2e90eb60d1cf955593 29567ae731d5a20740dadb635820c0d7 83da48fa37c40e4f8c5ca323d585e7d9 -233e3c0da4808e32e5bff1b70a00caf7 +d310d10dc4d402c846a3dda26c1fda13 1be24d68eebff59f8a3d55d1d248cdfb -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e 9e04b2cd1b93f421705034d5206749d8 2cc2731ed536bf38737bfc2897163b4f -df410eccf21d001f9f5e65da30258122 +ff20e35d737a171fdebff3fffe219596 5d9b7ccd6766e9e943b206c4e288cea8 -3265e4dbbf3e0c99bce19777eb25094b +824ee00230cd20dd50324f22ad2344e8 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 8cd10e297876e0c2d47a576dfcf61a2b 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d4a0ea69d0b59441b8f0697456cc3140 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b a9abc615abd8dcb10635fb127bfd511b baf38b4ec10a43d12a333a1c2a28224f -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -7bc61a1f1daf334bc893dd1f0b05ca37 -844b39f8467ece7a7932e4bfee4bee76 +74e5138e0485400d0958b5c137a8634e +2b8eee0e36e32de0279eb6f59fd579c7 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -8986c14f9db4b7871a5f96050aff82ef -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +8dbb1e2f5a1ef86eff3672cc4c3cb786 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 1ca4e724a542dd90368a4612a878aa7a 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 68633b9a396403744b2f3e762bbf5a19 f326d01ea1f9cb89d96aafdbf65dfcf7 -21bad97ed84232f24a79e21f9f438961 +8df081e6094878f0535027338dfafa8d c57c2471c7a6eddd29d27909cc422e41 -3777bff94a23590b1939610196e43a32 -0015287d927b33b71d654076c2b0773b +d4f924be5a1d7312869b4fc769fbe907 +c621ae31c1038848045b5a54cdef80d1 8cc192424d2a8a3a8439cf6c9e9c866d d32aa2e1c7b5bd07001c90bc13dc7b50 6f225dc643f02ed2509b857ca08a1695 @@ -10954,28 +10944,28 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -6cc0c652a67b7a726760dcdc608db98b +a72601b36102fe74a5da294296ed25d6 a7a17bad11811e39b0164573964f3c18 3814711841ff79bfb1bffb653cfde0fb -ce04cd21ab1a71817562e3bfa4207f49 +a3b4d63e077d255c6cf6f57319b42cfa 40da93d7868af1bcee8c47d560dad545 -f7b95693315b045c22b7868e83fa419a +484822ce4f486e645146a1be6dfa1c5f d7a12190e2704590b4523ba5b60dd6b6 d85c3718dd925b2f2749a6293f5cb8a6 6173cfe37fe100bca15d634b617e43ba 3da2d86b46b9f04a99b688e4341d9750 3394594b3b0fd3566c00254fbb89dc74 407ba5abeaf3f08069464027cb52bbba -8c6845892177aee173dbaa73e8cd8ddd +7252bd36ac08f9518f548aa69d88fc86 c314672849f4fb6754bc916bceaa7103 -de693f4543cb9af1e5999b8486f4da41 +af10d52e58cccf9ef9ec405040b3bc9e baa8fc8768d82c06e62f9309cdcdd518 -34b072a62869a2440744c844b1883efe -861dd1133b381989d899332f484cc543 +c7097dc5f0c9eadc72216ef7ab8dfea9 +870fc47eaef3c3972adde5908d4b582a b80c70a4104afbcdddb55fea9a09f703 b2b79aa2d9b051ea649c131c5d7fc69c 1f454c455358e56662f3ddf5e1832a39 @@ -10984,25 +10974,25 @@ fc4ad53fd61f746fe581f447bf76d79e 70e166ce8c734b2c4b6215bef0875c3d 93350f7c0359f3cff6c242f2e5924e3c -21f823c2cd67de9d315e5db41c85aee0 -d62dc162efce8a950de403e522b4657b -e7e60217406bf671e98ae7124f69e8f4 -8fb6625d18bc2283bc2b745f7cfb47f4 +d33bcb7fbfa69a65c95e76933385907f +01f607491907d35587191c4fb9169462 +7c91aa49753eb42b22afa9cc2f91d373 +48e94c383945bbd1041cf1374ab56358 bcaf0ee7ee4ede4c0b11d33262e06913 4508eefc4cbf06183f780a47550b51fd -624f8ffd5c36af2b87a06aee63b17bb0 -88f572d21982792d5393ee999d2c443b -c283b0ba64ed9301e67a9d18923aed60 +421d8650975e65a657de36a0e89bd987 +c9976744983ca5b3a00062185293abaf +d30e629b77caad35ab1bad4a4930bc94 307d48fb06eea97b2818146fbb8929cf bee0636e455ad5d9a8dcc288ac2abb4c 9875bc160f395b95a197ffbb4ac22190 af0368dd00b10198d8770cabebd9e6ed 77def64e09174fe0ebc597e0e0f643da 7b075b656401153b43a2fe09321bcdf1 -d2e91c6a29e54a76ca5b983547d8850c +f8c7c74a5a1f14cb6bfe57e7703379f2 fe7b10789faa1e33034ed5bea8a9520d -73c05b103c926a9cd6f6d4adb14bc0e8 -a0ee07d48296bba0fbe1154d8bf4f292 +791a1575c6fe5bbc51995bd299771d5e +fec9ffcbf2d43061cc0f2cd71d41260a 2bac51be88c59c5ee21511836859e221 0889424a15f7ae4d5147e680d379e3c0 1da322fd765395f75d1bbd0857995779 @@ -11014,55 +11004,55 @@ becd3ff12eb9f1b6de5082ea51c5bf9b ba79a127979def278922a780ad5b1c5b 322469f3805d514f7b1d9c762d6cd232 -a519d93c30b602096b8eb9025f0a0441 +36627e0497fd8aaf39664403ae6daa96 af1f4c3b96562f5bf2f6a74c89f86c30 -301730ddc5a7a3b114fc6ad7ed7bbb4b +452a9821ef1ce8558bbd614701dae135 9e04b2cd1b93f421705034d5206749d8 6d53c83d0c2f41f894615f0efd6c8cc9 -dc118354cf69a5a9d83213658f3dcd93 +da34918d0b1a456b0f5804c7604bc6bc 7abcf80b038ed1d22f9a8025a6576eb7 -c2f264e2d0ffde1e9ffd64015d6882ee +d00f7b831a3a4ee6886a57307c445a55 7519e01ebfaf184e31451303d0fc5faa 83d51da6ce128a36cd2e5d2dbab76ce0 70ba2538054b4121e9e5869a5a611933 5091bcab97706bf0b5ad791622590c58 25ad1618cb45d3588c3e0f8e6944c4da 5048c5e51454ca4696b60c9602346380 -54e556dc87e7e004fc79a780d8a15b5f +c20ab41f5aa4a840ba470dfd3c1721e6 a87a5823097f9b179e9ca41f4df15ff5 -d198da62a38f45957224d91d0bb33871 +39bc7a0d47d973990f7cceaf54eebe9a 5220ad42964fc5e17e0737370f1b02cd -8994f5de93743791446f9e43ce29d16e +bd58aa4fd49df12490b2939804dc014d be9aaca861b2c4ec30707d2afc503f25 87204bb4bc4b2de9530578fce343498a -3e6bd2e8c70356bb4529f497588c3d95 +57a194e6fe07e08d93593ad2afd6222a 1898ba53941f49ece5a58b90fdac3ebd 74acfae0cf773d1140832af7e5667186 b8d00cecdd692f0b6cdbe4957f4ffcf3 95edb6168835f5a622cd7fb18fa665d3 a42be7db361dd5993f28868e4a3f358f 2e649b660a18eb203a07078ca6f0ddb0 -c63461bcd3764df8a686a5a17087c1b7 +f7a45f1637139cc5d99a4ae6e7d505e8 c590c3f7bd0bc1c8991c0b7f173d46cd -7bc61a1f1daf334bc893dd1f0b05ca37 -edce79cf3df5bc7d0df0017ec94811ed +bc42bdb14826011d606a142a4e116bc3 +fa802c1dfdd44a7ecb89c77d60838a9a 5b4959ed0c32ed6a409144c78c8b9fb4 54ce90907c5b76dfccd2b3ce0eb7bcbc -deb9e5e980af806b4cdb486e1f6dc295 -2789e50ea7509c174142c258d1165c88 -2a07790ed7e677fcc256d2460e5590f4 +8560f8e577caef690e5546fec123b76c +bf1988713292dc8e6133795d8fde1b0f +0c909a51481d661330ed83a8f0d6a5fa be52ecc505ea2cd13064e83f28eead68 1ca4e724a542dd90368a4612a878aa7a a114ac6eecd4701929fe3fd8f172dee5 e17132c2639ccf18dab581736d16ab19 a7af99484311ff510f4378fe059ed4b5 f326d01ea1f9cb89d96aafdbf65dfcf7 -b1a1a60d95cd68deeb4cb45550dc804c +55feaae249a847ccaa0432b7c84bb41b 45045a9eec7c672c032ec3f2697cf63c -c2e1993c06302b75188c19cbcc1f2f15 -1b352ca85acfb0a6ca7ec47574221626 +10c76b7bdf44361e8c5a37855d450a9c +387ae164057bda4a65b16b3d4da03026 0ad67108567f99662f7dabc9585331da 9e73e48da807bd19ea533c4e65a2e6c7 31b983b50ce8d8e45c4d311797756dce @@ -11073,16 +11063,17 @@ 1c69f14e9f4dfa446476883fe9faf925 369ab954165562248ee42ab33e6b12a0 2772e4b190f0ac3a3de994f9edf10074 -2db7fe18b1200b7eb75af0c44f79edbf +7538088f7af45b9a359a090b9bd18121 56d8a0b2df579f5cead684b83fdef191 -c294d42b0c532a0d0ed0ecd75b2da20f -02b4f98405e26fe54399ae5cf3d8e884 -dc9564fc481ddd3101734b4e01c40027 -5b5402436d2e5525c68fe96889c8628b -14b937be198fc9c37d706a131f110c68 -538ab10324a9a151d1944f94b590e3e2 +503179eef2a75e444e6ed540ab5816af +875e0a4fbf2f9e739dd18dd9787966a9 +28f44c26afebd0f551578f04045c6496 +6230437ad4adfb173f89c5c9b1cd3301 +b2ee3e61485fdeb685fc7f73bf802b23 +7d6b8f45303f24ad769fb402b9416bb5 +9ed2bf9282af9c376568885348569e87 eb0d31b8fe30bfb4b4a2cac24e104c61 @@ -11093,54 +11084,55 @@ e70e0c0be5993759f867484624b7270f -9f5ba8d00d619d312d40c07f38b35c6e +9f8505322412399b5acbf5ee73337eab +3fd084ee76aa52b4e20b601babbb11cb -001f89497d83b75fd374517b88d782ee +4e9739c5d4dd7d7150093400f77e392e c3e50ad0d4c93692a2810e136ada70d7 2cc2731ed536bf38737bfc2897163b4f -fd49f158c63c1e262131727166661df4 +d2920c2ffdac4cb2905142099ba74fe8 5d9b7ccd6766e9e943b206c4e288cea8 -e7cbb3f5347a6186501681bdbda58f9e +1f17d66cf1563e4c46196516bcc73b42 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 55b226d18eb7824edad5050c3090b348 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -d195ddd5ec7ed1f150a7ee113edc1a6a +249a59e20ad0f29165045c375cf123ca fb330418c81c08843a8ecc7b41911c3e -2b2a2539bf08025ea2794371cb5d5edf +0a95085c8a3f3efcd5a63702b1bf537b 89d74d9cd7885c8ceaba6f9a15ec3589 d976f528676688719bb4ed9da722c798 -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece 681bb6760c742ae699ed900dca34241d d91a412e4582686aee55e22120f10420 -081ddaf3beab038b809eb6db2957285e +7b331d712e358d5793e19167ab42d4b9 05a11b19b5162789760c9838a936df75 -eead927af63207df007d30bbefa0bb40 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 92ac14a3dd5307e6bc4429f625ac3f5b 07692372f9f22331da5ca1cc604206c4 f5c74ffcbb82b66d295e84cb0c11b477 4e186ea8084c33de3fec3182f57150ec fb5913e34a812d5fdf9e25b8ca8c9fb2 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 c57c2471c7a6eddd29d27909cc422e41 -87aea5e86e2ac2e10e0f98c23a552640 -ab667e6064cd5ecf206e86210ef81994 +33ac9fc2bc7ea230d394ac0b811677c7 +19e964a00e47d79e98eac8e4e3cfe3dd 8cc192424d2a8a3a8439cf6c9e9c866d 3122c8015a2583d254fbdead8e4fde52 c95d9dd5cdb6d9a6824a6bdbefb48531 @@ -11151,55 +11143,55 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 d7385726059a0035f5c91a2c1602f235 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc f1f34d8c0f864daa5e8ab56801027430 -f67efb48f1c66c4a32a71e6f70f49b7d +df295d90be1a982bfcf7cf01c641aa75 9e04b2cd1b93f421705034d5206749d8 2cc2731ed536bf38737bfc2897163b4f -ed09fddf882d9beadb8043fa20872c5b +4b408813ba07c4aaf7494a0dce45db2b 58d8a88c479e8ef6bfe376130f2d7fd7 -46100ab9de7bbd18588c7d8bff0b7eb2 +bf0bfe2c95f6532f0440971af8572697 545b1414d82cdd476e8d6676161e3103 83d51da6ce128a36cd2e5d2dbab76ce0 f2a97948d26385dbf048ef0cf2c525d7 d1a443d8f9c8f096368d1d3871ad69e2 044e22c98deb3d6da5898931cee7224c 599619a98b0411989a763faf1c6ede75 -e1161971bb06488cabe9066c8e827741 +9074eff322d7513a6589a181dfc089ec d255ea5b9df613deb7f8f85bc5c93241 -73cdaf1b551687a5a117792c1f128fcc +8b4845bccbb06c9c8d6870a50486ac45 fb330418c81c08843a8ecc7b41911c3e -4e48bd3662bd4f3d43cac92e7796d89c +8f385289997f3f192b47d00582f52c24 06b696eb0e3787682befe68fb70ea395 87204bb4bc4b2de9530578fce343498a -1ec6007e78b7fef3a0c46b285f5345f7 +f28c1d91837eecde379d863333ad3da7 1898ba53941f49ece5a58b90fdac3ebd 7353c73dcba6a3beb03620ccb68802b3 5568084ceebffcae386fc1ec48e7ffa8 17da2830504929531702d918d538bece a42be7db361dd5993f28868e4a3f358f 6debf0d0e4964cc8c9e574386a87e036 -6f5383381ed0ddbf7be82d2bd8e158d6 +3ccfaadb5ee1a1c4fe90a33682336ba6 05a11b19b5162789760c9838a936df75 -7bc61a1f1daf334bc893dd1f0b05ca37 -24076c897f856af4bf47d86d96078688 +74e5138e0485400d0958b5c137a8634e +ab80eb398c1cfa95b56a5b1dc2b7ce7d 5f93e31d32cd99d38e3d59c80b4137ff df979559da6c099664af3c61b83b9e14 -7ac550b131a480505f0160feb1984344 -22fe87d6626de9d7ef505f8997309e1a -4f231e473fa377b7f6cf6b3a778952ea +3b9488c55a6633217590c01acb9c0d8e +58ce4b88e87e271384435fc25c0f8144 +bb6a51f4eb6b3c8f00bfe1cdb89cd76a 5b4aa669a151dc30f4dba6f345177d91 1ca4e724a542dd90368a4612a878aa7a 07692372f9f22331da5ca1cc604206c4 589333633b6d1adbabfd86f078697ed1 309215b54637ec841c73ad9cb60c92c2 f326d01ea1f9cb89d96aafdbf65dfcf7 -3868fe6746505c0449f7ab2550a54795 +5c421382d1ed9e5e1f86f3bea1f29cc9 e0ba51b98a7560425f1296e931803c92 -fd5f5dbca99d9cd162b36d466d05397d -22a55c993f07ee610d137edab7539923 +8f91213f34f0244a5160d7e826d145c2 +c88e3c2e66b2d80b141a1e0bbc1e002b 3c262e53abae368513df941815512cac 3122c8015a2583d254fbdead8e4fde52 5b30fbe3329f2544372a731e50272392 @@ -11210,7 +11202,7 @@ 449de434949a3e2b8780a87e7b179d3c 3ecfa35141eae057f996daee3608c0c8 392d29d07b9eecdc15f88bbade3f4553 -98df0b16465e8526f1a34f0e24e1d25b +c04c20e9e0d8940e6a34a3de26975bfc 5e857db1c2b2f3c5b49fd68ef1fbad23 @@ -11229,7 +11221,7 @@ adf4d0f538de7decd6b3e4c5140c159a -5b06c4c900114c4ce894c39022aad38f +c8c27baf9e354f8b070f18500c4b9896 d41d8cd98f00b204e9800998ecf8427e @@ -11250,7 +11242,7 @@ d41d8cd98f00b204e9800998ecf8427e -5fbf322b32b161612161d4fdfcca5749 +6a9c570caec888fedf9faa0032a902a8 f30fdf4ab338c390c86e1617a5426e0f @@ -11260,7 +11252,7 @@ d41d8cd98f00b204e9800998ecf8427e -170e38a1cefb8b8ddb43d563dcf06f9f +aef2c07fde9b49868ac5cfeb890e3c3d d41d8cd98f00b204e9800998ecf8427e @@ -11889,7 +11881,7 @@ d41d8cd98f00b204e9800998ecf8427e -05f5994a4740a525f681f2da3778400e +4e96b9d5e319317867034cb5d44d7edf d41d8cd98f00b204e9800998ecf8427e @@ -12156,7 +12148,7 @@ d41d8cd98f00b204e9800998ecf8427e -6079976684703359a26c4544f46ea8c4 +1fbe45ac17223930f63f72b33108f3be d41d8cd98f00b204e9800998ecf8427e @@ -12430,7 +12422,7 @@ d41d8cd98f00b204e9800998ecf8427e -068fcbee3df8f8886aadbd76bdf937af +01232047a4537a7eca790bf2e64eac10 d41d8cd98f00b204e9800998ecf8427e @@ -12660,7 +12652,7 @@ d41d8cd98f00b204e9800998ecf8427e -0903d36e5451be75a51d379ad4d4fb9b +f2668d60b62d550468381be65ed1630d d41d8cd98f00b204e9800998ecf8427e @@ -12904,7 +12896,7 @@ d41d8cd98f00b204e9800998ecf8427e -0f5f369eab5868128d08085572f6a912 +454717ceabbc959f7902beb3903f011e d41d8cd98f00b204e9800998ecf8427e @@ -13231,13 +13223,13 @@ 11689e5722e4204b9d01e5e4483b92ef -7529966db8d111e5c265262581e19e1e +08938fc6d6d375cf72fb4a9e14b1f3c2 a20a84fb09238e216ab80d91674426b1 d41d8cd98f00b204e9800998ecf8427e -4b94e9ad89c520b4cc4ab986a1cfb5f8 -86af0ee60c4aae4f6efeef2a521a0039 +bc3aa842090496571e579929dbb67946 +20d05f87e3dcc4cc34783e807d53af33 70c0bcc71422c17305e134929089ed0a @@ -13245,7 +13237,7 @@ 353d0788a1b27e81a7c62446ca190de1 24ec433a2020143f3a634ff9bf695024 5e1aea18f899b4a763a0291dcf1f2b90 -b2c7012ed8f4226c6fda016a3ea1aff3 +3d9e24b7399dffbfbd97e4e63efb30b6 9dd4c109f77db954d5afcb20d5af9e4c @@ -13259,12 +13251,12 @@ 24b8f65ab4a24ff8241b8af469928f75 -e876e30d4e723313b9e22fc158a80117 +faee7623b7d24024c8f024cf8d523736 7770e9e8e3fb4b98bc149059c5bc9633 d41d8cd98f00b204e9800998ecf8427e -094b73de61eaad218343e1183fe4a67a +88b846ea65a9fba4dc31bbf408820f24 7b7cde9c324feeed6e94f50e1655ba40 @@ -13282,7 +13274,7 @@ 0b959ec99ed9ee63f065c7d40454b9ec -178dc806a0546aacf323c2bd61b0b6fd +f406b3b391eb6648f00807bbfd3ecaec d41d8cd98f00b204e9800998ecf8427e @@ -13325,7 +13317,7 @@ c8794336eba88e9ce0af56f8b5cded4d - + 7c7d00777d21ed95c127af574c6ec4dc 391071254a71e5fe29f6a22cbfc27543 diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index e5ad6f019a14e..0b60476373748 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -86,7 +86,7 @@ if (empty($dolibarr_main_db_port) && ($dolibarr_main_db_type=='mysqli' || $dolibarr_main_db_type=='mysql')) $dolibarr_main_db_port='3306'; // For backward compatibility // Clean parameters - $dolibarr_main_data_root =isset($dolibarr_main_data_root)?trim($dolibarr_main_data_root):''; + $dolibarr_main_data_root =isset($dolibarr_main_data_root)?trim($dolibarr_main_data_root):DOL_DOCUMENT_ROOT . '/../documents'; $dolibarr_main_url_root =isset($dolibarr_main_url_root)?trim($dolibarr_main_url_root):''; $dolibarr_main_url_root_alt =isset($dolibarr_main_url_root_alt)?trim($dolibarr_main_url_root_alt):''; $dolibarr_main_document_root =isset($dolibarr_main_document_root)?trim($dolibarr_main_document_root):''; @@ -133,7 +133,7 @@ define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:'')); define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir -define('DOL_DATA_ROOT',(isset($dolibarr_main_data_root)?$dolibarr_main_data_root:'')); +define('DOL_DATA_ROOT',(isset($dolibarr_main_data_root)?$dolibarr_main_data_root:DOL_DOCUMENT_ROOT . '/../documents')); define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root)?$dolibarr_main_url_root:'')); // URL relative root $uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* $suburi = strstr($uri, '/'); // $suburi contains url without domain @@ -376,13 +376,13 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='') print ''."\n"; if ($jQueryUiCustomPath) print ''."\n"; // JQuery - else print ''."\n"; // JQuery + else print ''."\n"; // JQuery print ''."\n"; if ($jQueryCustomPath) print ''."\n"; else print ''."\n"; if ($jQueryUiCustomPath) print ''."\n"; - else print ''."\n"; + else print ''."\n"; print ''.$langs->trans("DolibarrSetup").''."\n"; print ''."\n"; diff --git a/htdocs/install/mysql/data/llx_c_hrm_department.sql b/htdocs/install/mysql/data/llx_c_hrm_department.sql new file mode 100644 index 0000000000000..e6e4921f37273 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_department.sql @@ -0,0 +1,43 @@ +-- ============================================================================ +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); diff --git a/htdocs/install/mysql/data/llx_c_hrm_function.sql b/htdocs/install/mysql/data/llx_c_hrm_function.sql new file mode 100644 index 0000000000000..f8b56563689df --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_function.sql @@ -0,0 +1,34 @@ +-- ============================================================================ +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); diff --git a/htdocs/install/mysql/data/llx_c_typent.sql b/htdocs/install/mysql/data/llx_c_typent.sql index 918230cc5a3e8..11b512f26c214 100644 --- a/htdocs/install/mysql/data/llx_c_typent.sql +++ b/htdocs/install/mysql/data/llx_c_typent.sql @@ -31,6 +31,7 @@ -- delete from llx_c_typent; +-- Entries for all countries insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 0, 'TE_UNKNOWN', '-', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1); @@ -41,6 +42,7 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WH insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1); +-- Argentina (country 23) insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0); diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 13604638f01b9..95dfb2683f9a9 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -32,7 +32,7 @@ -- Visible in misc page insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_NOT_INSTALLED','1','chaine','Setup is running',1,0); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show: -1=stable+deprecated, 0=stable only (default), 1=stable+experimental, 2=stable+experimental+development',1,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAILING_LIMIT_SENDBYWEB','25','chaine','Number of targets to defined packet size when sending mass email',1,0); -- Hidden and common to all entities @@ -53,6 +53,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M -- IHM -- insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d8b6ce12ea4bb..dac62a2a4b8ad 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -20,6 +20,7 @@ INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_DELAY_EXPENSEREPORTS_TO_PAY')__,__ENCRYPT('31')__,'chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0); +INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0); ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32); @@ -55,3 +56,202 @@ ALTER TABLE llx_adherent ADD COLUMN pass_crypted varchar(128) after pass; ALTER TABLE llx_paiement ADD COLUMN ref varchar(30) NOT NULL AFTER rowid; ALTER TABLE llx_socpeople ADD COLUMN photo varchar(255) AFTER skype; + +ALTER TABLE llx_user_param MODIFY COLUMN value text NOT NULL; + +ALTER TABLE llx_expedition ADD COLUMN import_key varchar(14); +ALTER TABLE llx_expedition ADD COLUMN extraparams varchar(255); + +ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(128); +ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN code_banque varchar(128); +ALTER TABLE llx_prelevement_lignes MODIFY COLUMN code_banque varchar(128); +ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128); + +ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30); +ALTER TABLE llx_commande ADD COLUMN fk_warehouse integer DEFAULT NULL after fk_shipping_method; + +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750); + +ALTER TABLE llx_ecm_directories DROP INDEX idx_ecm_directories; +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories (label, fk_parent, entity); +--ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); + + +CREATE TABLE llx_ecm_files +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(64) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + filename varchar(255) NOT NULL, -- file name only without any directory + fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile. restricted to 750 because of unique key index on it. + fullpath_orig varchar(2048), -- full path of original filename, when file is uploaded from a local computer + description text, + keywords text, -- list of keywords, separated with comma + cover text, -- is this file a file to use for a cover + extraparams varchar(255), -- for stock other parameters with json format + date_c datetime, + date_m timestamp, + fk_user_c integer, + fk_user_m integer, + acl text -- for future permission 'per file' +) ENGINE=innodb; + +ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); +--ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); + + +ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; + + +ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1; + + +create table llx_stock_lotserial +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + fk_product integer NOT NULL, -- Id of product + batch varchar(30) DEFAULT NULL, -- Lot or serial number + eatby date DEFAULT NULL, -- Eatby date + sellby date DEFAULT NULL -- Sellby date +) ENGINE=innodb; + + + +CREATE TABLE IF NOT EXISTS llx_c_hrm_function +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + c_level tinyint DEFAULT 0 NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5, 'EXECBOARD', 'Executive board', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); + +CREATE TABLE IF NOT EXISTS llx_c_hrm_department +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); + +CREATE TABLE IF NOT EXISTS llx_establishment ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + name varchar(50), + address varchar(255), + zip varchar(25), + town varchar(50), + fk_state integer DEFAULT 0, + fk_country integer DEFAULT 0, + profid1 varchar(20), + profid2 varchar(20), + profid3 varchar(20), + phone varchar(20), + fk_user_author integer NOT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + status tinyint DEFAULT 1 +) ENGINE=InnoDB; + + +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL; +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL; + + +create table llx_stock_lotserial +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer, + fk_product integer NOT NULL, -- Id of product + batch varchar(30) DEFAULT NULL, -- Lot or serial number + eatby date DEFAULT NULL, -- Eatby date + sellby date DEFAULT NULL, -- Sellby date + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +) ENGINE=innodb; + + + +create table llx_budget +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + label varchar(255) NOT NULL, + status integer, + note text, + date_start date, + date_end date, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +)ENGINE=innodb; + + +create table llx_budget_lines +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_budget integer NOT NULL, + fk_project integer NOT NULL, + amount double(24,8) NOT NULL, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +)ENGINE=innodb; + +ALTER TABLE llx_budget_lines ADD UNIQUE INDEX uk_budget_lines (fk_budget, fk_project); + +-- Supprime orphelins pour permettre montee de la cle +-- MYSQL V4 DELETE llx_budget_lines FROM llx_budget_lines LEFT JOIN llx_budget ON llx_budget.rowid = llx_budget_lines.fk_budget WHERE llx_budget_lines.rowid IS NULL; +-- POSTGRESQL V8 DELETE FROM llx_budget_lines USING llx_budget WHERE llx_budget_lines.fk_budget NOT IN (SELECT llx_budget.rowid FROM llx_budget); + +ALTER TABLE llx_budget_lines ADD INDEX idx_budget_lines (fk_projet); +ALTER TABLE llx_budget_lines ADD CONSTRAINT fk_budget_lines_budget FOREIGN KEY (fk_budget) REFERENCES llx_budget (rowid); + + + +ALTER TABLE llx_c_typent ADD COLUMN position integer NOT NULL DEFAULT 0; +ALTER TABLE llx_c_forme_juridique ADD COLUMN position integer NOT NULL DEFAULT 0; +ALTER TABLE llx_c_type_fees ADD COLUMN position integer NOT NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql index 484cd39fb824f..7632b1fd810da 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql @@ -16,8 +16,8 @@ -- along with this program. If not, see . -- -- ============================================================================ --- Table used for relations between elements of different types: --- invoice-propal, propal-order, etc... +-- Table used for relations between an action event and a resource (in most cases +-- a 'user', but can also be a 'resource' like a room, or a hardware) -- ============================================================================ create table llx_actioncomm_resources diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql index 934949e7a667d..6bbae80a784a9 100644 --- a/htdocs/install/mysql/tables/llx_bank_account.sql +++ b/htdocs/install/mysql/tables/llx_bank_account.sql @@ -33,7 +33,7 @@ create table llx_bank_account fk_user_author integer, fk_user_modif integer, bank varchar(60), - code_banque varchar(8), + code_banque varchar(128), code_guichet varchar(6), number varchar(255), cle_rib varchar(5), diff --git a/htdocs/install/mysql/tables/llx_budget.sql b/htdocs/install/mysql/tables/llx_budget.sql new file mode 100644 index 0000000000000..aeb60cd1ce563 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_budget.sql @@ -0,0 +1,33 @@ +-- ============================================================================ +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =========================================================================== + +create table llx_budget +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + label varchar(255) NOT NULL, + status integer, + note text, + date_start date, + date_end date, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_budget_lines.key.sql b/htdocs/install/mysql/tables/llx_budget_lines.key.sql new file mode 100644 index 0000000000000..9a9771570b1a2 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_budget_lines.key.sql @@ -0,0 +1,27 @@ +-- =================================================================== +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_budget_lines ADD UNIQUE INDEX uk_budget_lines (fk_budget, fk_project); + +-- Supprime orphelins pour permettre montee de la cle +-- MYSQL V4 DELETE llx_budget_lines FROM llx_budget_lines LEFT JOIN llx_budget ON llx_budget.rowid = llx_budget_lines.fk_budget WHERE llx_budget_lines.rowid IS NULL; +-- POSTGRESQL V8 DELETE FROM llx_budget_lines USING llx_budget WHERE llx_budget_lines.fk_budget NOT IN (SELECT llx_budget.rowid FROM llx_budget); + +ALTER TABLE llx_budget_lines ADD INDEX idx_budget_lines (fk_project); +ALTER TABLE llx_budget_lines ADD CONSTRAINT fk_budget_lines_budget FOREIGN KEY (fk_budget) REFERENCES llx_budget (rowid); diff --git a/htdocs/install/mysql/tables/llx_budget_lines.sql b/htdocs/install/mysql/tables/llx_budget_lines.sql new file mode 100644 index 0000000000000..c5d3d3a4bf28f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_budget_lines.sql @@ -0,0 +1,30 @@ +-- ============================================================================ +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =========================================================================== + +create table llx_budget_lines +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_budget integer NOT NULL, + fk_project integer NOT NULL, + amount double(24,8) NOT NULL, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_forme_juridique.sql b/htdocs/install/mysql/tables/llx_c_forme_juridique.sql index 0087f3710925e..ea8b45bf2d7ca 100644 --- a/htdocs/install/mysql/tables/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/tables/llx_c_forme_juridique.sql @@ -25,6 +25,7 @@ create table llx_c_forme_juridique libelle varchar(255), isvatexempted tinyint DEFAULT 0 NOT NULL, active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL + module varchar(32) NULL, + position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_department.sql b/htdocs/install/mysql/tables/llx_c_hrm_department.sql new file mode 100644 index 0000000000000..f9432d8b821d5 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_department.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +create table llx_c_hrm_department +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_c_hrm_function.sql b/htdocs/install/mysql/tables/llx_c_hrm_function.sql new file mode 100644 index 0000000000000..f3f87461866d9 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_function.sql @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +create table llx_c_hrm_function +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + c_level tinyint DEFAULT 0 NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_c_type_fees.sql b/htdocs/install/mysql/tables/llx_c_type_fees.sql index e980562aff220..80bb3d9109d6b 100644 --- a/htdocs/install/mysql/tables/llx_c_type_fees.sql +++ b/htdocs/install/mysql/tables/llx_c_type_fees.sql @@ -25,5 +25,6 @@ create table llx_c_type_fees label varchar(30), accountancy_code varchar(32) NULL, active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL + module varchar(32) NULL, + position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index 06a41727b699b..d492c41ff1368 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -24,5 +24,6 @@ create table llx_c_typent libelle varchar(30), fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL + module varchar(32) NULL, + position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 3511aa7ec78e1..553b2facad7c4 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -63,6 +63,7 @@ create table llx_commande date_livraison date default NULL, fk_shipping_method integer, -- shipping method id + fk_warehouse integer default NULL, fk_availability integer NULL, fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined fk_delivery_address integer, -- delivery address (deprecated) diff --git a/htdocs/install/mysql/tables/llx_contrat.sql b/htdocs/install/mysql/tables/llx_contrat.sql index 73e29e8bdd47d..f229f020bf647 100644 --- a/htdocs/install/mysql/tables/llx_contrat.sql +++ b/htdocs/install/mysql/tables/llx_contrat.sql @@ -22,7 +22,8 @@ create table llx_contrat ( rowid integer AUTO_INCREMENT PRIMARY KEY, ref varchar(30), -- contrat reference - ref_supplier varchar(30), -- suplier contract ref + ref_customer varchar(30), -- customer contract ref + ref_supplier varchar(30), -- supplier contract ref ref_ext varchar(30), -- external contract ref entity integer DEFAULT 1 NOT NULL, -- multi company id tms timestamp, @@ -44,6 +45,5 @@ create table llx_contrat model_pdf varchar(255), import_key varchar(14), extraparams varchar(255) - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql index 2da97ec974fe5..2e96a5f8e958b 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql @@ -18,7 +18,8 @@ -- ============================================================================ -ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX idx_ecm_directories (label, fk_parent, entity); +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories (label, fk_parent, entity); +--ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); Disabled, mysql limits size of index ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_c (fk_user_c); ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_m (fk_user_m); diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.sql b/htdocs/install/mysql/tables/llx_ecm_directories.sql index d214737ff08d0..518fdd4c9e1cd 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.sql @@ -17,9 +17,9 @@ -- -- =================================================================== --- drop table llx_ecm_directories; +-- DROP TABLE llx_ecm_directories; -create table llx_ecm_directories +CREATE TABLE llx_ecm_directories ( rowid integer AUTO_INCREMENT PRIMARY KEY, label varchar(64) NOT NULL, @@ -27,12 +27,11 @@ create table llx_ecm_directories fk_parent integer, description varchar(255) NOT NULL, cachenbofdoc integer NOT NULL DEFAULT 0, - fullpath varchar(255), + fullpath varchar(750), extraparams varchar(255), -- for stock other parameters with json format date_c datetime, date_m timestamp, fk_user_c integer, fk_user_m integer, acl text - ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_ecm_files.key.sql b/htdocs/install/mysql/tables/llx_ecm_files.key.sql new file mode 100644 index 0000000000000..9b1f4fcf16402 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_ecm_files.key.sql @@ -0,0 +1,21 @@ +-- ============================================================================ +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ + + +ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); +--ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); Disabled, mysql limits size of index diff --git a/htdocs/install/mysql/tables/llx_ecm_files.sql b/htdocs/install/mysql/tables/llx_ecm_files.sql new file mode 100644 index 0000000000000..e984c7c909896 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_ecm_files.sql @@ -0,0 +1,36 @@ +-- =================================================================== +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +CREATE TABLE llx_ecm_files +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(64) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + filename varchar(255) NOT NULL, -- file name only without any directory + fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile + fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer + description text, + keywords text, -- list of keywords, separated with comma + cover text, -- is this file a file to use for a cover + extraparams varchar(255), -- for stock other parameters with json format + date_c datetime, + date_m timestamp, + fk_user_c integer, + fk_user_m integer, + acl text -- for future permission 'per file' +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql new file mode 100644 index 0000000000000..8ddc71e1fba9d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -0,0 +1,41 @@ +-- ============================================================================ +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ +-- +-- Structure de la table llx_establishment +-- + +CREATE TABLE IF NOT EXISTS llx_establishment ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + name varchar(50), + address varchar(255), + zip varchar(25), + town varchar(50), + fk_state integer DEFAULT 0, + fk_country integer DEFAULT 0, + profid1 varchar(20), + profid2 varchar(20), + profid3 varchar(20), + phone varchar(20), + fk_user_author integer NOT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + status tinyint DEFAULT 1 +) ENGINE=InnoDB; + diff --git a/htdocs/install/mysql/tables/llx_expedition.sql b/htdocs/install/mysql/tables/llx_expedition.sql index d142a5cc628cf..8421bb1649cf0 100644 --- a/htdocs/install/mysql/tables/llx_expedition.sql +++ b/htdocs/install/mysql/tables/llx_expedition.sql @@ -52,6 +52,8 @@ create table llx_expedition note_public text, model_pdf varchar(255), fk_incoterms integer, -- for incoterms - location_incoterms varchar(255) -- for incoterms + location_incoterms varchar(255), -- for incoterms + import_key varchar(14), + extraparams varchar(255) -- for other parameters with json format )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql index 2a0c9b84ea594..3bdc0e2ed81e5 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql @@ -28,7 +28,7 @@ create table llx_prelevement_facture_demande fk_prelevement_bons integer, fk_user_demande integer NOT NULL, - code_banque varchar(7), + code_banque varchar(128), code_guichet varchar(6), number varchar(255), cle_rib varchar(5) diff --git a/htdocs/install/mysql/tables/llx_prelevement_lignes.sql b/htdocs/install/mysql/tables/llx_prelevement_lignes.sql index a95499a321f33..04b6e1ebf5eb1 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_lignes.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_lignes.sql @@ -25,7 +25,7 @@ create table llx_prelevement_lignes client_nom varchar(255), amount real DEFAULT 0, - code_banque varchar(7), + code_banque varchar(128), code_guichet varchar(6), number varchar(255), cle_rib varchar(5), diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 22006040327e9..42832a6b227ca 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -52,6 +52,7 @@ create table llx_product fk_user_modif integer, -- user making last change tosell tinyint DEFAULT 1, -- Product you sell tobuy tinyint DEFAULT 1, -- Product you buy + onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it on portal (module website must be on) tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch or eat-by management fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) duration varchar(6), diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 6c34440a58b21..3ca161ed07d3c 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -26,5 +26,7 @@ create table llx_projet_task_time task_duration double, fk_user integer, thm double(24,8), + invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here + invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here note text )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql index 3331da246967a..e8f995130d4cb 100644 --- a/htdocs/install/mysql/tables/llx_societe_rib.sql +++ b/htdocs/install/mysql/tables/llx_societe_rib.sql @@ -27,7 +27,7 @@ create table llx_societe_rib tms timestamp, label varchar(30), bank varchar(255), -- bank name - code_banque varchar(7), -- bank code + code_banque varchar(128), -- bank code code_guichet varchar(6), -- desk code number varchar(255), -- account number cle_rib varchar(5), -- key of bank account diff --git a/htdocs/install/mysql/tables/llx_stock_lotserial.sql b/htdocs/install/mysql/tables/llx_stock_lotserial.sql new file mode 100644 index 0000000000000..ed8a14e49d0b4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_stock_lotserial.sql @@ -0,0 +1,34 @@ +-- ============================================================================ +-- Copyright (C) 2015 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- This table may be used to store eatby and sellby date for a couple +-- product-batch number. +-- ============================================================================ + +create table llx_stock_lotserial +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer, + fk_product integer NOT NULL, -- Id of product + batch varchar(30) DEFAULT NULL, -- Lot or serial number + eatby date DEFAULT NULL, -- Eatby date + sellby date DEFAULT NULL, -- Sellby date + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index a11b0ec6b5076..e1fc421c91179 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -25,6 +25,8 @@ create table llx_user ref_ext varchar(50), -- reference into an external system (not used by dolibarr) ref_int varchar(50), -- reference into an internal system (deprecated) + + employee tinyint DEFAULT 1, -- 1 if user is an employee datec datetime, tms timestamp, diff --git a/htdocs/install/mysql/tables/llx_user_param.sql b/htdocs/install/mysql/tables/llx_user_param.sql index dbf13610a5b1d..7194d73b4c47e 100644 --- a/htdocs/install/mysql/tables/llx_user_param.sql +++ b/htdocs/install/mysql/tables/llx_user_param.sql @@ -23,7 +23,7 @@ create table llx_user_param fk_user integer NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id param varchar(64) NOT NULL, - value varchar(255) NOT NULL + value text NOT NULL )ENGINE=innodb; -- diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e06553afd890d..a4b7423ebe871 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -285,14 +285,16 @@ ModuleSetup=Module setup ModulesSetup=Modules setup ModuleFamilyBase=System ModuleFamilyCrm=Customer Relation Management (CRM) -ModuleFamilyProducts=Products Management -ModuleFamilyHr=Human Resource Management +ModuleFamilyProducts=Products Management (PM) +ModuleFamilyHr=Human Resource Management (HR) ModuleFamilyProjects=Projects/Collaborative work ModuleFamilyOther=Other ModuleFamilyTechnic=Multi-modules tools ModuleFamilyExperimental=Experimental modules ModuleFamilyFinancial=Financial Modules (Accounting/Treasury) ModuleFamilyECM=Electronic Content Management (ECM) +ModuleFamilyPortal=Web sites and other frontal application +ModuleFamilyInterface=Interfaces with external systems MenuHandlers=Menu handlers MenuAdmin=Menu editor DoNotUseInProduction=Do not use in production @@ -354,7 +356,7 @@ ThemeDir=Skins directory ConnectionTimeout=Connexion timeout ResponseTimeout=Response timeout SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__ -ModuleMustBeEnabledFirst=Module %s must be enabled first before using this feature. +ModuleMustBeEnabledFirst=Module %s must be enabled first if you need this feature. SecurityToken=Key to secure URLs NoSmsEngine=No SMS sender manager available. SMS sender manager are not installed with default distribution (because they depends on an external supplier) but you can find some on %s PDF=PDF @@ -396,6 +398,7 @@ ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value

    fo ExtrafieldParamHelpradio=Parameters list have to be like key,value

    for example :
    1,value1
    2,value2
    3,value3
    ... ExtrafieldParamHelpsellist=Parameters list comes from a table
    Syntax : table_name:label_field:id_field::filter
    Example : c_typent:libelle:id::filter

    filter can be a simple test (eg active=1) to display only active value
    if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another :
    c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpchkbxlst=Parameters list comes from a table
    Syntax : table_name:label_field:id_field::filter
    Example : c_typent:libelle:id::filter

    filter can be a simple test (eg active=1) to display only active value
    if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another :
    c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
    Syntax : ObjectName:Classpath
    Example : Societe:societe/class/societe.class.php LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.
    To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
    1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)
    2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)
    3 : local tax apply on products without vat (localtax is calculated on amount without tax)
    4 : local tax apply on products including vat (localtax is calculated on amount + main vat)
    5 : local tax apply on services without vat (localtax is calculated on amount without tax)
    6 : local tax apply on services including vat (localtax is calculated on amount + tax) @@ -524,12 +527,12 @@ Module2400Name=Agenda Module2400Desc=Events/tasks and agenda management Module2500Name=Electronic Content Management Module2500Desc=Save and share documents -Module2600Name=API services (Web services SOAP) +Module2600Name=API/Web services (SOAP server) Module2600Desc=Enable the Dolibarr SOAP server providing API services -Module2610Name=API services (Web services REST) +Module2610Name=API/Web services (REST server) Module2610Desc=Enable the Dolibarr REST server providing API services -Module2650Name=WebServices (client) -Module2650Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Supplier orders supported only for the moment) +Module2660Name=Call WebServices (SOAP client) +Module2660Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Supplier orders supported only for the moment) Module2700Name=Gravatar Module2700Desc=Use online Gravatar service (www.gravatar.com) to show photo of users/members (found with their emails). Need an internet access Module2800Desc=FTP Client @@ -537,6 +540,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=GeoIP Maxmind conversions capabilities Module3100Name=Skype Module3100Desc=Add a Skype button into card of adherents / third parties / contacts +Module4000Name=HRM +Module4000Desc=Human resources management Module5000Name=Multi-company Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow @@ -802,7 +807,7 @@ Permission59003=Read every user margin DictionaryCompanyType=Thirdparties type DictionaryCompanyJuridicalType=Juridical kinds of thirdparties DictionaryProspectLevel=Prospect potential level -DictionaryCanton=State/Cantons +DictionaryCanton=State/Province DictionaryRegion=Regions DictionaryCountry=Countries DictionaryCurrency=Currencies @@ -931,7 +936,8 @@ DefaultMenuSmartphoneManager=Smartphone menu manager Skin=Skin theme DefaultSkin=Default skin theme MaxSizeList=Max length for list -DefaultMaxSizeList=Default max length for list +DefaultMaxSizeList=Default max length for lists +DefaultMaxSizeShortList=Default max length for short lists (ie in customer card) MessageOfDay=Message of the day MessageLogin=Login page message PermanentLeftSearchForm=Permanent search form on left menu @@ -1001,6 +1007,7 @@ SystemAreaForAdminOnly=This area is available for administrator users only. None CompanyFundationDesc=Edit on this page all known information of the company or foundation you need to manage (For this, click on "Modify" button at bottom of page) DisplayDesc=You can choose each parameter related to the Dolibarr look and feel here AvailableModules=Available modules +DeprecatedModules=Deprecated modules ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). SessionTimeOut=Time out for session SessionExplanation=This number guarantee that session will never expire before this delay, if the session cleaner is done by Internal PHP session cleaner (and nothing else). Internal PHP session cleaner does not guaranty that session will expire just after this delay. It will expire, after this delay, and when the session cleaner is ran, so every %s/%s access, but only during access made by other sessions.
    Note: on some servers with an external session cleaning mechanism (cron under debian, ubuntu ...), the sessions can be destroyed after a period defined by the default session.gc_maxlifetime, no matter what the value entered here. @@ -1119,6 +1126,8 @@ EncryptedPasswordInDatabase=To allow the encryption of the passwords in the data DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page UsersSetup=Users module setup UserMailRequired=EMail required to create a new user +##### HRM setup ##### +HRMSetup=HRM module setup ##### Company setup ##### CompanySetup=Companies module setup CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier) @@ -1200,6 +1209,7 @@ AskPriceSupplierPDFModules=Price requests suppliers documents models FreeLegalTextOnAskPriceSupplier=Free text on price requests suppliers WatermarkOnDraftAskPriceSupplier=Watermark on draft price requests suppliers (none if empty) BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER=Ask for bank account destination of price request +WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order ##### Orders ##### OrdersSetup=Order management setup OrdersNumberingModules=Orders numbering models @@ -1522,6 +1532,7 @@ DeleteMenu=Delete menu entry ConfirmDeleteMenu=Are you sure you want to delete menu entry %s ? DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line ? +FailedToInitializeMenu=Failed to initialize menu ##### Tax ##### TaxSetup=Taxes, social or fiscal taxes and dividends module setup OptionVatMode=VAT due @@ -1552,7 +1563,9 @@ AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filt AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda ##### ClickToDial ##### -ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialDesc=This module allows to make phone numbers clickable. A click on this icon will call make your phone to call the phone number. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialUseTelLink=Use just a link "tel:" on phone numbers +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or an interface install on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution, you must set this to "No" and fill next field. ##### Point Of Sales (CashDesk) ##### CashDesk=Point of sales CashDeskSetup=Point of sales module setup @@ -1615,7 +1628,7 @@ TaskModelModule=Tasks reports document model UseSearchToSelectProject=Use autocompletion fields to choose project (instead of using a list box) ##### ECM (GED) ##### ECMSetup = GED Setup -ECMAutoTree = Automatic tree folder and document +ECMAutoTree = Show also the automatic tree folder and document ##### Fiscal Year ##### FiscalYears=Fiscal years FiscalYear=Fiscal year @@ -1689,3 +1702,9 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier MailToSendSupplierOrder=To send supplier order MailToSendSupplierInvoice=To send supplier invoice MailToThirdparty=To send email from thirdparty page +ByDefaultInList=Show by default on list view +YouUseLastStableVersion=You use the last stable version +TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) +TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites) +ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes. +ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so it contains only fixes of bugs. We recommend everybody using an older version to upgrade to this one. As any maintenance release, no new features, nor data structure change is present into this version. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes. diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 7ea9f32830ddb..8ff109b2b09bf 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -216,8 +216,8 @@ DateEcheance=Due date limit DateInvoice=Invoice date NoInvoice=No invoice ClassifyBill=Classify invoice -SupplierBillsToPay=Suppliers invoices to pay -CustomerBillsUnpaid=Unpaid customers invoices +SupplierBillsToPay=Unpaid supplier invoices +CustomerBillsUnpaid=Unpaid customer invoices NonPercuRecuperable=Non-recoverable SetConditions=Set payment terms SetMode=Set payment mode @@ -351,7 +351,7 @@ ExtraInfos=Extra infos RegulatedOn=Regulated on ChequeNumber=Check N° ChequeOrTransferNumber=Check/Transfer N° -ChequeMaker=Check transmitter +ChequeMaker=Check/Transfer transmitter ChequeBank=Bank of Check CheckBank=Check NetToBePaid=Net to be paid diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index b61cf77019f18..634b058f6d40f 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -58,7 +58,7 @@ BoxLastExpiredServices=Last %s oldest contacts with active expired services BoxTitleLastActionsToDo=Last %s actions to do BoxTitleLastContracts=Last %s contracts BoxTitleLastModifiedDonations=Last %s modified donations -BoxTitleLastModifiedExpenses=Last %s modified expenses +BoxTitleLastModifiedExpenses=Last %s modified expense reports BoxGlobalActivity=Global activity (invoices, proposals, orders) FailedToRefreshDataInfoNotUpToDate=Failed to refresh RSS flux. Last successfull refresh date: %s LastRefreshDate=Last refresh date diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 3bd16069036d7..3e93a48d7b582 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -64,6 +64,7 @@ UserTitle=Title Surname=Surname/Pseudo Address=Address State=State/Province +StateShort=State Region=Region Country=Country CountryCode=Country code @@ -109,7 +110,7 @@ ProfId2Short=Prof. id 2 ProfId3Short=Prof. id 3 ProfId4Short=Prof. id 4 ProfId5Short=Prof. id 5 -ProfId6Short=Prof. id 5 +ProfId6Short=Prof. id 6 ProfId1=Professional ID 1 ProfId2=Professional ID 2 ProfId3=Professional ID 3 @@ -284,6 +285,8 @@ PersonalInformations=Personal data AccountancyCode=Accountancy code CustomerCode=Customer code SupplierCode=Supplier code +CustomerCodeShort=Customer code +SupplierCodeShort=Supplier code CustomerAccount=Customer account SupplierAccount=Supplier account CustomerCodeDesc=Customer code, unique for all customers @@ -302,7 +305,7 @@ ListOfCustomersContacts=List of customer contacts ListOfSuppliersContacts=List of supplier contacts ListOfCompanies=List of companies ListOfThirdParties=List of third parties -ShowCompany=Show company +ShowCompany=Show thirdparty ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index ad8858a425504..20c0a144121cd 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -99,6 +99,8 @@ TotalToPay=Total to pay TotalVATReceived=Total VAT received CustomerAccountancyCode=Customer accountancy code SupplierAccountancyCode=Supplier accountancy code +CustomerAccountancyCodeShort=Cust. account. code +SupplierAccountancyCodeShort=Sup. account. code AccountNumberShort=Account number AccountNumber=Account number NewAccount=New account diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang new file mode 100644 index 0000000000000..b2e9387d62fba --- /dev/null +++ b/htdocs/langs/en_US/hrm.lang @@ -0,0 +1,14 @@ +# Dolibarr language file - en_US - hrm +CHARSET=UTF-8 + +Establishments=Establishments +Establishment=Establishment +NewEstablishment=New establishment +DeleteEstablishment=Delete establishment +ConfirmDeleteEstablishment=Are-you sure to delete this establishment ? +OpenEtablishment=Open establishment +CloseEtablishment=Close establishment +ListOfEmployees=List of employees +Employees=Employees +Employee=Employee +NewEmployee=New employee diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0bd4fa7431b5d..4837a966394a1 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -97,6 +97,7 @@ DolibarrHasDetectedError=Dolibarr has detected a technical error InformationToHelpDiagnose=This is information that can help diagnostic MoreInformation=More information TechnicalInformation=Technical information +TechnicalID=Technical ID NotePublic=Note (public) NotePrivate=Note (private) PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to %s decimals. @@ -228,6 +229,7 @@ DateAndHour=Date and hour DateStart=Date start DateEnd=Date end DateCreation=Creation date +DateCreationShort=Creat. date DateModification=Modification date DateModificationShort=Modif. date DateLastModification=Last modification date @@ -384,6 +386,7 @@ NActions=%s events NActionsLate=%s late RequestAlreadyDone=Request already recorded Filter=Filter +FilterOnInto=Search criteria '%s' into fields %s RemoveFilter=Remove filter ChartGenerated=Chart generated ChartNotGenerated=Chart not generated @@ -574,6 +577,7 @@ SendByMail=Send by EMail MailSentBy=Email sent by TextUsedInTheMessageBody=Email body SendAcknowledgementByMail=Send Ack. by email +EMail=E-mail NoEMail=No email NoMobilePhone=No mobile phone Owner=Owner @@ -748,4 +752,17 @@ ShortSaturday=S ShortSunday=S SelectMailModel=Select email template SetRef=Set ref -SearchIntoProject=Search %s into projects \ No newline at end of file +SearchIntoThirdparties=Thirdparties +SearchIntoContacts=Contacts +SearchIntoMembers=Members +SearchIntoUsers=Users +SearchIntoProductsOrServices=Products or services +SearchIntoProjects=Projects +SearchIntoCustomerInvoices=Customer invoices +SearchIntoSupplierInvoices=Supplier invoices +SearchIntoCustomerOrders=Customer orders +SearchIntoSupplierOrders=Supplier orders +SearchIntoCustomerProposals=Customer proposals +SearchIntoSupplierProposals=Supplier proposals +SearchIntoInterventions=Interventions +SearchIntoContracts=Contracts diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index eeaace7352364..eb77ca9fe4c2b 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -36,7 +36,7 @@ MargeNette=Net margin MargeType1=Margin on Best supplier price MargeType2=Margin on Weighted Average Price (WAP) MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price
    Net margin : Selling price - Cost price -MarginTypeDesc=Margin on best buying price : Selling price - Best supplier price defined on product card
    Margin on Weighted Average Price (WAP) : Selling price - Product Weighted Average Price +MarginTypeDesc=Margin on best buying price : Selling price - Best supplier price defined on product card
    Margin on Weighted Average Price (WAP) : Selling price - Product Weighted Average Price (WAP) or best supplier price if WAP not yet defined CostPrice=Cost price BuyingCost=Cost price UnitCharges=Unit charges diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index bd1bb09d40f66..287a83afba38d 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -79,6 +79,8 @@ OrdersOpened=Orders to process NoOpenedOrders=No open orders NoOtherOpenedOrders=No other open orders NoDraftOrders=No draft orders +NoOrder=No Order +NoSupplierOrder=No supplier order OtherOrders=Other orders LastOrders=Last %s customer orders LastCustomerOrders=Last %s customer orders @@ -105,6 +107,7 @@ ClassifyShipped=Classify delivered ClassifyBilled=Classify billed ComptaCard=Accountancy card DraftOrders=Draft orders +DraftSuppliersOrders=Draft suppliers orders RelatedOrders=Related orders RelatedCustomerOrders=Related customer orders RelatedSupplierOrders=Related supplier orders diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index ee1b32084ff5d..1759eb12e9f9a 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -1,6 +1,9 @@ # Dolibarr language file - Source file is en_US - products ProductRef=Product ref. ProductLabel=Product label +ProductLabelTranslated=Translated product label +ProductDescriptionTranslated=Translated product description +ProductNoteTranslated=Translated product note ProductServiceCard=Products/Services card Products=Products Services=Services @@ -64,6 +67,8 @@ ProductStatusNotOnBuy=Not for purchase ProductStatusOnBuyShort=For purchase ProductStatusNotOnBuyShort=Not for purchase UpdatePrice=Update price +UpdateVAT=Update vat +UpdateDefaultPrice=Update default price AppliedPricesFrom=Applied prices from SellingPrice=Selling price SellingPriceHT=Selling price (net of tax) @@ -101,6 +106,8 @@ CorrectStock=Correct stock AddPhoto=Add photo ListOfStockMovements=List of stock movements BuyingPrice=Buying price +PriceForEachProduct=Products with specific prices +NoPriceSpecificToCustomer=This customer has no specific prices. All standard prices for products/services will be used. SupplierCard=Supplier card CommercialCard=Commercial card AllWays=Path to find your product in stock @@ -294,6 +301,6 @@ LastUpdated=Last updated CorrectlyUpdated=Correctly updated PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is PropalMergePdfProductChooseFile=Select PDF files -IncludingProductWithTag=Including product with tag +IncludingProductWithTag=Including product/service with tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer WarningSelectOneDocument=Please select at least one document diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 168f98a27898b..d12d7595f94d6 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -53,6 +53,7 @@ ListOfProposals=List of commercial proposals ActionsOnPropal=Events on proposal NoOpenedPropals=No open commercial proposals NoOtherOpenedPropals=No other open commercial proposals +NoPropal=No commercial proposal RefProposal=Commercial proposal ref SendPropalByMail=Send commercial proposal by mail AssociatedDocuments=Documents associated with the proposal: @@ -98,4 +99,4 @@ DocModelJauneDescription=Jaune proposal model DefaultModelPropalCreate=Default model creation DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced) DefaultModelPropalClosed=Default template when closing a business proposal (unbilled) -ProposalCustomerSignature=Written acceptance, company stamp, date and signature \ No newline at end of file +ProposalCustomerSignature=Written acceptance, company stamp, date and signature diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 8a46433ff9ccf..943e988b2f7d1 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -16,7 +16,7 @@ CancelSending=Cancel sending DeleteSending=Delete sending Stock=Stock Stocks=Stocks -StocksByLotSerial=Stock by lot/serial +StocksByLotSerial=Stocks by lot/serial Movement=Movement Movements=Movements ErrorWarehouseRefRequired=Warehouse reference name is required @@ -34,9 +34,9 @@ LastMovements=Last movements Units=Units Unit=Unit StockCorrection=Correct stock -StockTransfer=Stock transfer -StockMovement=Transfer -StockMovements=Stock transfers +StockTransfer=Stock movement +StockMovement=Stock movement +StockMovements=Stock movements LabelMovement=Movement label NumberOfUnit=Number of units UnitPurchaseValue=Unit purchase price @@ -53,8 +53,8 @@ QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched QtyToDispatchShort=Qty to dispatch OrderDispatch=Stock dispatching -RuleForStockManagementDecrease=Rule for stock management decrease -RuleForStockManagementIncrease=Rule for stock management increase +RuleForStockManagementDecrease=Rule for automatic stock management decrease (manual decrease is always possible, even if an automatic decrease rule is activated) +RuleForStockManagementIncrease=Rule for automatic stock management increase (manual increase is always possible, even if an automatic increase rule is activated) DeStockOnBill=Decrease real stocks on customers invoices/credit notes validation DeStockOnValidateOrder=Decrease real stocks on customers orders validation DeStockOnShipment=Decrease real stocks on shipping validation @@ -83,8 +83,8 @@ WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/se AverageUnitPricePMPShort=Weighted average input price AverageUnitPricePMP=Weighted average input price SellPriceMin=Selling Unit Price -EstimatedStockValueSellShort=Value to sell -EstimatedStockValueSell=Value to Sell +EstimatedStockValueSellShort=Value for sell +EstimatedStockValueSell=Value for sell EstimatedStockValueShort=Input stock value EstimatedStockValue=Input stock value DeleteAWarehouse=Delete a warehouse @@ -113,7 +113,7 @@ AlertOnly= Alerts only WarehouseForStockDecrease=The warehouse %s will be used for stock decrease WarehouseForStockIncrease=The warehouse %s will be used for stock increase ForThisWarehouse=For this warehouse -ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked), and suggest you to create supplier orders to fill the difference. +ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked). Using the checkbox, you can create supplier orders to fill the difference. ReplenishmentOrdersDesc=This is a list of all opened supplier orders including predefined products. Only opened orders with predefined products, so orders that may affect stocks, are visible here. Replenishments=Replenishments NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index e6764df49a299..81e1d48d46ce1 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -44,7 +44,8 @@ ListOfUsers=List of users Administrator=Administrator SuperAdministrator=Super Administrator SuperAdministratorDesc=Global administrator -AdministratorDesc=Administrator's entity +AdministratorDesc=Administrator +AdministratorDescEntity=Administrator (for its company) DefaultRights=Default permissions DefaultRightsDesc=Define here default permissions that are automatically granted to a new created user (Go on user card to change permission of an existing user). DolibarrUsers=Dolibarr users diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 7414fcb7e626d..14be1a6ade638 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -3,9 +3,9 @@ WorkflowSetup=Workflow module setup WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in. ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules. descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed -descWORKFLOW_PROPAL_AUTOCREATE_INVOICEAutomatically create a customer invoice after a commercial proposal is signed -descWORKFLOW_CONTRACT_AUTOCREATE_INVOICEAutomatically create a customer invoice after a contract is validated -descWORKFLOW_ORDER_AUTOCREATE_INVOICEAutomatically create a customer invoice after a customer order is closed +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed +descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated +descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index ce14fb1e4edb1..dd74d684d682f 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -36,7 +36,7 @@ MargeNette=Marge nette MargeType1=Marge sur le meilleur prix fournisseur MargeType2=Marge sur le Prix Moyen Pondéré (PMP) MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT
    Marge nette : Prix de vente HT - Weighted Average Price -MarginTypeDesc=Marge sur le meilleur prix d'achat fournisseur: Prix de vente - Meilleur prix d'achat défini sur la fiche produit
    Marge sur le Prix Moyen Pondéré (PMP): Prix de vente - Prix Moyen Pondéré du produit +MarginTypeDesc=Marge sur le meilleur prix d'achat fournisseur: Prix de vente - Meilleur prix d'achat défini sur la fiche produit
    Marge sur le Prix Moyen Pondéré (PMP): Prix de vente - Prix Moyen Pondéré du produit (PMP) ou meilleur prix d'achat si PMP non défini CostPrice=Prix de revient BuyingCost=Coût de revient UnitCharges=Charge unitaire diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index d8eb9a80e5d89..f111d6b604d4d 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -361,7 +361,7 @@ function valid($user) $soc = new Societe($this->db); $soc->fetch($this->socid); - if (preg_match('/^[\(]?PROV/i', $this->ref)) + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { $numref = $objMod->livraison_get_num($soc,$this); } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index c5e60a1acedb2..a6e9f352d4ed9 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -89,17 +89,17 @@ if (! $datestart) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateStart")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateStart")), null, 'errors'); $action = 'create'; } elseif (! $dateend) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateEnd")), null, 'errors'); $action = 'create'; } elseif (! $_POST["capital"]) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Capital")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Capital")), null, 'errors'); $action = 'create'; } else diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index e7416c1aa0d0d..69cfecbe5c2ff 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -62,17 +62,17 @@ if (! GETPOST('paymenttype', 'int') > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); $error++; } if ($datepaid == '') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } if (! empty($conf->banque->enabled) && ! GETPOST('accountid', 'int') > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fcef513130f06..b15cc6af21317 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -406,10 +406,11 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->load('main'); $langs->load('errors'); - $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $test=false; + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); // Call of triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -480,11 +481,11 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->load('errors'); // Bad password. No authmode has found a good password. - $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); - // TODO We should use a hook afterLoginFailed here, not a trigger. + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); // Call of triggers include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -514,7 +515,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) exit; } - $resultFetchUser=$user->fetch('',$login); + $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1)); if ($resultFetchUser <= 0) { dol_syslog('User not found, connexion refused'); @@ -527,16 +528,19 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->load('main'); $langs->load('errors'); - $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { - $user->trigger_mesg=$user->error; $_SESSION["dol_loginmesg"]=$user->error; + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$user->error; } - // TODO We should use a hook afterLoginFailed here, not a trigger. // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -577,16 +581,20 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->load('main'); $langs->load('errors'); - $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { - $user->trigger_mesg=$user->error; $_SESSION["dol_loginmesg"]=$user->error; + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$user->error; } - // TODO We should use a hook here, not a trigger. + // TODO @deprecated Remove this. Hook must be used, not this trigger. // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -654,9 +662,8 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + // TODO @deprecated Remove this. Hook must be used, not this trigger. $user->trigger_mesg = $loginfo; - - // TODO We should use hook afterLogin here, not a trigger // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -684,6 +691,25 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) { $db->commit(); } + + if (! empty($user->conf->MAIN_LANDING_PAGE)) // Example: /index.php + { + $newpath=dol_buildpath($user->conf->MAIN_LANDING_PAGE, 1); + if ($_SERVER["PHP_SELF"] != $newpath) // not already on landing page (avoid infinite loop) + { + header('Location: '.$newpath); + exit; + } + } + if (! empty($conf->global->MAIN_LANDING_PAGE)) // Example: /index.php + { + $newpath=dol_buildpath($conf->global->MAIN_LANDING_PAGE, 1); + if ($_SERVER["PHP_SELF"] != $newpath) // not already on landing page (avoid infinite loop) + { + header('Location: '.$newpath); + exit; + } + } } @@ -1459,14 +1485,10 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Add login user link $toprightmenu.='
    '; print ''; print ''; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 200659c856e35..7a36a316d13c7 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -81,7 +81,7 @@ if (! GETPOST('nouveautitre')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors'); $error++; $action = 'edit'; } @@ -114,12 +114,12 @@ if (! GETPOST('comment')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Comment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } if (! GETPOST('commentuser')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("User")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } if (! $error) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index e710bca2adf91..ca10eac09b9a6 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1020,7 +1020,7 @@ // S'il a oublié de remplir un nom if (isset($_POST["boutonp"]) && $_POST["nom"] == "") { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } if (isset($erreur_prenom) && $erreur_prenom) { diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 22dddffbff5fc..ec78e9789ca78 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -144,7 +144,7 @@ print ''."\n"; if (! $_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre'))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PollTitle")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors'); } print ''."\n"; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 9c264f893b38f..ec2c17d77ac50 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -354,7 +354,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES'; if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) && (!empty($conf->global->PRODUIT_MULTIPRICES))) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY&PRODUIT_MULTIPRICES'; print $form->selectarray("princingrule",$select_pricing_rules,$current_rule); -print ''; print ''; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0215f20e3c6ab..f08143c443c4d 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -134,6 +134,40 @@ function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$e return $out; } + /** + * Display form to select warehouse + * + * @param string $page Page + * @param int $selected Id of warehouse + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @return void + */ + function formSelectWarehouses($page, $selected='', $htmlname='warehouse_id', $addempty=0) + { + global $langs; + if ($htmlname != "none") { + print '
    '; + print ''; + print ''; + print '
    '.$langs->trans("DolibarrStateBoard").' '.$langs->trans('MarginTypeDesc'); -print ' ('.$langs->trans("PMPValueShort").')'; print '
    '. $langs->trans("PollTitle") .'
    '; +print ''; print ''; print '
    '; + print ''; + print ''; + print '
    '; + print $this->selectWarehouses($selected, $htmlname, '', $addempty); + print '
    '; + } else { + if ($selected) { + require_once DOL_DOCUMENT_ROOT .'/product/stock/class/entrepot.class.php'; + $warehousestatic=new Entrepot($this->db); + $warehousestatic->fetch($selected); + print $warehousestatic->getNomUrl(); + } else { + print " "; + } + } + } + /** * Output a combo box with list of units * pour l'instant on ne definit pas les unites dans la base diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 41bc2520d8f97..fb5eba2abc528 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -765,8 +765,10 @@ function update($id, $user, $notrigger=false, $action='update') $newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $res=dol_move($olddir, $newdir); + //include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + //$res = dol_move($olddir, $newdir); + // do not use dol_move with directory + $res = @rename($olddir, $newdir); if (! $res) { $this->error='ErrorFailToMoveDir'; @@ -821,7 +823,7 @@ function update($id, $user, $notrigger=false, $action='update') function delete($id=0) { // Deprecation warning - if (0 == $id) { + if ($id > 0) { dol_syslog(__METHOD__ . " with parameter is deprecated", LOG_WARNING); } @@ -2970,7 +2972,7 @@ function get_sousproduits_arbo() * Return clicable link of object (with eventually picto) * * @param int $withpicto Add picto into link - * @param string $option Where point the link + * @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '') * @param int $maxlength Maxlength of ref * @return string String with URL */ @@ -3058,7 +3060,8 @@ function getLibStatut($mode=0, $type=0) */ function LibStatut($status,$mode=0,$type=0) { - global $langs; + global $conf, $langs; + $langs->load('products'); if (!empty($conf->productbatch->enabled)) $langs->load("productbatch"); @@ -3295,23 +3298,23 @@ function load_virtual_stock() if (! empty($conf->commande->enabled)) { $result=$this->load_stats_commande(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_commande_client=$this->stats_commande['qty']; } if (! empty($conf->expedition->enabled)) { $result=$this->load_stats_sending(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_sending_client=$this->stats_expedition['qty']; } if (! empty($conf->fournisseur->enabled)) { $result=$this->load_stats_commande_fournisseur(0,'1,2,3,4'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; $result=$this->load_stats_reception(0,'4'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_reception_fournisseur=$this->stats_reception['qty']; } @@ -3553,7 +3556,7 @@ function show_photos($sdir,$size=0,$nbmax=0,$nbbyrow=5,$showfilename=0,$showacti { $return.= '
    '; // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if ($photo_vignette && preg_match('/('.$this->regeximgext.')$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) + if ($photo_vignette && preg_match('/('.$this->regeximgext.')$/i', $photo) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) { $return.= '
    '.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; } @@ -3959,12 +3962,14 @@ public function setCategories($categories) { // Process foreach($to_del as $del) { - $c->fetch($del); - $c->del_type($this, 'product'); + if ($c->fetch($del) > 0) { + $c->del_type($this, 'product'); + } } foreach ($to_add as $add) { - $c->fetch($add); - $c->add_type($this, 'product'); + if ($c->fetch($add) > 0) { + $c->add_type($this, 'product'); + } } return; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index cb174e5847eee..df1afe1db930a 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -216,7 +216,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - // Merge propal PDF docuemnt PDF files + // Merge propal PDF document PDF files if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); @@ -233,7 +233,8 @@ $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); // For each file build select list with PDF extention - if (count($filearray) > 0) { + if (count($filearray) > 0) + { print '
    '; // Actual file to merge is : if (count($filetomerge->lines) > 0) { @@ -315,19 +316,23 @@ $checked = ''; $filename = $filetoadd['name']; - if ($conf->global->MAIN_MULTILANGS) { - if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) { + if ($conf->global->MAIN_MULTILANGS) + { + if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) + { $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang); $checked = ' checked '; } - } else { - if (array_key_exists($filetoadd['name'], $filetomerge->lines)) { + } + else + { + if (array_key_exists($filetoadd['name'], $filetomerge->lines)) + { $checked = ' checked '; } } print '
    '; - print '' . $filename . ''; print '
    '.$langs->trans("Ref").''; - print $form->showrefnav($product,'ref','',1,'ref'); + print $form->showrefnav($object,'ref','',1,'ref'); print '
    '.$langs->trans("Label").''.$product->label.'
    '.$langs->trans("Label").''.$object->label.'
    '.$langs->trans("BuyingPriceMin").''; $product_fourn = new ProductFournisseur($db); - if ($product_fourn->find_min_price_product_fournisseur($product->id) > 0) + if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) { if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); else print $langs->trans("NotDefined"); @@ -296,7 +285,7 @@ // Status (to buy) print '
    '.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $product->getLibStatut(2,1); + print $object->getLibStatut(2,1); print '
    '; @@ -310,7 +299,7 @@ if ($rowid) { - $product->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price + $object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price print load_fiche_titre($langs->trans("ChangeSupplierPrice")); } else @@ -318,7 +307,7 @@ print load_fiche_titre($langs->trans("AddSupplierPrice")); } - print '
    '; + print ''; print ''; print ''; @@ -333,7 +322,7 @@ $supplier->fetch($socid); print $supplier->getNomUrl(1); print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -344,13 +333,13 @@ $events[]=array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php',1), 'htmlname' => 'tva_tx', 'params' => array()); print $form->select_company(GETPOST("id_fourn"),'id_fourn','fournisseur=1',1,0,0,$events); - $parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$product->id); + $parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions',$parameters,$object,$action); if (empty($reshook)) { if (empty($form->result)) { - print ' - '.$langs->trans("CreateDolibarrThirdPartySupplier").''; + print ' - '.$langs->trans("CreateDolibarrThirdPartySupplier").''; } } } @@ -360,7 +349,7 @@ print '
    '.$langs->trans("SupplierRef").''; if ($rowid) { - print $product->fourn_ref; + print $object->fourn_ref; } else { @@ -374,7 +363,7 @@ { $langs->load("propal"); print '
    '.$langs->trans("Availability").''; - $form->selectAvailabilityDelay($product->fk_availability,"oselDispo",1); + $form->selectAvailabilityDelay($object->fk_availability,"oselDispo",1); print '
    '.$langs->trans("VATRateForSupplierProduct").''; - //print $form->load_tva('tva_tx',$product->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country - if (! empty($socid)) // When update + //print $form->load_tva('tva_tx',$object->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country + if (! empty($rowid)) // If we have a supplier, it is an update, we must show the vat of current supplier price + { + $tmpproductsupplier=new ProductFournisseur($db); + $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1); + $default_vat=$tmpproductsupplier->fourn_tva_tx; + } + else { - $default_vat=get_default_tva($supplier, $mysoc, $product->id); - if (empty($default_vat)) $default_vat=$product->tva_tx; + if (empty($default_vat)) + { + $default_vat=$object->tva_tx; + } } print ''; print '
    '.$langs->trans("PriceQtyMin").''; + print ''; print ' '; - print $form->selectPriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):$product->price_base_type), "price_base_type"); + print $form->selectPriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):'HT'), "price_base_type"); // We keep 'HT' here, price_base_type is not yet supported for supplier prices print '
    '.$langs->trans("DiscountQtyMin").' %'; + print ' %'; print '
    '.$langs->trans('NbDaysToDelivery').' '.$langs->trans('days').' '.$langs->trans('days').'
    '.$langs->trans("Charges").''; + print ''; print '
    '; - if ($product->isproduct()) $nblignefour=4; + if ($object->isproduct()) $nblignefour=4; else $nblignefour=4; - $param="&id=".$product->id; + $param="&id=".$object->id; print ''; print_liste_field_titre($langs->trans("Suppliers"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("SupplierRef")); if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre($langs->trans("Availability"),$_SERVER["PHP_SELF"],"pfp.fk_availability","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"],"pfp.quantity","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("VATRate")); - print_liste_field_titre($langs->trans("PriceQtyMinHT")); + print_liste_field_titre($langs->trans("VATRate"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PriceQtyMinHT"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DiscountQtyMin")); + print_liste_field_titre($langs->trans("DiscountQtyMin"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder); // Charges ???? @@ -551,7 +547,7 @@ function on_change() { print "\n"; $product_fourn = new ProductFournisseur($db); - $product_fourn_list = $product_fourn->list_product_fournisseur_price($product->id, $sortfield, $sortorder); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder); if (count($product_fourn_list)>0) { @@ -631,7 +627,7 @@ function on_change() { if (is_object($hookmanager)) { - $parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id); + $parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action); } @@ -639,8 +635,8 @@ function on_change() { print ''; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index efa1bc33dcb6d..a47f4488ea471 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -78,29 +78,32 @@ /* * Search Area of product/service */ -$rowspan=2; -if (! empty($conf->barcode->enabled)) $rowspan++; -print ''; -print ''; -print '
    '; if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.img_edit().""; - print ''.img_picto($langs->trans("Remove"),'disable.png').''; + print ''.img_edit().""; + print ''.img_picto($langs->trans("Remove"),'disable.png').''; } print '
    '; -print ""; -print ''; -print "'; -print ''; -if (! empty($conf->barcode->enabled)) + +// Search contract +if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) { - print "'; - //print ''; - print ''; + $listofsearchfields['search_product']=array('text'=>'ProductOrService'); } -print "'; -//print ''; -print ''; -print "
    '.$langs->trans("Search").'
    "; -print ':
    "; - print ':
    "; -print ':

    "; +if (count($listofsearchfields)) +{ + print '
    '; + print ''; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
    '.$langs->trans("Search").'
    :
    '; + print '
    '; + print '
    '; +} /* * Number of products and/or services @@ -314,7 +317,8 @@ } } print '
    '; - print price($objp->price).' '.$langs->trans("HT"); + if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 68e6143c48c6f..dc9dcb7ed5895 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -56,18 +56,28 @@ $catid = GETPOST('catid','int'); $optioncss = GETPOST('optioncss','alpha'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; +$offset = $liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; -$limit = $conf->liste_limit; +$contextpage='productservicelist'; +if ($type === '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; } +if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array($contextpage)); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('product'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $canvas=GETPOST("canvas"); @@ -84,19 +94,41 @@ else if ($type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas); else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.ref'=>"Ref", + 'p.label'=>"ProductLabel", + 'p.description'=>"Description", + "p.note"=>"Note", +); +// multilang +if (! empty($conf->global->MAIN_MULTILANGS)) +{ + $fieldstosearchall['pl.label']='ProductLabelTranslated'; + $fieldstosearchall['pl.description']='ProductDescriptionTranslated'; + $fieldstosearchall['pl.note']='ProductNoteTranslated'; +} +if (! empty($conf->barcode->enabled)) { + $fieldstosearchall['p.barcode']='Gencod'; +} + /* * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { + $sall=""; $sref=""; - $sbarcode=""; $snom=""; + $sbarcode=""; $search_categ=0; $tosell=""; $tobuy=""; + $search_array_options=array(); } @@ -131,14 +163,19 @@ { $texte = $langs->trans("ProductsAndServices"); } - // Add what we are searching for - if (! empty($sall)) $texte.= " - ".$sall; $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,'; - $sql.= ' p.fk_product_type, p.tms as datem,'; - $sql.= ' p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; + $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; + $sql.= ' p.datec as date_creation, p.tms as date_update,'; $sql.= ' MIN(pfp.unitprice) as minsellprice'; + // Add fields from extrafields + foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; + // Add fields from hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang @@ -146,19 +183,7 @@ $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; if ($sall) { - // For natural search - $params = array('p.ref', 'p.label', 'p.description', 'p.note'); - // multilang - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $params[] = 'pl.label'; - $params[] = 'pl.description'; - $params[] = 'pl.note'; - } - if (! empty($conf->barcode->enabled)) { - $params[] = 'p.barcode'; - } - $sql .= natural_search($params, $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) @@ -168,16 +193,6 @@ } if ($sref) $sql .= natural_search('p.ref', $sref); if ($sbarcode) $sql .= natural_search('p.barcode', $sbarcode); - if ($snom) - { - $params = array('p.label'); - // multilang - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $params[] = 'pl.label'; - } - $sql .= natural_search($params, $snom); - } if (isset($tosell) && dol_strlen($tosell) > 0 && $tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($tosell); if (isset($tobuy) && dol_strlen($tobuy) > 0 && $tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($tobuy); if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; @@ -186,12 +201,33 @@ if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ); if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL"; if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; + // Add where from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } + } + // Add where from hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; - $sql.= " p.fk_product_type, p.tms,"; - $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte"; - $sql .= ', p.desiredstock'; + $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; + $sql.= ' p.datec, p.tms'; + // Add fields from extrafields + foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key; + // Add fields from hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet - $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -236,13 +272,25 @@ setEventMessage($langs->trans("ProductDeleted", GETPOST('delprod'))); } - $param="&sref=".$sref.($sbarcode?"&sbarcode=".$sbarcode:"")."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy; - $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - $param.=($search_categ?"&search_categ=".$search_categ:""); - $param.=isset($type)?"&type=".$type:""; + if ($sref) $param="&sref=".$sref; + if ($sbarcode) $param.=($sbarcode?"&sbarcode=".$sbarcode:""); + if ($snom) $param.="&snom=".$snom; + if ($sall) $param.="&sall=".$sall; + if ($tosell != '') $param.="&tosell=".$tosell; + if ($tobuy != '') $param.="&tobuy=".$tobuy; + if ($fourn_id) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); + if ($seach_categ) $param.=($search_categ?"&search_categ=".$search_categ:""); + if ($type != '') $param.='&type='.urlencode($type); if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print_barre_liste($texte, $page, "list.php", $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png'); + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png'); if (! empty($catid)) { @@ -276,122 +324,193 @@ print '
    '; if ($optioncss != '') print ''; print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; - + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + // Filter on categories $moreforfilter=''; - $colspan=6; - if (! empty($conf->barcode->enabled)) $colspan++; - if (! empty($conf->service->enabled) && $type != 0) $colspan++; - if (empty($conf->global->PRODUIT_MULTIPRICES)) $colspan++; - if ($user->rights->fournisseur->lire) $colspan++; - if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) $colspan+=2; - if (! empty($conf->categorie->enabled)) { - $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.='
    '; + $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); - $moreforfilter.='       '; + $moreforfilter.='
    '; } if ($moreforfilter) { - print ''; - print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; } - // Lignes des titres - print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); - if (! empty($conf->barcode->enabled)) print_liste_field_titre($langs->trans("BarCode"), $_SERVER["PHP_SELF"], "p.barcode",$param,'','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder); - if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES)) { - $titlefield=$langs->trans("SellingPrice"); + $titlesellprice=$langs->trans("SellingPrice"); if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { - $titlefield=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); + $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); } - print_liste_field_titre($titlefield, $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder); } - if ($user->rights->fournisseur->lire) print_liste_field_titre($langs->trans("BuyingPriceMinShort"), '', '', '', '', 'align="right"'); - if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print_liste_field_titre($langs->trans("DesiredStock"), '', '', '', '', 'align="right"'); - if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print_liste_field_titre($langs->trans("PhysicalStock"), '', '', '', '', 'align="right"'); - print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Buy"), $_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + + $arrayfields=array( + 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))), + 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), + 'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), + 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), + 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), + 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000), + 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Purchases").')', '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]); + } + } + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + print '
    '; + print '
    '; print $moreforfilter; - print '
    '; + print ''; + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desirestock","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - // Lignes des champs de filtre + // Lines with input filters print ''; - print ''; - print ''; + if (! empty($arrayfields['p.ref']['checked'])) + { + print ''; + } + if (! empty($arrayfields['p.label']['checked'])) + { + print ''; + } // Barcode - if (! empty($conf->barcode->enabled)) + if (! empty($arrayfields['p.barcode']['checked'])) { print ''; } - // Date modification - print ''; - // Duration - if (! empty($conf->service->enabled) && $type != 0) + if (! empty($arrayfields['p.duration']['checked'])) { print ''; } - // Sell price - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($arrayfields['p.sellprice']['checked'])) { print ''; } - // Minimum buying Price - if ($user->rights->fournisseur->lire) { + if (! empty($arrayfields['p.minbuyprice']['checked'])) + { print ''; } - - // Stock - if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) + // Desired stock + if (! empty($arrayfields['p.desiredstock']['checked'])) { print ''; - //desiredstock + } + // Stock + if (! empty($arrayfields['p.stock']['checked'])) + { print ''; } - - print ''; - - print ''; - + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) print ''; + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['p.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['p.tms']['checked'])) + { + print ''; + } + if (! empty($arrayfields['p.tosell']['checked'])) + { + print ''; + } + if (! empty($arrayfields['p.tobuy']['checked'])) + { + print ''; + } print ''; - - // Ref - print '\n"; + $product_static->status_buy = $objp->tobuy; + $product_static->status = $objp->tosell; - // Label - print ''; + $var=!$var; + print ''; + // Ref + if (! empty($arrayfields['p.ref']['checked'])) + { + print '\n"; + } + + // Label + if (! empty($arrayfields['p.label']['checked'])) + { + print ''; + } + // Barcode - if (! empty($conf->barcode->enabled)) - { + if (! empty($arrayfields['p.barcode']['checked'])) + { print ''; } - // Modification Date - print '\n"; - // Duration - if (! empty($conf->service->enabled) && $type != 0) + if (! empty($arrayfields['p.duration']['checked'])) { print ''; } - // Show stock - if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) + if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) // To optimize call of load_stock { if ($objp->fk_product_type != 1) { $product_static->id = $objp->rowid; $product_static->load_stock(); - print ''; - print ''; } - else + } + // Stock + if (! empty($arrayfields['p.stock']['checked'])) + { + print ''; + print ''; - print ''; + if ($product_static->stock_reel < $objp->seuil_stock_alerte) print img_warning($langs->trans("StockTooLow")).' '; + print $product_static->stock_reel; } + print ''; } - - $product_static->status_buy = $objp->tobuy; - $product_static->status = $objp->tosell; + + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $objp->$tmpkey, '', 1); + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['p.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['p.tms']['checked'])) + { + print ''; + } + // Status (to sell) - print ''; - + if (! empty($arrayfields['p.tosell']['checked'])) + { + print ''; + } // Status (to buy) - print ''; - + if (! empty($arrayfields['p.tobuy']['checked'])) + { + print ''; + } + // Action print ''; print "\n"; $i++; } - $param="&sref=".$sref.($sbarcode?"&sbarcode=".$sbarcode:"")."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy; - $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - $param.=($search_categ?"&search_categ=".$search_categ:""); - $param.=isset($type)?"&type=".$type:""; print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', '', '', 'paginationatbottom'); $db->free($resql); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9c1331f61ce15..ac611faf5c35d 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -9,6 +9,7 @@ * Copyright (C) 2014 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Marcos García * * 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 @@ -83,8 +84,37 @@ if (empty($reshook)) { - if ($action == 'update_price' && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object->tva_tx = GETPOST('tva_tx'); + + $db->begin(); + + $resql = $object->update($object->id, $user); + if (! $resql) + { + $error++; + } + + if ($error) + { + $object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq); + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + + $action=''; + } + + if (($action == 'update_price') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + { $maxpricesupplier = $object->min_recommended_price(); $object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression @@ -208,11 +238,11 @@ if (empty($quantity)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), null, 'errors'); } if (empty($newprice)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); } if (! $error) { // Calcul du prix HT et du prix unitaire @@ -378,13 +408,13 @@ // Ref print ''; -print ''; print ''; // Label -print ''; +print ''; $isphoto = $object->is_photo_available($conf->product->multidir_output [$object->entity]); @@ -398,6 +428,11 @@ print ''; +// Status (to sell) +print ''; + // MultiPrix if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -409,8 +444,8 @@ $soc->fetch($socid); // Selling price - print ''; - print '' . $langs->trans("SellingPrice") . ''; + print ''; // Price min - print ''; - - // TVA - print ''; + + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + // TVA + print ''; + } + else + { + // TVA + print ''; + } + } else { - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility { - // TVA - if ($i == 1) // We show only vat for level 1 - { - print ''; - } + // We show only vat for level 1 + print ''; + } + else + { + // TVA + print ''; + } + + print ''; + for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + { print ''; // Label of price @@ -455,20 +506,19 @@ print ''; if ($object->multiprices_base_type ["$i"] == 'TTC') { - print '';; } else { - print ' ' . $langs->trans($object->price_base_type); + print ' '.$langs->trans($object->price_base_type).'';; } - print ''; - // Prix mini - print ''; @@ -651,11 +703,6 @@ } } -// Status (to sell) -print ''; - print "
    '; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; - print ' '; - print ''; print ' '; print ''; print ''; print ' '; print ''; print ' '; print ''; print ' '; print ''; - print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1); - print ''; - print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1); - print ''; + print ''; + print ''; + print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1); + print ''; + print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1); + print ''; print ''; print ''; @@ -425,32 +544,38 @@ } } - $var=!$var; - print '
    '; $product_static->id = $objp->rowid; $product_static->ref = $objp->ref; $product_static->label = $objp->label; $product_static->type = $objp->fk_product_type; - print $product_static->getNomUrl(1,'',24); - print "'.dol_trunc($objp->label,40).'
    '; + print $product_static->getNomUrl(1,'',24); + print "'.dol_trunc($objp->label,40).''.$objp->barcode.''.dol_print_date($db->jdate($objp->datem),'day')."'; if (preg_match('/([0-9]+)[a-z]/i',$objp->duration)) @@ -466,7 +591,7 @@ } // Sell price - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($arrayfields['p.sellprice']['checked'])) { print ''; if ($objp->tosell) @@ -478,7 +603,7 @@ } // Better buy price - if ($user->rights->fournisseur->lire) + if (! empty($arrayfields['p.minbuyprice']['checked'])) { print ''; if ($objp->tobuy && $objp->minsellprice != '') @@ -500,62 +625,102 @@ print ''; + } + } + + // Desired stock + if (! empty($arrayfields['p.desiredstock']['checked'])) + { + print ''; + if ($objp->fk_product_type != 1) + { print $objp->desiredstock; - print ''; - if ($product_static->stock_reel < $objp->seuil_stock_alerte) print img_warning($langs->trans("StockTooLow")).' '; - print $product_static->stock_reel; - print ''; + if ($objp->fk_product_type != 1) { - print ''; - print ' '; - print ''; - print ' '; - print ''; + print dol_print_date($objp->date_creation, 'dayhour'); + print ''; + print dol_print_date($objp->date_update, 'dayhour'); + print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - print $product_static->LibStatut($objp->tosell,5,0); - } - print ''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + } else { + print $product_static->LibStatut($objp->tosell,5,0); + } + print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); - } else { - print $product_static->LibStatut($objp->tobuy,5,1); - } - print ''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + } else { + print $product_static->LibStatut($objp->tobuy,5,1); + } + print ' 
    ' . $langs->trans("Ref") . ''; +print '' . $langs->trans("Ref") . ''; print $form->showrefnav($object, 'ref', '', 1, 'ref'); print '
    ' . $langs->trans("Label") . '' . $object->label . '
    ' . $langs->trans("Label") . '' . $object->label . '
    ' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; +print $object->getLibStatut(2, 0); +print '
    ' . $langs->trans("SellingPrice") . ''; + print '
    '; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { print price($object->multiprices_ttc["$soc->price_level"]); } else { @@ -424,7 +459,7 @@ print '
    ' . $langs->trans("MinPrice") . ''; + print '
    ' . $langs->trans("MinPrice") . ''; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { print price($object->multiprices_min_ttc["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]); @@ -432,20 +467,36 @@ print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]); } print '
    ' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '
    ' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '
    ' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '
    ' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . '
    ' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . '
    ' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '
    '.$langs->trans("PriceLevel").''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").'
    ' . price($object->multiprices_ttc["$i"]); + print '' . price($object->multiprices_ttc["$i"]); } else { - print '' . price($object->multiprices["$i"]); + print '' . price($object->multiprices["$i"]); } if ($object->multiprices_base_type["$i"]) { - print ' ' . $langs->trans($object->multiprices_base_type ["$i"]); + print ' '.$langs->trans($object->multiprices_base_type ["$i"]).'
    ' . $langs->trans("MinPrice") . ' ' . $i . ''; + // Prix min + print ''; if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT"; if ($object->multiprices_base_type["$i"] == 'TTC') { @@ -553,7 +603,9 @@ } } } -} else { +} +else +{ // TVA print '
    ' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '
    ' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; -print $object->getLibStatut(2, 0); -print '
    \n"; dol_fiche_end(); @@ -671,16 +718,69 @@ { print "\n" . '
    ' . "\n"; - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - + else + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + print "\n
    \n"; } + + /* - * Edition du prix + * Edit price area */ + +if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->service->creer)) +{ + print load_fiche_titre($langs->trans("UpdateVAT"), ''); + + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head(''); + + print ''; + + // VAT + print ''; + + print '
    ' . $langs->trans("VATRate") . ''; + print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr); + print '
    '; + + dol_fiche_end(); + + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; + + print '

    '; +} + if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer)) { print load_fiche_titre($langs->trans("NewPrice"), ''); @@ -702,7 +802,7 @@ print '
    '; + print '
    '; print $langs->trans('PriceBase'); print ''; @@ -787,26 +887,31 @@ function on_change() { } else { - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + dol_fiche_head(''); + + for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { + if ($i > 1) print '
    '; + print '
    '; - print ''; + print ''; print ''; print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { + print ''; + } - dol_fiche_head(''); - print ''; // VAT - if ($i == 1) { + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { print ''; - } else { // We always use the vat rate of price level 1 (A vat rate does not depends on customer) - print ''; } - + // Selling price print '
    ' . $langs->trans("VATRate") . ''; - print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx ["$i"], $mysoc, '', $object->id); + print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx["$i"], $mysoc, '', $object->id); print '
    '; $text = $langs->trans('SellingPrice') . ' ' . $i; @@ -841,10 +946,10 @@ function on_change() { print '
    '; - dol_fiche_end(); - print '
    '; } + + dol_fiche_end(); } } @@ -888,14 +993,14 @@ function on_change() { print '
    ' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("MultiPriceLevelsName") . '' . $langs->trans("PriceLevel") . '' . $langs->trans("Type") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans($objp->price_base_type) . "' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "' . price($objp->price) . "' . price($objp->price_ttc) . "' . ($objp->price_base_type != 'TTC' ? price($objp->price) : ''). "' . ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '') . "' . price($objp->price_min) . '' . price($objp->price_min_ttc) . '' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . '' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . '' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . '' . $langs->trans("ThirdParty") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("ThirdParty") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ' 
     '; - print ''; - print '
     '; + print ''; + print '
    "; print ""; - - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - - print "\n" . '
    ' . "\n"; - - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - print "\n

    \n"; } } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 8bd2096af69aa..be5be86a8b823 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -53,7 +53,7 @@ $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if (! $sortfield) $sortfield="stock_physique"; +if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -215,27 +215,35 @@ print ''; print ''; - print ''; - // Filter on categories $moreforfilter=''; if (! empty($conf->categorie->enabled)) { + $moreforfilter.='
    '; $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ'); - $moreforfilter.='           '; + $moreforfilter.='
    '; } + + $moreforfilter.='
    '; $moreforfilter.=$langs->trans("StockTooLow").' '; - if ($moreforfilter) - { - print '
    '; - print ''; - } + $moreforfilter.=''; + + if (! empty($moreforfilter)) + { + print '
    '; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
    '; + } + $param="&tosell=$tosell&tobuy=$tobuy".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref"; - + + print '
    '; - print $moreforfilter; - print '
    '; + // Lignes des titres print ""; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); @@ -247,8 +255,8 @@ // TODO Add info of running suppliers/customers orders //print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); - print_liste_field_titre($langs->trans("Sell"),$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Buy"),$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 86410df8a00d5..41482c4e796d2 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -56,7 +56,7 @@ $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if (! $sortfield) $sortfield="stock_physique"; +if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -227,27 +227,32 @@ print ''; print ''; - print '
    '; - // Filter on categories $moreforfilter=''; if (! empty($conf->categorie->enabled)) { + $moreforfilter.='
    '; $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ'); - $moreforfilter.='           '; + $moreforfilter.='
    '; } //$moreforfilter.=$langs->trans("StockTooLow").' '; - if ($moreforfilter) - { - print ''; - print ''; - } + + if (! empty($moreforfilter)) + { + print '
    '; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
    '; + } + $param="&tosell=$tosell&tobuy=$tobuy".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref&batch=$batch&eatby=$eatby&sellby=$sellby"; + print '
    '; - print $moreforfilter; - print '
    '; + // Lignes des titres print ""; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); @@ -261,9 +266,9 @@ print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); // TODO Add info of running suppliers/customers orders //print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder); - print ''; - print_liste_field_titre($langs->trans("Sell"),$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Buy"),$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre(''); + print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 9491b18da1e15..c95845191bf23 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -128,9 +128,9 @@ if ($user->rights->commande->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, d.total_ht as total_ht, c.ref,"; + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, c.rowid, d.total_ht as total_ht, c.ref,"; $sql .= " c.ref_client,"; - $sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.qty"; + $sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.rowid, d.qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; @@ -188,7 +188,8 @@ } print_barre_liste($langs->trans("CustomersOrders"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,$totalrecords,''); - print '
    '; + print '
    '; + print '
    '; print $langs->trans('Period').' ('.$langs->trans("OrderDate") .') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); @@ -197,9 +198,10 @@ print ''; print '
    '; print '
    '; + print '
    '; $i = 0; - print '
     
    '; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","",$option,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index e7a803c299c5e..e0dca72864f1d 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -135,9 +135,9 @@ print ''; if ($user->rights->fournisseur->commande->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " c.rowid, d.total_ht as total_ht, c.ref,"; - $sql .= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.qty"; + $sql .= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.rowid, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; @@ -198,7 +198,8 @@ } print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); - print '
    '; + print '
    '; + print '
    '; print $langs->trans('Period') . ' (' . $langs->trans("OrderDate") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); @@ -207,9 +208,10 @@ print ''; print '
    '; print '
    '; + print '
    '; $i = 0; - print '
    '; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid", "", $option, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 84417c013b72a..9d4d7d53abc9a 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -147,7 +147,7 @@ print_barre_liste($langs->trans("Contrats"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); $i = 0; - print "
    "; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","","&id=".$product->id,'',$sortfield,$sortorder); @@ -155,9 +155,9 @@ print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.date_contrat","","&id=".$product->id,'align="center"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"c.amount","","&id=".$product->id,'align="right"',$sortfield,$sortorder); - print ''; - print ''; - print ''; + print_liste_field_titre($staticcontratligne->LibStatut(0,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre($staticcontratligne->LibStatut(4,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre($staticcontratligne->LibStatut(5,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; $contratstatic=new Contrat($db); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 2a79b97e39986..da39d5d67c121 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -22,7 +22,7 @@ /** * \file htdocs/product/stats/facture.php * \ingroup product service facture - * \brief Page des stats des factures clients pour un produit + * \brief Page of invoice statistics for a product */ require '../../main.inc.php'; @@ -128,10 +128,11 @@ print ''; - if ($user->rights->facture->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, d.total_ht as total_ht,"; - $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; + if ($user->rights->facture->lire) + { + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; + $sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -147,24 +148,27 @@ $sql.= ' AND YEAR(f.datef) IN (' . $search_year . ')'; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; - $sql.= " ORDER BY $sortfield $sortorder "; + $sql.= $db->order($sortfield, $sortorder); //Calcul total qty and amount for global if full scan list $total_ht=0; $total_qty=0; $totalrecords=0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { + if ($result) + { $totalrecords = $db->num_rows($result); - while ($objp = $db->fetch_object($result)) { + while ($objp = $db->fetch_object($result)) + { $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; } } } - $sql.= $db->plimit($conf->liste_limit +1, $offset); + $sql.= $db->plimit($conf->liste_limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -189,7 +193,8 @@ } print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=".$product->id,$sortfield,$sortorder,'',$num,$totalrecords,''); - print '
    '; + print '
    '; + print '
    '; print $langs->trans('Period').' ('.$langs->trans("DateInvoice") .') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); @@ -198,9 +203,10 @@ print ''; print '
    '; print '
    '; + print '
    '; $i = 0; - print '
    '.$staticcontratligne->LibStatut(0,3).''.$staticcontratligne->LibStatut(4,3).''.$staticcontratligne->LibStatut(5,3).'
    '; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$option,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); @@ -214,7 +220,7 @@ if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num,$conf->liste_limit)) { $objp = $db->fetch_object($result); $var=!$var; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 9b56cee75523b..3d5cbcbe45529 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -130,7 +130,7 @@ if ($user->rights->fournisseur->facture->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, d.total_ht as total_ht,"; + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, f.ref, d.rowid, d.total_ht as total_ht,"; $sql .= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; @@ -190,7 +190,8 @@ } print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); - print '
    '; + print '
    '; + print '
    '; print $langs->trans('Period') . ' (' . $langs->trans("DateInvoice") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); @@ -199,9 +200,10 @@ print ''; print '
    '; print '
    '; + print '
    '; $i = 0; - print '
    '; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "s.rowid", "", $option, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 690f9c8c42148..95c273929cd5b 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -129,7 +129,7 @@ if ($user->rights->propale->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; - $sql .= "p.datep, p.fk_statut as statut, d.qty"; + $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; @@ -191,7 +191,8 @@ } print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); - print '
    '; + print '
    '; + print '
    '; print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); @@ -200,9 +201,10 @@ print ''; print '
    '; print '
    '; + print '
    '; $i = 0; - print '
    '; + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.rowid", "", $option, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 8d1a507ab26b8..0f88792f2e43e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -130,14 +130,14 @@ function create($user) */ function update($id, $user) { - $this->libelle=$this->db->escape(trim($this->libelle)); - $this->description=$this->db->escape(trim($this->description)); + $this->libelle=trim($this->libelle); + $this->description=trim($this->description); - $this->lieu=$this->db->escape(trim($this->lieu)); + $this->lieu=trim($this->lieu); - $this->address=$this->db->escape(trim($this->address)); - $this->zip=$this->zip?trim($this->zip):trim($this->zip); - $this->town=$this->town?trim($this->town):trim($this->town); + $this->address=trim($this->address); + $this->zip=trim($this->zip); + $this->town=trim($this->town); $this->country_id=($this->country_id > 0 ? $this->country_id : $this->country_id); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index ba322ac9c61f2..604d7d30280c1 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -79,17 +79,17 @@ if (! ($id_product > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Product")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } if (! ($id_sw > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseSource")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors'); } if (! ($id_tw > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseTarget")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseTarget")), null, 'errors'); } if ($id_sw > 0 && $id_tw == $id_sw) { @@ -100,7 +100,7 @@ if (! $qty) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Qty")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); } // Check a batch number is provided if product need it @@ -325,7 +325,7 @@ llxHeader('', $title); -print load_fiche_titre($langs->trans("MassStockMovement")).'

    '; +print load_fiche_titre($langs->trans("MassStockMovement")); $titletoadd=$langs->trans("Select"); $titletoaddnoent=$langs->transnoentitiesnoconv("Select"); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index fda21a0808422..12ede4463cb60 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -94,7 +94,7 @@ if (empty($product_id)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); $action='correction'; } if (! is_numeric($_POST["nbpiece"])) @@ -504,7 +504,7 @@ if (empty($conf->productbatch->enabled)) print ' '; //else print '
    '; $syear = $year?$year:-1; - print ''; + print ''; //print $formother->selectyear($syear,'year',1, 20, 5); print ''; // Product Ref @@ -575,14 +575,15 @@ $productstatic->ref=$objp->product_ref; $productstatic->label=$objp->produit; $productstatic->type=$objp->type; - print $productstatic->getNomUrl(1,'',16); + print $productstatic->getNomUrl(1,'stock',16); print "\n"; // Product label print '\n"; // Batch if (! empty($conf->productbatch->enabled)) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 1d92a9994b193..775a3ae0bfe24 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -99,13 +99,13 @@ { if (! (GETPOST("id_entrepot") > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; $action='correction'; } if (! GETPOST("nbpiece")) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action='correction'; } @@ -116,7 +116,7 @@ $result=$product->fetch($id); if ($product->hasbatch() && (! GETPOST("sellby")) && (! GETPOST("eatby")) && (! GETPOST("batch_number"))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("atleast1batchfield")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("atleast1batchfield")), null, 'errors'); $error++; $action='correction'; } @@ -186,13 +186,13 @@ { if (! (GETPOST("id_entrepot_source",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; $action='transfert'; } if (! GETPOST("nbpiece",'int')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action='transfert'; } @@ -335,7 +335,7 @@ if ($pdluo->id) { if ((! GETPOST("sellby")) && (! GETPOST("eatby")) && (! GETPOST("batch_number"))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("atleast1batchfield")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("atleast1batchfield")), null, 'errors'); } else { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index e96e3c81a6af8..620f1acbb404b 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Laurent Destaileur + * Copyright (C) 2013-2015 Laurent Destaileur * Copyright (C) 2014 Regis Houssin * * This program is free software: you can redistribute it and/or modify @@ -445,8 +445,8 @@ // Lines of title -print ''; - +print ''; +print_liste_field_titre('', $_SERVER["PHP_SELF"], ''); print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder); if (!empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans('Duration'), $_SERVER["PHP_SELF"], 'p.duration', $param, '', 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index be97ad37a331d..1be05aed2d83c 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -68,30 +68,35 @@ print '
    '; - -// Search task +// Search project if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { - $var=false; - print '
    '; + $listofsearchfields['search_task']=array('text'=>'Task'); +} + +if (count($listofsearchfields)) +{ + print ''; print ''; - print ''; - print ''; // All status - print '
    '; - $productstatic->id=$objp->rowid; + /*$productstatic->id=$objp->rowid; $productstatic->ref=$objp->produit; $productstatic->type=$objp->type; - print $productstatic->getNomUrl(1,'',16); + print $productstatic->getNomUrl(1,'',16);*/ + print $productstatic->label; print "
    '; - print ''; - print ''; - print ''; - print ''; - //print ''; - print ''; - print ''; - print "
    '.$langs->trans("SearchATask").'
    :
    :
    :
    \n"; - print "
    \n"; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
    '.$langs->trans("Search").'
    :
    '; + print ''; + print '
    '; } /* Affichage de la liste des projets d'aujourd'hui */ -print '
    '; +print '
    '; print ''; print ''; print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 5d499cf766c07..748f91dbefe8d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -118,12 +118,12 @@ $error=0; if (empty($_POST["ref"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $error++; } if (empty($_POST["title"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $error++; } @@ -205,13 +205,13 @@ { $error++; //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); } if (empty($_POST["title"])) { $error++; //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } $db->begin(); @@ -624,7 +624,7 @@ print ''; print ''; - // Customer + // Thirdparty print ''; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 3b0dd280eb6cb..7ac7fa66cea86 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -878,15 +878,17 @@ function getNomUrl($withpicto=0, $option='', $addlabel=0, $moreinpopup='', $sep= $result = ''; $link = ''; $linkend = ''; - $label = '' . $langs->trans("ShowProject") . ''; + $label=''; + if ($option != 'nolink') $label = '' . $langs->trans("ShowProject") . ''; if (! empty($this->ref)) - $label .= '
    ' . $langs->trans('Ref') . ': ' . $this->ref; + $label .= ($label?'
    ':'').'' . $langs->trans('Ref') . ': ' . $this->ref; // The space must be after the : to not being explode when showing the title in img_picto if (! empty($this->title)) - $label .= '
    ' . $langs->trans('Label') . ': ' . $this->title; + $label .= ($label?'
    ':'').'' . $langs->trans('Label') . ': ' . $this->title; // The space must be after the : to not being explode when showing the title in img_picto if ($moreinpopup) $label.='
    '.$moreinpopup; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if ($option != 'nolink') { + if ($option != 'nolink') + { if (preg_match('/\.php$/',$option)) { $link = ''; + $listofsearchfields['search_project']=array('text'=>'Project'); +} + +if (count($listofsearchfields)) +{ + print '
    '; print ''; - print '
    '.$langs->trans('ActivityOnProjectToday').''.$langs->trans("Time").'
    '.$langs->trans("Label").'
    '.$langs->trans("ThirdParty").''; $filteronlist=''; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; @@ -713,7 +713,7 @@ // Third party print '
    '.$langs->trans("ThirdParty").''; - if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1); + if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project'); else print' '; print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
    '.$langs->trans("SearchAProject").'
    :
    :
    :
    \n"; - print "
    \n"; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
    '.$langs->trans("Search").'
    :
    '; + print ''; + print '
    '; } @@ -229,6 +237,7 @@ if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " GROUP BY s.nom, s.rowid"; +$sql.= $db->order($sortfield, $sortorder); $var=true; $resql = $db->query($sql); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f46c6562ae709..17aa5cac22263 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -48,9 +48,9 @@ if (!$user->rights->projet->lire) accessforbidden(); -$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; -$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; -$page = isset($_GET["page"])? $_GET["page"]:$_POST["page"]; +$sortfield = GETPOST("sortfield","alpha"); +$sortorder = GETPOST("sortorder"); +$page = GETPOST("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; @@ -109,6 +109,14 @@ $hookmanager->initHooks(array('projectlist')); $extrafields = new ExtraFields($db); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.ref'=>"Ref", + 'p.title'=>"Label", + 's.nom'=>"ThirdPartyName", + "p.note_public"=>"NotePublic" +); +if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate"; /* @@ -141,7 +149,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; if ($search_user > 0) { $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; @@ -182,7 +190,7 @@ { $sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } -if ($search_all) $sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all); +if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); if ($search_status >= 0) $sql .= " AND p.fk_statut = ".$db->escape($search_status); if ($search_opp_status) { @@ -191,7 +199,8 @@ if ($search_opp_status == 'none') $sql .= " AND p.fk_opp_status IS NULL"; } if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); -if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; +if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale; +if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; if ($search_user > 0) $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user; // Add where from hooks $parameters=array(); @@ -233,8 +242,13 @@ print '
    '; if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - // Show description of content + // Show description of content if ($mine) print $langs->trans("MyProjectsDesc").'

    '; else { @@ -244,8 +258,8 @@ if ($search_all) { - print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Label")." ".$langs->trans("or")." ".$langs->trans("ThirdParty")."): "; - print ''.$search_all.''; + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall)); } $colspan=8; @@ -274,15 +288,18 @@ if (! empty($moreforfilter)) { print '
    '; + //print '
    '; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''; - } + //print '
    '; - + print '
    '; + print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder); diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 42d367ce8331d..d28d7d6f14abb 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -269,7 +269,8 @@ print '
    '; print ''; -print '
    '; + +print '
    '; print ''; // Company print ''; -//print ''; -print ''."\n"; -print "
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; @@ -293,8 +294,8 @@ print ''; print '

    '; -print ''; -print ''; +print '
    '; +print ''; print ''; print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) @@ -305,13 +306,15 @@ print ''; $oldyear=0; +$var=true; foreach ($data_all_year as $val) { $year = $val['year']; while ($year && $oldyear > $year+1) { // If we have empty year $oldyear--; - print ''; + $var=!$var; + print ''; print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { @@ -321,7 +324,8 @@ print ''; print ''; } - print ''; + $var=!$var; + print ''; print ''; print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 3458b34b176ff..d1b26453de9a9 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -90,13 +90,13 @@ { if (empty($label)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action='create'; $error++; } else if (empty($_POST['task_parent'])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ChildOfTask")), null, 'errors'); $action='create'; $error++; } diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index 22b53d9f61ce6..cd8e3af37bd47 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -33,6 +33,8 @@ $langs->load('users'); $id=GETPOST('id','int'); + +$search_all=GETPOST('search_all'); $search_project=GETPOST('search_project'); if (! isset($_GET['search_status']) && ! isset($_POST['search_status'])) $search_status=1; else $search_status=GETPOST('search_status'); @@ -55,8 +57,9 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0; // Purge criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { + $search_all=""; $search_project=""; $search_status=""; $search_task_ref=""; @@ -64,6 +67,12 @@ } if (empty($search_status) && $search_status == '') $search_status=1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 't.ref'=>"Ref", + 't.label'=>"Label", +); + /* * Actions @@ -107,6 +116,7 @@ // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task assigned to a user can have a parent that is not assigned to him and we need such parents). $morewherefilter=''; +if ($search_all) $morewherefilter.=natural_search(array_keys($fieldstosearchall), $search_all); if ($search_task_ref) $morewherefilter.=natural_search('t.ref', $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search('t.label', $search_task_label); $tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid, 0, $search_project, $search_status, $morewherefilter, $search_project_user, $search_task_user); @@ -114,8 +124,20 @@ $tasksrole=($mine ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$projectstatic->id,0) : ''); print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; -print '
    '.$langs->trans("Year").''.$langs->trans("NbOfProjects").'
    0?'&userid='.$userid:'').'">'.$oldyear.'0
    0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'
    '; + +if ($search_all) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall)); +} + // If the user can view users if ($user->rights->user->user->lire) @@ -134,7 +156,7 @@ } if (! empty($moreforfilter)) { - print '
    '; + print '
    '; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -142,6 +164,7 @@ print '
    '; } +print '
    '; print ''; print ''; print ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index a146d8805eaaf..9cbe8c1289f28 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -71,7 +71,7 @@ if (empty($_POST["label"])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } if (! $error) { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index db8682e095a50..6c250d0fe57e4 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -430,6 +430,8 @@ /* * List of time spent */ + $tasks = array(); + $sql = "SELECT t.rowid, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm"; $sql.= ", u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; @@ -444,7 +446,6 @@ { $num = $db->num_rows($resql); $i = 0; - $tasks = array(); while ($i < $num) { $row = $db->fetch_object($resql); @@ -470,7 +471,7 @@ print ''; print ''; print ''; - if ($conf->salaries->enabled) + if (! empty($conf->salaries->enabled)) { print ''; } @@ -491,11 +492,11 @@ print ''; diff --git a/htdocs/public/api/explorer/lib/handlebars-1.0.rc.1.js b/htdocs/public/api/explorer/lib/handlebars-1.0.rc.1.js index 05346370a2070..81524621ae508 100644 --- a/htdocs/public/api/explorer/lib/handlebars-1.0.rc.1.js +++ b/htdocs/public/api/explorer/lib/handlebars-1.0.rc.1.js @@ -726,7 +726,7 @@ Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); }; this.comment = comment; }; -})();; +})(); // lib/handlebars/utils.js Handlebars.Exception = function(message) { var tmp = Error.prototype.constructor.apply(this, arguments); @@ -791,7 +791,7 @@ Handlebars.SafeString.prototype.toString = function() { } } }; -})();; +})(); // lib/handlebars/compiler/compiler.js /*jshint eqnull:true*/ diff --git a/htdocs/public/api/explorer/lib/handlebars.runtime-1.0.0.beta.6.js b/htdocs/public/api/explorer/lib/handlebars.runtime-1.0.0.beta.6.js index 987a5cd4d665e..d73e043af18ef 100644 --- a/htdocs/public/api/explorer/lib/handlebars.runtime-1.0.0.beta.6.js +++ b/htdocs/public/api/explorer/lib/handlebars.runtime-1.0.0.beta.6.js @@ -156,7 +156,7 @@ Handlebars.SafeString.prototype.toString = function() { } } }; -})();; +})(); // lib/handlebars/runtime.js Handlebars.VM = { template: function(templateSpec) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 8b6aad1673984..2fb6fb61a91c2 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -304,7 +304,6 @@ function llxFooterVierge() $urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount')); if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email')); - if (! empty($entity)) $urlback.='&entity='.$entity; } else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { @@ -315,7 +314,7 @@ function llxFooterVierge() { $urlback.='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2); } - if (! empty($entity)) $urlback.='&entity='.$entity; + } else { @@ -324,6 +323,7 @@ function llxFooterVierge() } } + if (! empty($entity)) $urlback.='&entity='.$entity; dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); Header("Location: ".$urlback); exit; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 1d2d6d2d1e67f..5af112ebfa0db 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2013-2015 Laurent Destailleur + * Copyright (C) 2014 Marcos García * * 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 @@ -46,7 +46,7 @@ $nblignes=$object->fetch_lines(); //If the survey has not yet finished, then it can be modified -$canbemodified = ($object->date_fin > dol_now()); +$canbemodified = (empty($object->date_fin) || $object->date_fin > dol_now()); /* @@ -67,12 +67,12 @@ if (! GETPOST('comment')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Comment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } if (! GETPOST('commentuser')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("User")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } if (! $error) @@ -164,7 +164,7 @@ } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index d31b10ff5ef96..2801ebb8855df 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -146,9 +146,7 @@ print_barre_liste('Title of my list', 3, $_SERVER["PHP_SELF"], '', '', '', 'Text in middle', 20, 5000, '', 0, $nav); -?> -
    '.$langs->trans("Project").''.$langs->trans("ProjectStatus").''.$langs->trans("By").''.$langs->trans("Note").''.$langs->trans("TimeSpent").''.$langs->trans("Value").''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_date($db->jdate($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); + print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); } else { - print dol_print_date($date2?$date2:$date1,($task_time->task_date_withhour?'dayhour':'day')); + print dol_print_date(($date2?$date2:$date1),($task_time->task_date_withhour?'dayhour':'day')); } print '
    -'; $moreforfilter.=$langs->trans('This is a select list for a filter A'). ': '; $cate_arbo = array('field1'=>'value1a into the select list A','field2'=>'value2a'); @@ -175,11 +173,15 @@ if (! empty($moreforfilter)) { - print ''; - print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; } + +print '
    '; + print '
    '; print $moreforfilter; - print '
    '; ?> trans('title1'),0,$_SERVER["PHP_SELF"],'aaa','','','align="left"',$sortfield,$sortorder); ?> @@ -188,7 +190,9 @@ -
    getNomUrl(1); ?>b1c1
    a2b2c2
    +'; +?>
    diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index 5e7b2f2434f03..f1c00f94acf64 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -64,11 +64,9 @@ print '

    '."\n"; -print "Test 4d: a select with ajax refresh
    \n"; -//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); -$array=array(); +print "Test 4d: a select with ajax refresh and with onchange call of url
    \n"; $selected=-1; -print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, ''); +print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1); print '

    '."\n"; diff --git a/htdocs/public/theme/common/nophoto.jpg b/htdocs/public/theme/common/nophoto.jpg deleted file mode 100644 index 14eeb1cf01fcd..0000000000000 Binary files a/htdocs/public/theme/common/nophoto.jpg and /dev/null differ diff --git a/htdocs/public/theme/common/nophoto.png b/htdocs/public/theme/common/nophoto.png new file mode 100644 index 0000000000000..bce088ef78490 Binary files /dev/null and b/htdocs/public/theme/common/nophoto.png differ diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 009ffbfec7583..4e22175d21e85 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -76,7 +76,7 @@ if (empty($ref)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); } if (! $error) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 10f5ab290450c..0318caa665b81 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -299,7 +299,7 @@ // Module to manage customer/supplier code -print load_fiche_titre($langs->trans("CompanyCodeChecker")); +print load_fiche_titre($langs->trans("CompanyCodeChecker"),'',''); print ''."\n"; print ''."\n"; @@ -381,7 +381,7 @@ // Select accountancy code numbering module -print load_fiche_titre($langs->trans("AccountCodeManager")); +print load_fiche_titre($langs->trans("AccountCodeManager"),'',''); print '
    '; print ''; @@ -452,7 +452,7 @@ * Document templates generators */ print '
    '; -print load_fiche_titre($langs->trans("ModelModules")); +print load_fiche_titre($langs->trans("ModelModules"),'',''); // Load array def with activated templates $def = array(); @@ -598,7 +598,7 @@ print '
    '; //IDProf -print load_fiche_titre($langs->trans("CompanyIdProfChecker")); +print load_fiche_titre($langs->trans("CompanyIdProfChecker"),'',''); print '
    '; print ''; @@ -691,7 +691,7 @@ print "

    \n"; -print load_fiche_titre($langs->trans("Other")); +print load_fiche_titre($langs->trans("Other"),'',''); // Autres options $form=new Form($db); @@ -804,6 +804,7 @@ dol_fiche_end(); -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 847c23c671913..3d72ad9d32889 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -80,14 +80,15 @@ dol_fiche_head($head, 'agenda', $langs->trans("ThirdParty"),0,'company'); - print ''; - - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '.$langs->trans("ThirdPartyName").''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; @@ -114,59 +115,40 @@ print ''; } - if (! empty($conf->barcode->enabled)) - { - print ''; - } - - print ""; - - // Zip / Town - print '"; - print '"; - - // Country - if ($object->country) { - print ''; - } - - // EMail - print ''; - - // Web - print ''; - - // Phone / Fax - print ''; - print ''; - print '
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    '.$langs->trans('Gencod').''.$object->barcode.'
    ".$langs->trans('Address').""; - dol_print_address($object->address, 'gmap', 'thirdparty', $object->id); - print "
    '.$langs->trans('Zip').''.$object->zip."'.$langs->trans('Town').''.$object->town."
    '.$langs->trans('Country').''; - //$img=picto_from_langcode($object->country_code); - $img=''; - print ($img?$img.' ':''); - print $object->country; - print '
    '.$langs->trans('EMail').''; - print dol_print_email($object->email,0,$object->id,'AC_EMAIL'); - print '
    '.$langs->trans('Web').''; - print dol_print_url($object->url); - print '
    '.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
    '; print ''; + dol_fiche_end(); - /* + + + /* * Barre d'action */ - print '
    '; + $objthirdparty=$object; + $objcon=new stdClass(); + + $out=''; + $permok=$user->rights->agenda->myactions->create; + if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) + { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + print '
    '; if (! empty($conf->agenda->enabled)) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } else { @@ -178,25 +160,11 @@ print '
    '; - $objthirdparty=$object; - $objcon=new stdClass(); - - $out=''; - $permok=$user->rights->agenda->myactions->create; - if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) - { - $out.=''; - $out.=$langs->trans("AddAnAction").' '; - $out.=img_picto($langs->trans("AddAnAction"),'filenew'); - $out.=""; - } - print load_fiche_titre($langs->trans("ActionsOnCompany"),$out,''); + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); // List of todo actions - show_actions_todo($conf,$langs,$db,$object); + show_actions_todo($conf,$langs,$db,$object,null,0,1); // List of done actions show_actions_done($conf,$langs,$db,$object); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8170c9219279c..5704961039095 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -677,8 +677,8 @@ function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmod $this->localtax1_value=trim($this->localtax1_value); $this->localtax2_value=trim($this->localtax2_value); - $this->capital=price2num(trim($this->capital),'MT'); - if (empty($this->capital) || ! is_numeric($this->capital)) $this->capital = 0; + if ($this->capital != '') $this->capital=price2num(trim($this->capital)); + if (! is_numeric($this->capital)) $this->capital = ''; // '' = undef $this->effectif_id=trim($this->effectif_id); $this->forme_juridique_code=trim($this->forme_juridique_code); @@ -806,7 +806,7 @@ function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmod } else $sql .=",localtax2_value =0.000"; - $sql .= ",capital = ".$this->capital; + $sql .= ",capital = ".($this->capital == '' ? "null" : $this->capital); $sql .= ",prefix_comm = ".(! empty($this->prefix_comm)?"'".$this->db->escape($this->prefix_comm)."'":"null"); @@ -1747,12 +1747,12 @@ function del_commercial(User $user, $commid) * Return a link on thirdparty (with picto) * * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) - * @param string $option Target of link ('', 'customer', 'prospect', 'supplier') + * @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project') * @param int $maxlen Max length of name * @param integer $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) + function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0) { global $conf,$langs; @@ -1760,7 +1760,7 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; - if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) + if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { if (($this->client) && (! empty ( $this->code_client ))) { $code = $this->code_client . ' - '; @@ -1771,9 +1771,7 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) $name =$code.' '.$name; } - if (!empty($this->name_alias)) { - $name .= ' ('.$this->name_alias.')'; - } + if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; $result=''; $label=''; $link=''; $linkend=''; @@ -1795,6 +1793,16 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) $label.= '' . $langs->trans("ShowSupplier") . ''; $link = ''; + $link = ''; + $link = ''; @@ -1814,10 +1822,13 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) } if (! empty($this->name)) + { $label.= '
    ' . $langs->trans('Name') . ': '. $this->name; - if (! empty($this->code_client)) + if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')'; + } + if (! empty($this->code_client) && $this->client) $label.= '
    ' . $langs->trans('CustomerCode') . ': '. $this->code_client; - if (! empty($this->code_fournisseur)) + if (! empty($this->code_fournisseur) && $this->fournisseur) $label.= '
    ' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; if (! empty($this->logo)) @@ -1831,7 +1842,16 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) // Add type of canvas $link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"'; - $link.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"'); + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowCompany"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.=' class="classfortooltip"'; + } $link.='>'; $linkend='
    '; @@ -2438,6 +2458,7 @@ function set_parent($id) $resql=$this->db->query($sql); if ($resql) { + $this->parent = $id; return 1; } else @@ -3393,8 +3414,6 @@ public function setCategories($categories, $type) // Diff if (is_array($existing)) { - var_dump($existing); - var_dump($categories); $to_del = array_diff($existing, $categories); $to_add = array_diff($categories, $existing); } else { @@ -3404,12 +3423,14 @@ public function setCategories($categories, $type) // Process foreach ($to_del as $del) { - $c->fetch($del); - $c->del_type($this, $type_text); + if ($c->fetch($del) > 0) { + $c->del_type($this, $type_text); + } } foreach ($to_add as $add) { - $c->fetch($add); - $c->add_type($this, $type_text); + if ($c->fetch($add) > 0) { + $c->add_type($this, $type_text); + } } return; diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 05679cef5bb22..12a1612ab1df7 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -33,7 +33,7 @@ $langs->load("banks"); // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe','',''); @@ -50,18 +50,18 @@ if ($user->rights->societe->creer) { - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); + $object = new Societe($db); + $object->id = $_GET["socid"]; + $object->fetch($_GET["socid"]); $parameters=array('id'=>$_GET["commid"]); - $reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]); + if (empty($reshook)) $object->add_commercial($user, $_GET["commid"]); - header("Location: commerciaux.php?socid=".$soc->id); + header("Location: commerciaux.php?socid=".$object->id); exit; } else @@ -71,23 +71,23 @@ } } -if($_GET["socid"] && $_GET["delcommid"]) +if ($socid && $_GET["delcommid"]) { $action = 'delete'; if ($user->rights->societe->creer) { - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); + $object = new Societe($db); + $object->id = $_GET["socid"]; + $object->fetch($_GET["socid"]); $parameters=array('id'=>$_GET["delcommid"]); - $reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]); + if (empty($reshook)) $object->del_commercial($user, $_GET["delcommid"]); - header("Location: commerciaux.php?socid=".$soc->id); + header("Location: commerciaux.php?socid=".$object->id); exit; } else @@ -107,63 +107,44 @@ $form = new Form($db); -if ($_GET["socid"]) +if ($socid) { - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $result=$soc->fetch($_GET["socid"]); + $object = new Societe($db); + $result=$object->fetch($socid); $action='view'; - $head=societe_prepare_head2($soc); + $head=societe_prepare_head2($object); dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"),0,'company'); - /* - * Fiche societe en mode visu - */ + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; - print ''; - - print ''; - print ''; + print '
    '; + print '
    '.$langs->trans('ThirdPartyName').''; - print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; print ''; - print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print $soc->code_client; - if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; } print ''; print ''; - print ""; - - print '"; - print '"; - - print ''; - - print ''; - print ''; - - print ''; - // Liste les commerciaux - print ''; + print ''; print '
    '.$langs->trans('CustomerCode').''.$langs->trans('CustomerCode').''.$langs->trans('Prefix').''.$soc->prefix_comm.''.$langs->trans('Prefix').''.$object->prefix_comm.'
    ".$langs->trans('Address')."".nl2br($soc->address)."
    '.$langs->trans('Zip').''.$soc->zip."'.$langs->trans('Town').''.$soc->town."
    '.$langs->trans('Country').''.$soc->country.'
    '.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'
    '.$langs->trans('Web').''; - if ($soc->url) { print 'http://'.$soc->url.''; } - print '
    '.$langs->trans("SalesRepresentatives").'
    '.$langs->trans("SalesRepresentatives").''; $sql = "SELECT u.rowid, u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE sc.fk_soc =".$soc->id; + $sql .= " WHERE sc.fk_soc =".$object->id; $sql .= " AND sc.fk_user = u.rowid"; $sql .= " ORDER BY u.lastname ASC "; dol_syslog('societe/commerciaux.php::list salesman sql = '.$sql,LOG_DEBUG); @@ -177,7 +158,7 @@ { $obj = $db->fetch_object($resql); - $parameters=array('socid'=>$soc->id); + $parameters=array('socid'=>$object->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { @@ -210,6 +191,8 @@ print '
    '; print "
    \n"; + + dol_fiche_end(); if ($user->rights->societe->creer && $user->rights->societe->client->voir) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index e075f67cdafcc..e6207782e9c98 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -116,14 +116,15 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company'); +dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + +print '
    '; + +print '
    '; print ''; -print ''; -print ''; // Alias names (commercial, trademark or alias names) -print ''; +print ''; print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field @@ -173,6 +174,8 @@ } print '
    '.$langs->trans('ThirdPartyName').''; -print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); -print '
    '.$object->name_alias.'
    '; +print '
    '; + dol_fiche_end(); print '
    '; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index f1961e02b2d29..2c951ed86709c 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -109,17 +109,15 @@ $totalsize+=$file['size']; } - - print ''; - - // Ref - print ''; - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '.$langs->trans("ThirdPartyName").''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; @@ -155,6 +153,8 @@ print '
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    '; + print '
    '; + dol_fiche_end(); $modulepart = 'societe'; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 2538b10553678..ebe4b4c034277 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -56,54 +56,43 @@ print '
    '; -/* - * Search area - */ -$rowspan=2; -if (! empty($conf->barcode->enabled)) $rowspan++; -print ''; -print ''; -print ''."\n"; -print ''; -print ''; -print "'; -print ''; -if (! empty($conf->barcode->enabled)) + +// Search thirdparty +if (! empty($conf->societe->enabled) && $user->rights->societe->lire) { - print "'; - //print ''; - print ''; + $listofsearchfields['search_thirdparty']=array('text'=>'Thirdparty'); +} +// Search contact/address +if (! empty($conf->societe->enabled) && $user->rights->societe->lire) +{ + $listofsearchfields['search_contact']=array('text'=>'Contact'); +} + +if (count($listofsearchfields)) +{ + print ''; + print ''; + print '
    '.$langs->trans("SearchThirdparty").'
    "; -print ':
    "; - print ':
    '; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
    '.$langs->trans("Search").'
    :
    '; + print ''; + print '
    '; } -print "
    "; -print ':

    \n"; -/* - * Search contact - */ -$rowspan=2; -if (! empty($conf->barcode->enabled)) $rowspan++; -print '
    '; -print ''."\n"; -print ''."\n"; -print ''; -print ''."\n"; -print "'; -print ''."\n"; -print "'; -//print ''; -print ''."\n"; -print "
    '.$langs->trans("SearchContact").'
    "; -print ':
    "; -print ':

    \n"; /* * Statistics area */ + $third = array( 'customer' => 0, 'prospect' => 0, @@ -154,19 +143,19 @@ if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = "
    '.$langs->trans("Prospects").''.round($third['prospect']).''.$langs->trans("Prospects").''.round($third['prospect']).'
    '.$langs->trans("Customers").''.round($third['customer']).''.$langs->trans("Customers").''.round($third['customer']).'
    '.$langs->trans("Suppliers").''.round($third['supplier']).''.$langs->trans("Suppliers").''.round($third['supplier']).'
    '; + print '
    '; + dol_print_object_info($object); - print '
    '; + print ''; + dol_fiche_end(); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 39b625547b9cf..6c554aa513770 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -31,197 +31,279 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; $langs->load("companies"); $langs->load("customers"); $langs->load("suppliers"); +$langs->load("bills"); // Security check $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user,'societe',$socid,''); +$search_all=trim(GETPOST("sall")); $search_nom=trim(GETPOST("search_nom")); $search_nom_only=trim(GETPOST("search_nom_only")); -$search_all=trim(GETPOST("search_all")); -$sbarcode=trim(GETPOST("sbarcode")); +$search_barcode=trim(GETPOST("sbarcode")); +$search_customer_code=trim(GETPOST('search_customer_code')); +$search_supplier_code=trim(GETPOST('search_supplier_code')); +$search_account_customer_code=trim(GETPOST('search_account_customer_code')); +$search_account_supplier_code=trim(GETPOST('search_account_supplier_code')); $search_town=trim(GETPOST("search_town")); -$socname=trim(GETPOST("socname")); +$search_zip=trim(GETPOST("search_zip")); $search_idprof1=trim(GETPOST('search_idprof1')); $search_idprof2=trim(GETPOST('search_idprof2')); $search_idprof3=trim(GETPOST('search_idprof3')); $search_idprof4=trim(GETPOST('search_idprof4')); $search_idprof5=trim(GETPOST('search_idprof5')); $search_idprof6=trim(GETPOST('search_idprof6')); -$search_sale=trim(GETPOST("search_sale")); -$search_categ=trim(GETPOST("search_categ")); +$search_sale=trim(GETPOST("search_sale",'int')); +$search_categ=trim(GETPOST("search_categ",'int')); $search_type=trim(GETPOST('search_type')); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); +$search_type=GETPOST('search_type','alpha'); $search_status=GETPOST("search_status",'int'); +$search_level_from = GETPOST("search_level_from","alpha"); +$search_level_to = GETPOST("search_level_to","alpha"); +$search_stcomm=GETPOST('search_stcomm','int'); +$type=GETPOST('type'); $optioncss=GETPOST('optioncss','alpha'); $mode=GETPOST("mode"); -$modesearch=GETPOST("mode_search"); +$action=GETPOST('action'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield=GETPOST("sortfield",'alpha'); $sortorder=GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; +$offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('thirdpartylist')); +$contextpage='thirdpartylist'; +/*if ($search_type == '1,3') { $contextpage='customerlist'; $type='c'; } +if ($search_type == '2,3') { $contextpage='prospectlist'; $type='p'; } +if ($search_type == '4') { $contextpage='supplierlist'; $type='f'; } +*/ +if ($type == 'c') { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; } +if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; } +if ($type == 'f') { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; } + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('thirdparty'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 's.nom'=>"ThirdPartyName", + 's.name_alias'=>"AliasNameShort", + 's.code_client'=>"CustomerCode", + "s.code_fournisseur"=>"SupplierCode", + 's.email'=>"EMail", + 's.url'=>"URL", + 's.tva_intra'=>"VATIntra", + 's.siren'=>"ProfId1", + 's.siret'=>"ProfId2", + 's.ape'=>"ProfId3", +); +if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof4']='ProfId4'; +if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof5']='ProfId5'; +if (($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof6']='ProfId6'; +if (!empty($conf->barcode->enabled)) $fieldstosearchall['s.barcode']='Gencod'; + + /* * Actions */ -// special search -if ($mode == 'search') -{ - $search_nom=$socname; - - $sql = "SELECT s.rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - // We'll need this table joined to the select in order to filter by categ - if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - - // For natural search - $scrit = explode(' ', $socname); - - $fields = array( - 's.nom', - 's.code_client', - 's.email', - 's.url', - 's.siren', - 's.name_alias' - ); - - if (!empty($conf->barcode->enabled)) { - $fields[] = 's.barcode'; - } +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - foreach ($scrit as $crit) { - $sql.= natural_search($fields, $crit); - } +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale - if ($search_categ) $sql.= " AND s.rowid = cs.fk_soc"; // Join for the needed table to filter by categ - if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire) +if (empty($reshook)) +{ + if ($action == 'setstcomm') { - if (! $user->rights->fournisseur->lire) $sql.=" AND s.fournisseur != 1"; - } - // Insert sale filter - if ($search_sale) - { - $sql .= " AND sc.fk_user = ".$search_sale; - } - // Insert categ filter - if ($search_categ) - { - $sql .= " AND cs.fk_categorie = ".$search_categ; - } - // Filter on type of thirdparty - if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")"; - if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1"; - if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; + $object = new Client($db); + $result=$object->fetch(GETPOST('stcommsocid')); + $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'); - $result=$db->query($sql); - if ($result) - { - if ($db->num_rows($result) == 1) - { - $obj = $db->fetch_object($result); - $socid = $obj->rowid; - header("Location: ".DOL_URL_ROOT."/societe/soc.php?socid=".$socid); - exit; - } - $db->free($result); + $action=''; } } - - -/* - * View - */ - -$form=new Form($db); -$htmlother=new FormOther($db); -$companystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - - // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_categ=''; $search_sale=''; - $socname=""; - $search_nom=""; - $sbarcode=""; + $search_barcode=""; + $search_customer_code=''; + $search_supplier_code=''; + $search_account_customer_code=''; + $search_account_supplier_code=''; $search_town=""; + $search_zip=""; $search_idprof1=''; $search_idprof2=''; $search_idprof3=''; $search_idprof4=''; + $search_idprof5=''; + $search_idprof6=''; $search_type=''; $search_country=''; $search_type_thirdparty=''; $search_status=''; + $search_stcomm=''; + $search_level_from=''; + $search_level_to=''; + $search_array_options=array(); } if ($search_status=='') $search_status=1; // always display active thirdparty first -if ($socname) -{ - $search_nom=$socname; -} /* - * Mode Liste + * View */ + /* - REM: Regle sur droits "Voir tous les clients" - Utilisateur interne socid=0 + Droits voir tous clients => Voit toute societe - Utilisateur interne socid=0 + Pas de droits voir tous clients => Ne voit que les societes liees comme commercial - Utilisateur externe socid=x + Droits voir tous clients => Ne voit que lui meme - Utilisateur externe socid=x + Pas de droits voir tous clients => Ne voit que lui meme + REM: Rules on permissions to see thirdparties + Internal or External user + No permission to see customers => See nothing + Internal user socid=0 + Permission to see ALL customers => See all thirdparties + Internal user socid=0 + No permission to see ALL customers => See only thirdparties linked to user that are sale representative + External user socid=x + Permission to see ALL customers => Can see only himself + External user socid=x + No permission to see ALL customers => Can see only himself */ + +$form=new Form($db); +$formother=new FormOther($db); +$companystatic=new Societe($db); +$formcompany=new FormCompany($db); +$prospectstatic=new Client($db); +$prospectstatic->client=2; +$prospectstatic->loadCacheOfProspStatus(); + +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$langs->trans("ThirdParty"),$help_url); + + $title=$langs->trans("ListOfThirdParties"); +if ($type == 'c' && (empty($search_type) || ($search_type == '1,3'))) $title=$langs->trans("ListOfCustomers"); +if ($type == 'p' && (empty($search_type) || ($search_type == '2,3'))) $title=$langs->trans("ListOfProspects"); +if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) $title=$langs->trans("ListOfSuppliers"); + +// If both parameters are set, search for everything BETWEEN them +if ($search_level_from != '' && $search_level_to != '') +{ + // Ensure that these parameters are numbers + $search_level_from = (int) $search_level_from; + $search_level_to = (int) $search_level_to; + + // If from is greater than to, reverse orders + if ($search_level_from > $search_level_to) + { + $tmp = $search_level_to; + $search_level_to = $search_level_from; + $search_level_from = $tmp; + } + + // Generate the SQL request + $sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range'; +} +// If only "from" parameter is set, search for everything GREATER THAN it +else if ($search_level_from != '') +{ + // Ensure that this parameter is a number + $search_level_from = (int) $search_level_from; -$sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.datec, s.code_client, s.code_fournisseur, "; -$sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; -$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4"; -$sql.= ",s.fk_pays"; -$sql.= ",typent.code as typent_code"; + // Generate the SQL request + $sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range'; +} +// If only "to" parameter is set, search for everything LOWER THAN it +else if ($search_level_to != '') +{ + // Ensure that this parameter is a number + $search_level_to = (int) $search_level_to; + + // Generate the SQL request + $sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range'; +} +// If no parameters are set, dont search for anything +else +{ + $sortwhere = '0 as is_in_range'; +} + +// Select every potentiels, and note each potentiels which fit in search parameters +dol_syslog('societe/list.php',LOG_DEBUG); +$sql = "SELECT code, label, sortorder, ".$sortwhere; +$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; +$sql.= " WHERE active > 0"; +$sql.= " ORDER BY sortorder"; + +$resql = $db->query($sql); +if ($resql) +{ + $tab_level = array(); + $search_levels = array(); + + while ($obj = $db->fetch_object($resql)) + { + // Compute level text + $level=$langs->trans($obj->code); + if ($level == $obj->code) $level=$langs->trans($obj->label); + + // Put it in the array sorted by sortorder + $tab_level[$obj->sortorder] = $level; + + // If this potentiel fit in parameters, add its code to the $search_levels array + if ($obj->is_in_range == 1) + { + $search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"'; + } + } + + // Implode the $search_levels array so that it can be use in a "IN (...)" where clause. + // If no paramters was set, $search_levels will be empty + $search_levels = implode(',', $search_levels); +} +else dol_print_error($db); + +$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; +$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; +$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,"; +$sql.= " s.tms as date_update, s.datec as date_creation,"; +$sql.= " typent.code as typent_code"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We'll need these fields in order to filter by categ if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc"; -// Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; $sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st"; @@ -236,26 +318,46 @@ if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale if ($search_categ) $sql.= " AND s.rowid = cs.fk_soc"; // Join for the needed table to filter by categ if (! $user->rights->fournisseur->lire) $sql.=" AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible -if ($search_sale) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); -if ($search_categ) $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ); +if ($search_sale) $sql.= " AND sc.fk_user = ".$db->escape($search_sale); +if ($search_categ) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ); +if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all); +if ($search_nom) $sql.= natural_search("s.nom",$search_nom); if ($search_nom_only) $sql.= natural_search("s.nom",$search_nom_only); -if ($search_all) $sql.= natural_search(array("s.nom", "s.name_alias", "s.code_client", "s.code_fournisseur", "s.email", "s.url","s.siren","s.siret","s.ape","s.idprof4","s.idprof5","s.idprof6"), $search_all); -if ($search_nom) $sql.= natural_search(array("s.nom", "s.name_alias", "s.code_client", "s.code_fournisseur", "s.email", "s.url","s.siren","s.siret","s.ape","s.idprof4","s.idprof5","s.idprof6"), $search_nom); -if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'"; -if ($search_idprof1) $sql .= " AND s.siren LIKE '%".$db->escape($search_idprof1)."%'"; -if ($search_idprof2) $sql .= " AND s.siret LIKE '%".$db->escape($search_idprof2)."%'"; -if ($search_idprof3) $sql .= " AND s.ape LIKE '%".$db->escape($search_idprof3)."%'"; -if ($search_idprof4) $sql .= " AND s.idprof4 LIKE '%".$db->escape($search_idprof4)."%'"; -if ($search_idprof5) $sql .= " AND s.idprof5 LIKE '%".$db->escape($search_idprof5)."%'"; -if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idprof6)."%'"; +if ($search_customer_code) $sql.= natural_search("s.code_client",$search_customer_code); +if ($search_supplier_code) $sql.= natural_search("s.code_fournisseur",$search_supplier_code); +if ($search_account_customer_code) $sql.= natural_search("s.code_compta",$search_account_customer_code); +if ($search_account_supplier_code) $sql.= natural_search("s.code_compta_fournisseur",$search_account_supplier_code); +if ($search_town) $sql.= natural_search("s.town",$search_town); +if ($search_zip) $sql.= natural_search("s.zip",$search_zip); +if ($search_idprof1) $sql.= natural_search("s.siren",$search_idprof1); +if ($search_idprof2) $sql.= natural_search("s.siret",$search_idprof2); +if ($search_idprof3) $sql.= natural_search("s.ape",$search_idprof3); +if ($search_idprof4) $sql.= natural_search("s.idprof4",$search_idprof4); +if ($search_idprof5) $sql.= natural_search("s.idprof5",$search_idprof5); +if ($search_idprof6) $sql.= natural_search("s.idprof6",$search_idprof6); // Filter on type of thirdparty if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")"; if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1"; if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); -if (!empty($conf->barcode->enabled) && $sbarcode) $sql.= " AND s.barcode LIKE '%".$db->escape($sbarcode)."%'"; +if (!empty($conf->barcode->enabled) && $search_barcode) $sql.= " AND s.barcode LIKE '%".$db->escape($search_barcode)."%'"; if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; +if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; +if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook @@ -278,20 +380,41 @@ $num = $db->num_rows($resql); $i = 0; - $param = "&socname=".urlencode($socname); - $param.= "&search_nom=".urlencode($search_nom); - $param.= "&search_town=".urlencode($search_town); - $param.= ($sbarcode?"&sbarcode=".urlencode($sbarcode):""); - $param.= '&search_idprof1='.urlencode($search_idprof1); - $param.= '&search_idprof2='.urlencode($search_idprof2); - $param.= '&search_idprof3='.urlencode($search_idprof3); - $param.= '&search_idprof4='.urlencode($search_idprof4); + if ($sall != '') $param = "&sall=".urlencode($sall); + if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ); + if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); + if ($search_nom != '') $param.= "&search_nom=".urlencode($search_nom); + if ($search_town != '') $param.= "&search_town=".urlencode($search_town); + if ($search_zip != '') $param.= "&search_zip=".urlencode($search_zip); + if ($search_country != '') $param.= "&search_country=".urlencode($search_country); + if ($search_customer_code != '') $param.= "&search_customer_code=".urlencode($search_customer_code); + if ($search_supplier_code != '') $param.= "&search_supplier_code=".urlencode($search_supplier_code); + if ($search_account_customer_code != '') $param.= "&search_account_customer_code=".urlencode($search_account_customer_code); + if ($search_account_supplier_code != '') $param.= "&search_account_supplier_code=".urlencode($search_account_supplier_code); + if ($search_barcode != '') $param.= "&sbarcode=".urlencode($search_barcode); + if ($search_idprof1 != '') $param.= '&search_idprof1='.urlencode($search_idprof1); + if ($search_idprof2 != '') $param.= '&search_idprof2='.urlencode($search_idprof2); + if ($search_idprof3 != '') $param.= '&search_idprof3='.urlencode($search_idprof3); + if ($search_idprof4 != '') $param.= '&search_idprof4='.urlencode($search_idprof4); + if ($search_idprof5 != '') $param.= '&search_idprof5='.urlencode($search_idprof5); + if ($search_idprof6 != '') $param.= '&search_idprof6='.urlencode($search_idprof6); if ($search_country != '') $param.='&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_status != '') $params.='&search_status='.urlencode($search_status); - - print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies'); + if ($search_status != '') $param.='&search_status='.urlencode($search_status); + if ($search_stcomm != '') $param.='&search_stcomm='.$search_stcomm; + if ($search_level_from != '') $param.='&search_level_from='.$search_level_from; + if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; + if ($type != '') $param.='&type='.urlencode($type); + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies'); // Show delete result message if (GETPOST('delsoc')) @@ -301,7 +424,7 @@ $langs->load("other"); $textprofid=array(); - foreach(array(1,2,3,4) as $key) + foreach(array(1,2,3,4,5,6) as $key) { $label=$langs->transnoentities("ProfId".$key.$mysoc->country_code); $textprofid[$key]=''; @@ -315,106 +438,269 @@ print '
    '; if ($optioncss != '') print ''; print ''; - - // Filter on categories - /* Not possible in this page because list is for ALL third parties type - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categories::TYPE_CUSTOMER,$search_categ,'search_categ'); - $moreforfilter.='       '; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$htmlother->select_salesrepresentatives($search_sale,'search_sale',$user); - } - if ($moreforfilter) + print ''; + print ''; + print ''; + + if ($search_all) { - print '
    '; - print $moreforfilter; - print '
    '; - - // Lines of titles - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - if (! empty($conf->barcode->enabled)) print_liste_field_titre($langs->trans("BarCode"), $_SERVER["PHP_SELF"], "s.barcode",$param,'','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"),$textprofid[1],1,0),$_SERVER["PHP_SELF"],"s.siren","",$param,'class="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$param,'class="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$param,'class="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$param,'class="nowrap"',$sortfield,$sortorder); - print_liste_field_titre(''); - $parameters=array(); + // Define list of fields to show into list + $checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); + $checkedsuppliercode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); + $checkedcustomeraccountcode=(in_array($contextpage, array('customerlist')) ? 1 : 0); + $checkedsupplieraccountcode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); + $checkedtypetiers=1; + $checkedprofid1=0; + $checkedprofid2=0; + $checkedprofid3=0; + $checkedprofid4=0; + $checkedprofid5=0; + $checkedprofid6=0; + //$checkedprofid4=((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0); + //$checkedprofid5=((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0); + //$checkedprofid6=((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0); + $checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0); + $checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0); + $arrayfields=array( + 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), + 's.code_client'=>array('label'=>$langs->trans("CustomerCodeShort"), 'checked'=>$checkedcustomercode), + 's.code_fournisseur'=>array('label'=>$langs->trans("SupplierCodeShort"), 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))), + 's.code_compta'=>array('label'=>$langs->trans("CustomerAccountancyCodeShort"), 'checked'=>$checkedcustomeraccountcode), + 's.code_compta_fournisseur'=>array('label'=>$langs->trans("SupplierAccountancyCodeShort"), 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))), + 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), + 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), + 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), + 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), + 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>$checkedprofid1), + 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>$checkedprofid2), + 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>$checkedprofid3), + 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4), + 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5), + 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), + 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), + 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), + 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 's.status'=>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 '
    '; + + print ''; + if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['s.barcode']['checked'])) print_liste_field_titre($langs->trans("Gencod"), $_SERVER["PHP_SELF"], "s.barcode",$param,'','',$sortfield,$sortorder); + if (! empty($arrayfields['s.code_client']['checked'])) print_liste_field_titre($arrayfields['s.code_client']['label'],$_SERVER["PHP_SELF"],"s.code_client","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.code_fournisseur']['checked'])) print_liste_field_titre($arrayfields['s.code_fournisseur']['label'],$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.code_compta']['checked'])) print_liste_field_titre($arrayfields['s.code_compta']['label'],$_SERVER["PHP_SELF"],"s.code_compta","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) print_liste_field_titre($arrayfields['s.code_compta_fournisseur']['label'],$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['s.siren']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"),$textprofid[1],1,0),$_SERVER["PHP_SELF"],"s.siren","",$param,'class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.siret']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$param,'class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.ape']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$param,'class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.idprof4']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$param,'class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof5","",$param,'class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof6","",$param,'class="nowrap"',$sortfield,$sortorder); + print_liste_field_titre(''); // type of customer + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; // Fields title search print ''; - print ''; + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + } // Barcode - if (! empty($conf->barcode->enabled)) - { + if (! empty($arrayfields['s.barcode']['checked'])) + { print ''; } - // Town - print ''; - //Country - print ''; - //Company type - print ''; - // IdProf1 - print ''; - // IdProf2 - print ''; - // IdProf3 - print ''; - // IdProf4 - print ''; - // Type (customer/prospect/supplier) - print ''; + } + // Supplier code + if (! empty($arrayfields['s.code_fournisseur']['checked'])) + { + print ''; + } + // Account Customer code + if (! empty($arrayfields['s.code_compta']['checked'])) + { + print ''; + } + // Account Supplier code + if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) + { + print ''; + } + // Town + if (! empty($arrayfields['s.town']['checked'])) + { + print ''; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print ''; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + } + // Company type + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['s.siren']['checked'])) + { + // IdProf1 + print ''; + } + if (! empty($arrayfields['s.siret']['checked'])) + { + // IdProf2 + print ''; + } + if (! empty($arrayfields['s.ape']['checked'])) + { + // IdProf3 + print ''; + } + if (! empty($arrayfields['s.idprof4']['checked'])) + { + // IdProf4 + print ''; + } + if (! empty($arrayfields['s.idprof5']['checked'])) + { + // IdProf5 + print ''; + } + if (! empty($arrayfields['s.idprof6']['checked'])) + { + // IdProf6 + print ''; + } + + // Type (customer/prospect/supplier) + print ''; - - $parameters=array(); + + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) + { + // Prospect level + print ''; + } + + if (! empty($arrayfields['s.fk_stcomm']['checked'])) + { + // Prospect status + print ''; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + // Date creation + if (! empty($arrayfields['s.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['s.tms']['checked'])) + { + print ''; + } // Status - print ''; - + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; + } + // Action column print ''; @@ -446,67 +800,187 @@ { $obj = $db->fetch_object($resql); $var=!$var; - print ""; - print "\n"; + $companystatic->client=$obj->client; + $companystatic->status=$obj->status; + $companystatic->fournisseur=$obj->fournisseur; + $companystatic->code_client=$obj->code_client; + $companystatic->code_fournisseur=$obj->code_fournisseur; + $companystatic->fk_prospectlevel=$obj->fk_prospectlevel; + $companystatic->name_alias=$obj->name_alias; + + print ""; + if (! empty($arrayfields['s.nom']['checked'])) + { + print "\n"; + } // Barcode - if (! empty($conf->barcode->enabled)) + if (! empty($arrayfields['s.barcode']['checked'])) { - print ''; + print ''; } - print "\n"; - //Country - print ''; - //Type ent - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print ''; + } + // Supplier code + if (! empty($arrayfields['s.code_fournisseur']['checked'])) + { + print ''; + } + // Account customer code + if (! empty($arrayfields['s.code_compta']['checked'])) + { + print ''; + } + // Account supplier code + if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) + { + print ''; + } + // Town + if (! empty($arrayfields['s.town']['checked'])) + { + print "\n"; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print "\n"; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + } + // Type ent + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['s.siren']['checked'])) + { + print "\n"; + } + if (! empty($arrayfields['s.siret']['checked'])) + { + print "\n"; + } + if (! empty($arrayfields['s.ape']['checked'])) + { + print "\n"; + } + if (! empty($arrayfields['s.idprof4']['checked'])) + { + print "\n"; + } + if (! empty($arrayfields['s.idprof5']['checked'])) + { + print "\n"; + } + if (! empty($arrayfields['s.idprof6']['checked'])) + { + print "\n"; + } + // Type + print ''; - - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) + { + // Prospect level + print '"; + } + if (! empty($arrayfields['s.fk_stcomm']['checked'])) + { + // Prospect status + print ''; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - - // Status - print ''; - + // Date creation + if (! empty($arrayfields['s.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['s.tms']['checked'])) + { + print ''; + } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; + } + // Action column print ''; print ''."\n"; @@ -515,7 +989,7 @@ $db->free($resql); - $parameters=array('sql' => $sql); + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -532,4 +1006,3 @@ llxFooter(); $db->close(); - diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index c7db3b6664567..ceb5fa6eac51f 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -75,15 +75,15 @@ print ''; print ''; - print '
    '; - print ''; - print ''; - if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; - print ''; + if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; + print ''; + print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print $form->select_country($search_country,'search_country'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + // Customer code + if (! empty($arrayfields['s.code_client']['checked'])) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; + $options_from = ''; // Generate in $options_from the list of each option sorted + foreach ($tab_level as $tab_level_sortorder => $tab_level_label) + { + $options_from .= ''; + } + array_reverse($tab_level, true); // Reverse the list + $options_to = ''; // Generate in $options_to the list of each option sorted in the reversed order + foreach ($tab_level as $tab_level_sortorder => $tab_level_label) + { + $options_to .= ''; + } + + // Print these two select + print $langs->trans("From").' '; + print ' '; + print $langs->trans("to").' '; + + print ''; + $arraystcomm=array(); + foreach($prospectstatic->cacheprospectstatus as $key => $val) + { + $arraystcomm[$val['id']]=$val['label']; + } + print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); + print ''; + print ''; + print ''; + print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; + if ($type != '') print ''; print ''; print ''; print '
    "; + $companystatic->id=$obj->rowid; $companystatic->name=$obj->name; $companystatic->canvas=$obj->canvas; - $companystatic->client=$obj->client; - $companystatic->status=$obj->status; - $companystatic->fournisseur=$obj->fournisseur; - $companystatic->code_client=$obj->code_client; - $companystatic->code_fournisseur=$obj->code_fournisseur; - print $companystatic->getNomUrl(1,'',100); - print "
    "; + print $companystatic->getNomUrl(1,'',100); + print "'.$objp->barcode.''.$obj->barcode.'".$obj->town."'; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print '".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."'; + // Customer code + if (! empty($arrayfields['s.code_client']['checked'])) + { + print ''.$obj->code_client.''.$obj->code_fournisseur.''.$obj->code_compta.''.$obj->code_compta_fournisseur.'".$obj->town."".$obj->zip."'; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print '".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."".$obj->idprof5."".$obj->idprof6."'; $s=''; if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $companystatic->name=$langs->trans("Customer"); + $companystatic->name_alias=''; $s.=$companystatic->getNomUrl(0,'customer'); } if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { if ($s) $s.=" / "; $companystatic->name=$langs->trans("Prospect"); - $s.=$companystatic->getNomUrl(0,'prospect'); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'prospect'); } if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) { if ($s) $s.=" / "; $companystatic->name=$langs->trans("Supplier"); + $companystatic->name_alias=''; $s.=$companystatic->getNomUrl(0,'supplier'); } print $s; print ''; + print $companystatic->getLibProspLevel(); + print "
    '; + print '
    '.$companystatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); + print '
    -
    '; + foreach($prospectstatic->cacheprospectstatus as $key => $val) + { + $titlealt='default'; + if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; + if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; + } + print '
    '.$companystatic->getLibStatut(5).''; + print dol_print_date($obj->date_creation, 'dayhour'); + print ''; + print dol_print_date($obj->date_update, 'dayhour'); + print ''.$companystatic->getLibStatut(3).'
    '; - - print ''; - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '.$langs->trans('ThirdPartyName').''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; @@ -112,9 +112,12 @@ print "
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    "; + print ''; + print '
    '; - $colwidth='25'; + //$colwidth='25'; + $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 483c156907a06..6a6fb7ab1df11 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -68,12 +68,12 @@ if (empty($contactid)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors'); $error++; } if ($actionid <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; } @@ -142,15 +142,15 @@ dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company'); - - print ''; - - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '.$langs->trans("ThirdPartyName").''; - print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; @@ -186,13 +186,17 @@ print ''; print '
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    '; - dol_fiche_end(); - // Help - print $langs->trans("NotificationsDesc").'

    '; + print '
    '.$langs->trans("NotificationsDesc"); + + print ''; + + dol_fiche_end(); print "\n"; + print '
    '; + // Add notification form print load_fiche_titre($langs->trans("AddNewNotification"),'',''); @@ -219,12 +223,12 @@ // Load array of available notifications $notificationtrigger=new InterfaceNotification($db); - $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); + $listofmanagedeventfornotification=$notificationtrigger->getListOfManagedEvents(); - foreach($listofnotifiedevents as $notifiedevent) + foreach($listofmanagedeventfornotification as $managedeventfornotification) { - $label=($langs->trans("Notify_".$notifiedevent['code'])!="Notify_".$notifiedevent['code']?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']); - $actions[$notifiedevent['rowid']]=$label; + $label=($langs->trans("Notify_".$managedeventfornotification['code'])!="Notify_".$managedeventfornotification['code']?$langs->trans("Notify_".$managedeventfornotification['code']):$managedeventfornotification['label']); + $actions[$managedeventfornotification['rowid']]=$label; } print '
    '; print $form->selectarray("contactid",$listofemails); @@ -248,6 +252,7 @@ print '
    '; + print ''; print '
    '; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 20805502c1144..159dcb69d186d 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -120,89 +120,59 @@ $form = new Form($db); -$soc = new Societe($db); +$object = new Societe($db); -$result = $soc->fetch($socid); +$result = $object->fetch($socid); llxHeader("", $langs->trans("ThirdParty") . '-' . $langs->trans('PriceByCustomer')); if (! empty($conf->notification->enabled)) $langs->load("mails"); -$head = societe_prepare_head($soc); +$head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), 0, 'company'); -print ''; +dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + +print '
    '; -print '
    '; +print '
    '; +print '
    ' . $langs->trans("ThirdPartyName") . ''; -print $form->showrefnav($soc, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom'); -print '
    '; // Alias names (commercial, trademark or alias names) -print '"; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; } -if ($soc->client) { +if ($object->client) { print ''; } -if ($soc->fournisseur) { +if ($object->fournisseur) { print ''; } -if (! empty($conf->barcode->enabled)) { - print ''; -} - -print ""; - -// Zip / Town -print '"; -print '"; - -// Country -if ($soc->country) { - print ''; -} - -// EMail -print ''; +print '
    '.$langs->trans('AliasNames').''; -print $soc->name_alias; +print '
    '.$langs->trans('AliasNames').''; +print $object->name_alias; print "
    ' . $langs->trans('Prefix') . '' . $soc->prefix_comm . '
    ' . $langs->trans('Prefix') . '' . $object->prefix_comm . '
    '; print $langs->trans('CustomerCode') . ''; - print $soc->code_client; - if ($soc->check_codeclient() != 0) + print $object->code_client; + if ($object->check_codeclient() != 0) print ' (' . $langs->trans("WrongCustomerCode") . ')'; print '
    '; print $langs->trans('SupplierCode') . ''; - print $soc->code_fournisseur; - if ($soc->check_codefournisseur() != 0) + print $object->code_fournisseur; + if ($object->check_codefournisseur() != 0) print ' (' . $langs->trans("WrongSupplierCode") . ')'; print '
    ' . $langs->trans('Gencod') . '' . $soc->barcode . '
    " . $langs->trans('Address') . ""; -dol_print_address($soc->address, 'gmap', 'thirdparty', $soc->id); -print "
    ' . $langs->trans('Zip') . '' . $soc->zip . "' . $langs->trans('Town') . '' . $soc->town . "
    ' . $langs->trans('Country') . ''; - $img = picto_from_langcode($soc->country_code); - print($img ? $img . ' ' : ''); - print $soc->country; - print '
    ' . $langs->trans('EMail') . ''; -print dol_print_email($soc->email, 0, $soc->id, 'AC_EMAIL'); -print '
    '; -// Web -print '
    ' . $langs->trans('Web') . ''; -print dol_print_url($soc->url); -print '
    ' . $langs->trans('Phone') . '' . dol_print_phone($soc->tel, $soc->country_code, 0, $soc->id, 'AC_TEL') . '' . $langs->trans('Fax') . '' . dol_print_phone($soc->fax, $soc->country_code, 0, $soc->id, 'AC_FAX') . '
    '; -print ''; if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -224,7 +194,7 @@ // Build filter to diplay only concerned lines $filter = array ( - 't.fk_soc' => $soc->id + 't.fk_soc' => $object->id ); $search_soc = GETPOST('search_soc'); @@ -238,10 +208,10 @@ print load_fiche_titre($langs->trans('PriceByCustomer')); - print '
    '; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -316,7 +286,7 @@ setEventMessage($prodcustprice->error, 'errors'); } - print ''; + print ''; print ''; print ''; print ''; @@ -456,108 +426,12 @@ } print "\n" . '
    ' . "\n"; - print ''; + print ''; print "\n

    \n"; - } else { - - // View mode - - // Count total nb of records - $nbtotalofrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); - } - - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); - if ($result < 0) { - setEventMessage($prodcustprice->error, 'errors'); - } - - $option = '&search_soc=' . $search_soc . '&id=' . $object->id; - - print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); - - if (count($prodcustprice->lines) > 0) { - - print ''; - print ''; - - print '
    ' . $langs->trans('Product') . '
    '; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - // Print the search button - print ''; - print ''; - - $var = False; - - foreach($prodcustprice->lines as $line) - { - print ""; - - $staticprod = new Product($db); - $staticprod->fetch($line->fk_product); - - print ""; - print ""; - - print '"; - print '"; - print '"; - print '"; - print ''; - print ''; - - // User - $userstatic = new User($db); - $userstatic->fetch($line->fk_user); - print ''; - - // Todo Edit or delete button - // Action - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - - print "\n"; - } - print "
    ' . $langs->trans("Product") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
     '; - print ''; - print '
    " . $staticprod->getNomUrl(1) . "" . dol_print_date($line->datec, "dayhour") . "' . $langs->trans($line->price_base_type) . "' . vatrate($line->tva_tx, true, $line->recuperableonly) . "' . price($line->price) . "' . price($line->price_ttc) . "' . price($line->price_min) . '' . price($line->price_min_ttc) . ''; - print $userstatic->getLoginUrl(1); - print ''; - print 'id . '&prodid=' . $line->fk_product . '">'; - print img_info(); - print ''; - print ' '; - print 'id . '&lineid=' . $line->id . '">'; - print img_edit('default', 0, 'style="vertical-align: middle;"'); - print ''; - print ' '; - print 'id . '&lineid=' . $line->id . '">'; - print img_delete('default', 'style="vertical-align: middle;"'); - print ''; - print '
    "; - - print "
    "; - } else { - print $langs->trans('None'); - } + } + else + { + // View mode /* ************************************************************************** */ /* */ @@ -568,9 +442,114 @@ print "\n" . '
    ' . "\n"; if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } - print "\n

    \n"; + print "\n\n"; + + + // Count total nb of records + $nbtotalofrecords = 0; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); + } + + $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + if ($result < 0) + { + setEventMessage($prodcustprice->error, 'errors'); + } + + $option = '&search_soc=' . $search_soc . '&id=' . $object->id; + + print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, ''); + + print '
    '; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if (count($prodcustprice->lines) > 0) + { + + print ''; + print ''; + print ''; + // Print the search button + print ''; + print ''; + + $var = False; + + foreach ($prodcustprice->lines as $line) + { + print ""; + + $staticprod = new Product($db); + $staticprod->fetch($line->fk_product); + + print ""; + print ""; + + print '"; + print '"; + print '"; + print '"; + print ''; + print ''; + + // User + $userstatic = new User($db); + $userstatic->fetch($line->fk_user); + print ''; + + // Todo Edit or delete button + // Action + if ($user->rights->produit->creer || $user->rights->service->creer) + { + print ''; + } + + print "\n"; + } + } else + { + print ''; + } + + print "
    ' . $langs->trans("Product") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
     '; + print ''; + print '
    " . $staticprod->getNomUrl(1) . "" . dol_print_date($line->datec, "dayhour") . "' . $langs->trans($line->price_base_type) . "' . vatrate($line->tva_tx, true, $line->recuperableonly) . "' . price($line->price) . "' . price($line->price_ttc) . "' . price($line->price_min) . '' . price($line->price_min_ttc) . ''; + print $userstatic->getLoginUrl(1); + print ''; + print 'id . '&prodid=' . $line->fk_product . '">'; + print img_info(); + print ''; + print ' '; + print 'id . '&lineid=' . $line->id . '">'; + print img_edit('default', 0, 'style="vertical-align: middle;"'); + print ''; + print ' '; + print 'id . '&lineid=' . $line->id . '">'; + print img_delete('default', 'style="vertical-align: middle;"'); + print ''; + print '
    ' . $langs->trans('NoPriceSpecificToCustomer') . '
    "; + + print "
    "; + } } diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php new file mode 100644 index 0000000000000..6eb9765d034c2 --- /dev/null +++ b/htdocs/societe/project.php @@ -0,0 +1,156 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/project.php + * \ingroup societe + * \brief Page of third party projects + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + +$langs->load("companies"); + +// Security check +$socid = GETPOST('socid','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $socid, '&societe'); + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('projectthirdparty')); + + +/* + * Actions + */ + +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +if ($socid) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $langs->load("companies"); + + + $object = new Societe($db); + $result = $object->fetch($socid); + + $title=$langs->trans("Agenda"); + if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + llxHeader('',$title); + + if (! empty($conf->notification->enabled)) $langs->load("mails"); + $head = societe_prepare_head($object); + + dol_fiche_head($head, 'project', $langs->trans("ThirdParty"),0,'company'); + + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print ''; + + // Alias names (commercial, trademark or alias names) + print '"; + + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + + if ($object->client) + { + print ''; + } + + if ($object->fournisseur) + { + print ''; + } + + print '
    '.$langs->trans('AliasNames').''; + print $object->name_alias; + print "
    '.$langs->trans('Prefix').''.$object->prefix_comm.'
    '; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
    '; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
    '; + + print '
    '; + + dol_fiche_end(); + + + /* + * Barre d'action + */ + + print '
    '; + + if (! empty($conf->projet->enabled)) + { + if (! empty($conf->projet->enabled) && ! empty($user->rights->projet->creer)) + { + print ''.$langs->trans("AddProject").''; + } + else + { + print ''.$langs->trans("AddProject").''; + } + } + + print '
    '; + + + print '
    '; + + + // Projects list + $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1); +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index ee4259f2e8179..65e61b458cb10 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -42,9 +42,8 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe','',''); -$soc = new Societe($db); -$soc->id = $_GET["socid"]; -$soc->fetch($_GET["socid"]); +$object = new Societe($db); +$object->fetch($socid); $id=GETPOST("id","int"); $ribid=GETPOST("ribid","int"); @@ -62,7 +61,7 @@ $account->fetch($id); - $account->socid = $soc->id; + $account->socid = $object->id; $account->bank = $_POST["bank"]; $account->label = $_POST["label"]; @@ -93,7 +92,7 @@ $account->setAsDefault($id); // This will make sure there is only one default rib } - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id; + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; header('Location: '.$url); exit; } @@ -105,13 +104,13 @@ if (! GETPOST('label')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Label')),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); $action='create'; $error++; } if (! GETPOST('bank')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('BankName')),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); $action='create'; $error++; } @@ -121,7 +120,7 @@ // Ajout $account = new CompanyBankAccount($db); - $account->socid = $soc->id; + $account->socid = $object->id; $account->bank = $_POST["bank"]; $account->label = $_POST["label"]; @@ -146,7 +145,7 @@ } else { - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id; + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; header('Location: '.$url); exit; } @@ -159,7 +158,7 @@ $res = $account->setAsDefault(GETPOST('ribid','int')); if ($res) { - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id; + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; header('Location: '.$url); exit; } else { @@ -175,7 +174,7 @@ $result = $account->delete($user); if ($result > 0) { - $url = $_SERVER['PHP_SELF']."?socid=".$soc->id; + $url = $_SERVER['PHP_SELF']."?socid=".$object->id; header('Location: '.$url); exit; } @@ -200,27 +199,27 @@ llxHeader(); -$head=societe_prepare_head2($soc); +$head=societe_prepare_head2($object); $account = new CompanyBankAccount($db); if (! $id) - $account->fetch(0,$soc->id); + $account->fetch(0,$object->id); else $account->fetch($id); -if (empty($account->socid)) $account->socid=$soc->id; +if (empty($account->socid)) $account->socid=$object->id; if ($socid && $action == 'edit' && $user->rights->societe->creer) { - print '
    '; + print ''; print ''; print ''; print ''; } if ($socid && $action == 'create' && $user->rights->societe->creer) { - print ''; + print ''; print ''; print ''; } @@ -234,17 +233,22 @@ // Confirm delete third party if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$soc->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1); } - print load_fiche_titre($langs->trans("DefaultRIB")); + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print load_fiche_titre($langs->trans("DefaultRIB"), '', ''); - print ''; + print '
    '; + print '
    '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Show fields of bank account @@ -350,7 +354,9 @@ print '
    '.$langs->trans("RIBControlError").'
    '; } - print "
    "; + print ""; + + dol_fiche_end(); /* @@ -359,7 +365,7 @@ print load_fiche_titre($langs->trans("AllRIB")); - $rib_list = $soc->get_all_rib(); + $rib_list = $object->get_all_rib(); $var = false; if (is_array($rib_list)) { @@ -397,7 +403,7 @@ if (! empty($conf->prelevement->enabled)) { // RUM - print ''; + print ''; // FRSTRECUR print ''; @@ -406,7 +412,7 @@ // Default print ''; print ''; print ''; print ''; print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; print ""; $i++; @@ -193,6 +207,7 @@ print '
    '.$langs->trans("LabelRIB").'
    '.$langs->trans("LabelRIB").''.$account->label.'
    '.$langs->trans("BankName").'
    '.$langs->trans("BankName").''.$account->bank.'
    '.$prelevement->buildRumNumber($soc->code_client, $rib->datec, $rib->id).''.$prelevement->buildRumNumber($object->code_client, $rib->datec, $rib->id).''.$rib->frstrecur.''; if (!$rib->default_rib) { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'off'); print ''; } else { @@ -418,13 +424,13 @@ print ''; if ($user->rights->societe->creer) { - print ''; + print ''; print img_picto($langs->trans("Modify"),'edit'); print ''; print ' '; - print ''; + print ''; print img_picto($langs->trans("Delete"),'delete'); print ''; } @@ -444,7 +450,6 @@ dol_print_error($db); } - dol_fiche_end(); } // Edit @@ -452,7 +457,12 @@ { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - print ''; + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '; print ''; print ''; @@ -551,7 +561,7 @@ print '
    '.$langs->trans("LabelRIB").'
    '; - if (empty($account->rum)) $account->rum = $prelevement->buildRumNumber($soc->code_client, $account->datec, $account->id); + if (empty($account->rum)) $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); // RUM print ''; @@ -564,7 +574,9 @@ print '
    '.$langs->trans("RUM").'
    '; } - dol_fiche_end(); + print ''; + + dol_fiche_end(); print '
    '; print ''; @@ -579,8 +591,12 @@ { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - print ''; - + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '; print ''; print ''; @@ -657,6 +673,8 @@ print '
    '.$langs->trans("LabelRIB").'
    '; } + print '
    '; + dol_fiche_end(); print '
    '; @@ -686,7 +704,7 @@ if ($user->rights->societe->creer) { - print ''.$langs->trans("Add").''; + print ''.$langs->trans("Add").''; } print '
    '; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 0411e974f2d92..8b640040b80ea 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -240,6 +240,26 @@ { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (! GETPOST('name')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); + $error++; + $action='create'; + } + if (GETPOST('client') < 0) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); + $error++; + $action='create'; + } + if (GETPOST('fournisseur') < 0) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); + $error++; + $action='create'; + } + + if ($action == 'update') { $ret=$object->fetch($socid); @@ -660,6 +680,7 @@ // Set parent company if ($action == 'set_thirdparty' && $user->rights->societe->creer) { + $object->fetch($socid); $result = $object->set_parent(GETPOST('editparentcompany','int')); } @@ -781,7 +802,7 @@ $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->capital = GETPOST('capital', 'int'); + $object->capital = GETPOST('capital', 'alpha'); $object->barcode = GETPOST('barcode', 'alpha'); $object->idprof1 = GETPOST('idprof1', 'alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha'); @@ -962,10 +983,11 @@ print '
    '.fieldLabel('ProspectCustomer','customerprospect',1).''.fieldLabel('CustomerCode','customer_code').''; @@ -984,7 +1006,7 @@ // Supplier print '
    '.fieldLabel('Supplier','fournisseur',1).''; - print $form->selectyesno("fournisseur",(isset($_POST['fournisseur'])?GETPOST('fournisseur'):$object->fournisseur),1); + print $form->selectyesno("fournisseur", (isset($_POST['fournisseur'])?GETPOST('fournisseur'):(GETPOST("type") == '' ? -1 : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0)); print ''.fieldLabel('SupplierCode','supplier_code').''; print '
    '; @@ -1330,7 +1352,7 @@ $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->capital = GETPOST('capital', 'int'); + $object->capital = GETPOST('capital', 'alpha'); $object->idprof1 = GETPOST('idprof1', 'alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha'); $object->idprof3 = GETPOST('idprof3', 'alpha'); @@ -1447,6 +1469,14 @@ print ''; + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + } + // Name print ''; print ''; @@ -1727,7 +1757,7 @@ // Capital print ''; - print ''; + print ''; // Default language if (! empty($conf->global->MAIN_MULTILANGS)) @@ -1863,54 +1893,35 @@ dol_htmloutput_errors($error,$errors); - $showlogo=$object->logo; - $showbarcode=empty($conf->barcode->enabled)?0:1; - if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - - print '
    '.$langs->trans("ID").''; + print $object->ref; + print '
    '.fieldLabel('ThirdPartyName','name',1).'
    '.fieldLabel('Capital','capital').''.$langs->trans("Currency".$conf->currency).'
    '.$langs->trans("Currency".$conf->currency).'
    '; - - // Ref - /* - print ''; - print ''; - print ''; - */ - - // Name - print ''; - print ''; - print ''; + + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + + print '
    '; + print '
    '; + + print '
    '; + print '
    '.$langs->trans("Ref").''; - print $fuser->id; - print '
    '.$langs->trans('ThirdPartyName').''; - print $form->showrefnav($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; - // Logo+barcode - $rowspan=6; - if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++; - if (! empty($object->client)) $rowspan++; - if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++; - if (! empty($conf->barcode->enabled)) $rowspan++; - if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; - $htmllogobar=''; - if ($showlogo || $showbarcode) - { - $htmllogobar.=''; - } - - // Prefix + // Prospect/Customer + print ''; + + // Prospect/Customer + print ''; + + // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; print $htmllogobar; $htmllogobar=''; print ''; } @@ -1919,7 +1930,7 @@ if ($object->client) { print ''; @@ -1931,7 +1942,7 @@ if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) { print ''; @@ -1943,71 +1954,14 @@ if (! empty($conf->barcode->enabled)) { print ''; - print $htmllogobar; $htmllogobar=''; + if ($htmllogobar) $htmllogobar.=$form->showbarcode($object); + print $htmllogobar; + $htmllogobar=''; print ''; } - // Status - print ''; - print ''; - print $htmllogobar; $htmllogobar=''; - print ''; - - // Address - print ''; - - // Zip / Town - print ''; - print ''; - - // Country - print ''; - - // State - if (empty($conf->global->SOCIETE_DISABLE_STATE)) print ''; - - // EMail - print ''; - - // Web - print ''; - - // Skype - if (! empty($conf->skype->enabled)) - { - print ''; - } - - // Phone / Fax - print ''; - print ''; - // Prof ids $i=1; $j=0; while ($i <= 6) @@ -2015,8 +1969,9 @@ $idprof=$langs->transcountry('ProfId'.$i,$object->country_code); if ($idprof!='-') { - if (($j % 2) == 0) print ''; - print ''; + print ''; + print ''; - if (($j % 2) == 1) print ''; + //if (($j % 2) == 1) print ''; + print ''; $j++; } $i++; } - if ($j % 2 == 1) print ''; + //if ($j % 2 == 1) print ''; // VAT payers print ''; - + print ''; + // VAT Code - print ''; + print ''; @@ -2123,7 +2081,7 @@ } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print ''; if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) @@ -2145,7 +2103,7 @@ } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print ''; if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) @@ -2177,22 +2135,31 @@ // Type + Staff $arr = $formcompany->typent_array(1); $object->typent= $arr[$object->typent_code]; - print ''; + print ''; + print ''; // Legal - print ''; + print ''; // Capital - print ''; + print '
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    '; - if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object); - if ($showlogo && $showbarcode) $htmllogobar.='

    '; - if ($showbarcode) $htmllogobar.=$form->showbarcode($object); - $htmllogobar.='
    '.$langs->trans('ProspectCustomer').''; + print $object->getLibCustProspStatut(); + print '
    '.$langs->trans('Supplier').''; + print yn($object->fournisseur); + print '
    '.$langs->trans('Prefix').''.$object->prefix_comm.'
    '.$langs->trans('Prefix').''.$object->prefix_comm.'
    '; - print $langs->trans('CustomerCode').''; + print $langs->trans('CustomerCode').''; print $object->code_client; if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; print '
    '; - print $langs->trans('SupplierCode').''; + print $langs->trans('SupplierCode').''; print $object->code_fournisseur; if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; print '
    '; - print $langs->trans('Gencod').''.$object->barcode; + print $langs->trans('Gencod').''.$object->barcode; print '
    '.$langs->trans("Status").''; - if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); - } else { - print $object->getLibStatut(2); - } - print '
    '.$langs->trans('Address').''; - dol_print_address($object->address,'gmap','thirdparty',$object->id); - print '
    '.$langs->trans('Zip').' / '.$langs->trans("Town").''; - print $object->zip.($object->zip && $object->town?" / ":"").$object->town; - print '
    '.$langs->trans("Country").''; - if (! empty($object->country_code)) - { - //$img=picto_from_langcode($object->country_code); - $img=''; - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; - } - print '
    '.$langs->trans('State').''.$object->state.'
    '.$langs->trans('EMail').''; - print dol_print_email($object->email,0,$object->id,'AC_EMAIL'); - print '
    '.$langs->trans('Web').''; - print dol_print_url($object->url); - print '
    '.$langs->trans('Skype').''; - print dol_print_skype($object->skype,0,$object->id,'AC_SKYPE'); - print '
    '.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
    '.$idprof.''; + //if (($j % 2) == 0) print '
    '.$idprof.''; $key='idprof'.$i; print $object->$key; if ($object->$key) @@ -2025,12 +1980,13 @@ else print ' ('.$langs->trans("ErrorWrongValue").')'; } print '
    '; @@ -2038,9 +1994,11 @@ print ''; print yn($object->tva_assuj); print '
    '.$langs->trans('VATIntra').''; + print '
    '.$langs->trans('VATIntra').''; if ($object->tva_intra) { $s=''; @@ -2083,7 +2041,7 @@ { print '
    '.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; print yn($object->localtax1_assuj); - print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print '
    '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print yn($object->localtax2_assuj); print '
    '.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print '
    '.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; print yn($object->localtax1_assuj); print '
    '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print '
    '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print yn($object->localtax2_assuj); print '
    '.$langs->trans("ThirdPartyType").''.$object->typent.''.$langs->trans("Staff").''.$object->effectif.'
    '.$langs->trans("ThirdPartyType").''.$object->typent.'
    '.$langs->trans("Staff").''.$object->effectif.'
    '.$langs->trans('JuridicalStatus').''.$object->forme_juridique.'
    '.$langs->trans('JuridicalStatus').''.$object->forme_juridique.'
    '.$langs->trans('Capital').''; + print '
    '.$langs->trans('Capital').''; if ($object->capital) print price($object->capital,'',$langs,0,-1,-1, $conf->currency); else print ' '; print '
    '; + + print ''; + print '
    '; + + print '
    '; + print ''; + // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''; - print '"; } @@ -2215,7 +2182,7 @@ // Supplier if ($object->fournisseur) { print ''; - print '"; } @@ -2299,7 +2266,7 @@ if (! empty($conf->adherent->enabled)) { $langs->load("members"); - print ''; + print ''; print '
    '.$langs->trans("DefaultLang").''; + print '
    '.$langs->trans("DefaultLang").''; //$s=picto_from_langcode($object->default_lang); //print ($s?$s.' ':''); $langs->load("languages"); @@ -2207,7 +2174,7 @@ // Customer if ($object->prospect || $object->client) { print '
    ' . $langs->trans("CustomersCategoriesShort") . ''; + print ''; print $form->showCategories($object->id, 'customer', 1); print "
    ' . $langs->trans("SuppliersCategoriesShort") . ''; + print ''; print $form->showCategories($object->id, 'supplier', 1); print "
    '.$langs->trans("LinkedToDolibarrMember").'
    '.$langs->trans("LinkedToDolibarrMember").''; $adh=new Adherent($db); $result=$adh->fetch('','',$object->id); @@ -2323,7 +2290,11 @@ } print '
    '; - + print '
    '; + + print '
    '; + print '
    '; + dol_fiche_end(); @@ -2520,9 +2491,6 @@ { $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } - - // Projects list - $result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 4d2382e6eee17..691f930b7671b 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -148,14 +148,16 @@ print ''; print ''; - print ''; - print ''; - print ''; + + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print '
    '.$langs->trans('ThirdPartyName').''; - print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom'); - print '
    '; // Alias names (commercial, trademark or alias names) - print '"; @@ -181,7 +183,11 @@ if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; print ''; } - print '
    '.$langs->trans('AliasNames').''; + print '
    '.$langs->trans('AliasNames').''; print $object->name_alias; print "
    '; + print '
    '; + + print ''; + + print ''; print '
    '; // Contacts lines (modules that overwrite templates must declare this into descriptor) diff --git a/htdocs/theme/common/gmap.png b/htdocs/theme/common/gmap.png index 4636e2c848f00..0423a91295654 100644 Binary files a/htdocs/theme/common/gmap.png and b/htdocs/theme/common/gmap.png differ diff --git a/htdocs/theme/eldy/img/list.png b/htdocs/theme/eldy/img/list.png new file mode 100644 index 0000000000000..f5df34a3bc9f8 Binary files /dev/null and b/htdocs/theme/eldy/img/list.png differ diff --git a/htdocs/theme/eldy/img/object_building.png b/htdocs/theme/eldy/img/object_building.png new file mode 100644 index 0000000000000..c9d1539dddcdc Binary files /dev/null and b/htdocs/theme/eldy/img/object_building.png differ diff --git a/htdocs/theme/eldy/img/object_contact.png b/htdocs/theme/eldy/img/object_contact.png index e98202b367d15..d4272f367c6e5 100644 Binary files a/htdocs/theme/eldy/img/object_contact.png and b/htdocs/theme/eldy/img/object_contact.png differ diff --git a/htdocs/theme/eldy/img/object_group.png b/htdocs/theme/eldy/img/object_group.png index 552eb39fa3149..be0255f7ec267 100644 Binary files a/htdocs/theme/eldy/img/object_group.png and b/htdocs/theme/eldy/img/object_group.png differ diff --git a/htdocs/theme/eldy/img/object_user.png b/htdocs/theme/eldy/img/object_user.png index d26d8899ee80f..efd446a1a4c05 100644 Binary files a/htdocs/theme/eldy/img/object_user.png and b/htdocs/theme/eldy/img/object_user.png differ diff --git a/htdocs/theme/eldy/img/sort_asc.png b/htdocs/theme/eldy/img/sort_asc.png index aca0f6eb77aa8..82b250c72bd73 100644 Binary files a/htdocs/theme/eldy/img/sort_asc.png and b/htdocs/theme/eldy/img/sort_asc.png differ diff --git a/htdocs/theme/eldy/img/sort_desc.png b/htdocs/theme/eldy/img/sort_desc.png index 57c1ad0fcb41a..a5aa5f4e50653 100644 Binary files a/htdocs/theme/eldy/img/sort_desc.png and b/htdocs/theme/eldy/img/sort_desc.png differ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c7bb3e0fb91ed..ce83c4c41f2e4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -90,11 +90,14 @@ $colorbacklinepair2='248,248,248'; // line pair $colorbacklinepairhover='238,246,252'; // line pair $colorbackbody='255,255,255'; -$colortext='40,40,40'; +//$colortexttitlenotab='40,0,70'; +$colortexttitlenotab='80,80,0'; +$colortexttitle=''; +$colortext=''; $fontsize='12'; $fontsizesmaller='11'; $usegradient=1; - +$useboldtitle=1; // Case of option always editable if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='140,150,180'; // topmenu (140,160,185) @@ -116,6 +119,8 @@ $conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_USE_HOVER=='238,246,252'; $conf->global->THEME_ELDY_BACKBODY='255,255,255'; + //$conf->global->THEME_ELDY_TEXTTITLE='0,0,0'; + $conf->global->THEME_ELDY_TEXT='0,0,0'; $conf->global->THEME_ELDY_FONT_SIZE1='12'; $conf->global->THEME_ELDY_FONT_SIZE2='11'; @@ -135,6 +140,7 @@ $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); $colorbacklinepairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortexttitle =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLE) ?$colortext:$conf->global->THEME_ELDY_TEXTTITLE) :(empty($user->conf->THEME_ELDY_TEXTTITLE)?$colortexttitle:$user->conf->THEME_ELDY_TEXTTITLE); $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); $fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); @@ -146,6 +152,31 @@ $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); } +// Set text color to black or white +$tmppart=explode(',',$colorbackhmenu1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; +else $colortextbackhmenu='000000'; + +$tmppart=explode(',',$colorbackvmenu1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } +else { $colortextbackvmenu='000000'; } + +$tmppart=explode(',',$colorbacktitle1); +if ($colortexttitle == '') +{ + $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); + if ($tmpval <= 360) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } + else { $colortexttitle='000000'; $colorshadowtitle='FFFFFF'; } +} + +$tmppart=explode(',',$colorbacktabcard1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } +else { $colortextbacktab='111111'; } + + // Format color value to match expected format (may be 'FFFFFF' or '255,255,255') $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); $colorbackvmenu1=join(',',colorStringToArray($colorbackvmenu1)); @@ -158,26 +189,9 @@ $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); +$colortexttitle=join(',',colorStringToArray($colortexttitle)); $colortext=join(',',colorStringToArray($colortext)); -// Set text color to black or white -$tmppart=explode(',',$colorbackhmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) $colortextbackhmenu='FFF'; -else $colortextbackhmenu='222'; -$tmppart=explode(',',$colorbackvmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) { $colortextbackvmenu='FFF'; } -else { $colortextbackvmenu='222'; } -$tmppart=explode(',',$colorbacktitle1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) { $colortexttitle='FFF'; $colorshadowtitle='888'; } -else { $colortexttitle='222'; $colorshadowtitle='FFF'; } -$tmppart=explode(',',$colorbacktabcard1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 340) { $colortextbacktab='FFF'; } -else { $colortextbacktab='111'; } - print '/*'."\n"; print 'colorbackbody='.$colorbackbody."\n"; print 'colorbackvmenu1='.$colorbackvmenu1."\n"; @@ -188,6 +202,8 @@ print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print '$colortexttitle='.$colortexttitle."\n"; +print '$colortext='.$colortext."\n"; print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; @@ -221,7 +237,7 @@ trans("DIRECTION").";\n"; ?> } -a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #4A4A4A; text-decoration: none; } +a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #000; text-decoration: none; } a:hover { text-decoration: underline; color: #000000;} @@ -452,8 +468,10 @@ div.divsearchfield { float: ; margin-: 12px; - margin-top: 1px; - margin-bottom: 2px; + margin-: 2px; + margin-top: 4px; + margin-bottom: 4px; + padding-left: 2px; } div.confirmmessage { padding-top: 6px; @@ -487,6 +505,7 @@ .maxwidth100 { max-width: 100px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } +.titlefield { width: 30%; } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } @@ -494,6 +513,7 @@ .maxwidth100onsmartphone { max-width: 100px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } +.titlefield { width: auto; } .linkobject { cursor: pointer; } @@ -535,7 +555,7 @@ float: none; vertical-align: top; } -#id-right { /* This must stay id-right ant not be replaced with echo $right */ +#id-right { /* This must stay id-right and not be replaced with echo $right */ width: 100%; } #id-left { @@ -604,6 +624,43 @@ padding-bottom: 10px; } +div.arearef { + /*border-bottom: 1px solid #bbb;*/ + padding-top: 2px; + padding-bottom: 5px; + /*padding-right: 3px; + padding-left: 2px;*/ + margin-bottom: 10px; +} +div.heightref { + min-height: 80px; +} +div.divphotoref { + padding-right: 20px; +} +div.statusref { + float: right; + padding-right: 12px; + margin-top: 6px; + margin-bottom: 10px; +} +img.photoref { + border: 1px solid #CCC; + -moz-box-shadow: 3px 3px 4px #DDD; + -webkit-box-shadow: 3px 3px 4px #DDD; + box-shadow: 3px 3px 4px #DDD; + padding: 4px; + height: 80px; + width: 80px; + object-fit: contain +} +.underrefbanner { +} +.underbanner { + border-bottom: 2px solid #888; +} + + /* ============================================================================== */ /* Menu top et 1ere ligne tableau */ /* ============================================================================== */ @@ -614,7 +671,7 @@ $heightmenu2=48; /* height of top menu, part with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE) || $dol_optimize_smallscreen) { $disableimages = 1; $maxwidthloginblock = 180; } +if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; } ?> div#id-top { @@ -623,12 +680,12 @@ background: rgb(); - background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); + background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); height: 28px; @@ -642,7 +699,7 @@ display:none; - padding-: px; + padding-: px; } @@ -702,12 +759,12 @@ ul.tmenu li { /* We need this to have background color when menu entry wraps on new lines */ background: rgb(); - background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); + background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); } li.tmenu, li.tmenusel { @@ -725,11 +782,11 @@ font-weight: normal; } li.tmenusel, li.tmenu:hover { - background-image: -o-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: -moz-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0) 100%) !important; - background-image: -ms-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; + background-image: -o-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.5) 100%) !important; + background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.5) 0%, rgba(250,250,250,0) 100%) !important; + background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.5) 0%, rgba(250,250,250,0) 100%) !important; + background-image: -ms-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.5) 100%) !important; + background-image: linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.5) 100%) !important; background: rgb(); } .tmenuend .tmenuleft { width: 0px; } @@ -831,7 +888,6 @@ div.mainmenu.products { background-image: url(); - margin-left: 10px; } div.mainmenu.project { @@ -861,7 +917,7 @@ $mainmenuusedarray=array_unique(explode(',',$mainmenuused)); $generic=1; -$divalreadydefined=array('home','companies','products','commercial','accountancy','project','tools','members','agenda','holiday','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','webservices'); +$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','holiday','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','webservices'); foreach($mainmenuusedarray as $val) { if (empty($val) || in_array($val,$divalreadydefined)) continue; @@ -1031,13 +1087,16 @@ padding: 0px 0px 0px 4px !important; height: 16px; } +.atoplogin, .atoplogin:hover { + color: # !important; + font-weight: normal !important; +} .alogin, .alogin:hover { - color: # !important; font-weight: normal !important; font-size: px !important; padding-top: 2px; } -.alogin:hover { +.alogin:hover, .atoplogin:hover { text-decoration:underline !important; } img.login, img.printer, img.entity { @@ -1086,7 +1145,14 @@ } -.menu_contenu { padding-top: 3px; padding-top: 2px; } +.vmenusearchselectcombo { + width: 172px; +} + +.menu_contenu { + padding-top: 3px; + padding-bottom: 2px; +} #menu_contenu_logo { padding-right: 4px; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; } @@ -1157,17 +1223,17 @@ color: #000000; text-align: ; text-decoration: none; - padding-left: 5px; + /*padding-left: 5px; padding-right: 1px; padding-top: 3px; - padding-bottom: 3px; - margin: 1px 0px 8px 2px; + padding-bottom: 3px; */ + margin: 1px 0px 4px 2px; background: rgb(); - border-left: 1px solid #AAA; + /*border-left: 1px solid #AAA; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; - border-top: 1px solid #BBB; + border-top: 1px solid #BBB;*/ /*border-radius: 4px; -moz-border-radius: 4px; -moz-box-shadow: 3px 3px 4px #DDD; @@ -1492,10 +1558,10 @@ div.tabBar { color: #; - padding-top: px; - padding-left: px; - padding-right: px; - padding-bottom: px; + padding-top: px; + padding-left: px; + padding-right: px; + padding-bottom: px; margin: 0px 0px 14px 0px; -moz-border-radius:4px; -webkit-border-radius: 4px; @@ -1514,7 +1580,16 @@ box-shadow: 3px 3px 4px #DDD; } - +div.popuptabset { + padding: 6px; + border: 1px solid #888; +} +div.popuptab { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 5px; + padding-right: 5px; +} div.tabsAction { margin: 20px 0em 10px 0em; padding: 0em 0em; @@ -1560,9 +1635,11 @@ -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); box-shadow: 0 -1px 4px rgba(0,0,0,.1); margin-bottom: 0 0.2em 0 0.2em !important; + border-right: 1px solid #AAA !important; border-left: 1px solid #AAA !important; border-top: 1px solid #BBB !important; + -moz-border-radius:4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; @@ -1892,10 +1969,12 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border: 1px solid #E0E0E0; - border-collapse: collapse; + border-collapse: collapse !important; padding: 1px 2px 1px 3px; /* t r b l */ } - +table.borderplus { + border: 1px solid #BBB; +} .border tbody tr, .border tbody tr td { height: 20px; } @@ -1925,7 +2004,7 @@ } .table-key-border-col { - width: 25%; + /* width: 25%; */ vertical-align:top; } .table-val-border-col { @@ -1934,7 +2013,7 @@ /* Main boxes */ -table.noborder, table.formdoc, div.noborder { +table.liste, table.noborder, table.formdoc, div.noborder { width: 100%; border-collapse: separate !important; @@ -1956,31 +2035,34 @@ border-bottom-color: #BBB; border-bottom-style: solid; - margin: 0px 0px 2px 0px; + margin: 0px 0px 5px 0px; -moz-box-shadow: 2px 2px 4px #CCC; -webkit-box-shadow: 2px 2px 4px #CCC; box-shadow: 2px 2px 4px #CCC; - -moz-border-radius: 0.2em; +/* -moz-border-radius: 0.2em; -webkit-border-radius: 0.2em; - border-radius: 0.2em; + border-radius: 0.2em;*/ } -table.noborder tr, div.noborder form { +table.liste tr, table.noborder tr, div.noborder form { border-top-color: #FEFEFE; border-right-width: 1px; - border-right-color: #BBBBBB; + border-right-color: #BBB; border-right-style: solid; border-left-width: 1px; - border-left-color: #BBBBBB; + border-left-color: #BBB; border-left-style: solid; min-height: 20px; } -table.noborder th, table.noborder td, div.noborder form, div.noborder form div { +table.liste th, table.noborder th { + padding: 10px 2px 10px 3px; /* t r b l */ +} +table.liste td, table.noborder td, div.noborder form, div.noborder form div { padding: 5px 2px 5px 3px; /* t r b l */ } @@ -2008,42 +2090,12 @@ } -/* For lists */ - -table.liste { - width: 100%; - - border-collapse: collapse; - border-top-color: #FEFEFE; - - border-top-width: 1px; - border-top-color: #CCC; - border-top-style: solid; - - border-right-width: 1px; - border-right-color: #CCC; - border-right-style: solid; - -/* - border-bottom-width: 1px; - border-bottom-color: #BBBBBB; - border-bottom-style: solid; -*/ - border-left-width: 1px; - border-left-color: #CCC; - border-left-style: solid; - - margin-bottom: 2px; - margin-top: 0px; - - -moz-box-shadow: 0px 3px 4px #CCC; - -webkit-box-shadow: 0px 3px 4px #CC; - box-shadow: 0px 3px 4px #CCC; -} -table.liste td { - padding-right: 2px; +/* For table with no filter before */ +table.listwithfilterbefore { + border-top: none !important; } + .tagtable, .table-border { display: table; } .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } @@ -2051,13 +2103,18 @@ /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'8':'12'; ?>px; + padding-top: dol_use_jmobile)?'3':'14'; ?>px; } div.refid { - padding-top: dol_use_jmobile)?'5':'12'; ?>px; font-weight: bold; color: #766; - font-size: 120%; + font-size: 160%; +} +div.refidno { + padding-top: 2px; + font-weight: normal; + color: #444; + font-size: px; } div.pagination { @@ -2110,12 +2167,19 @@ div.pagination li.pagination span.inactive { cursor: default; } +/*div.pagination li.litext { + padding-top: 8px; +}*/ div.pagination li.litext a { -border: none; + border: none; padding-right: 10px; padding-left: 4px; font-weight: bold; } +div.pagination li.litext a:hover { + background-color: transparent; + background-image: none; +} dol_use_jmobile)) { ?> div.pagination li.litext { padding-top: 13px; @@ -2285,27 +2349,28 @@ div.liste_titre { min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height does not work either for div */ - padding-left: 3px; padding-top: 2px; padding-bottom: 2px; border-right-width: 1px; - border-right-color: #CCC; + border-right-color: #BBB; border-right-style: solid; border-left-width: 1px; - border-left-color: #CCC; + border-left-color: #BBB; border-left-style: solid; border-top-width: 1px; - border-top-color: #CCC; + border-top-color: #BBB; border-top-style: solid; } div.liste_titre_bydiv { box-shadow: none; border-collapse: collapse; display: table; - padding: 2px 2px 2px 0; + padding: 2px 0px 2px 0; + box-shadow: 2px 2px 4px #CCC; + width: calc(100% - 1px); /* 1px more, i don't know why */ } tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr { @@ -2326,9 +2391,9 @@ background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%); - font-weight: bold; + font-weight: ; - color: #; + color: rgb(); font-family: ; border-bottom: 1px solid #FDFFFF; text-align: ; @@ -2340,7 +2405,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div, div.liste_titre { font-family: ; - font-weight: bold; + font-weight: ; vertical-align: middle; } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { @@ -2348,7 +2413,7 @@ } .liste_titre td a { text-shadow: none !important; - color: #; + color: rgb(); } tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel, form.liste_titre_sel div { @@ -2398,6 +2463,10 @@ box-shadow: 0px 0px 0px #DDD !important; } +#tablelines tr.liste_titre td, .paymenttable tr.liste_titre td, .margintable tr.liste_titre td, .tableforservicepart1 tr.liste_titre td { + border-bottom: 1px solid #AAA !important; +} + /* * Boxes @@ -2450,9 +2519,9 @@ background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%); - color: #; + color: rgb(); font-family: , sans-serif; - font-weight: bold; + font-weight: ; border-bottom: 1px solid #FDFFFF; white-space: nowrap; } @@ -2493,7 +2562,10 @@ position: relative; } - +.prod_entry_mode_free, .prod_entry_mode_predef { + height: 26px !important; + vertical-align: middle; +} @@ -2609,9 +2681,9 @@ div.titre { font-family: ; font-weight: bold; - color: rgb(); + color: rgb(); text-decoration: none; - text-shadow: 1px 1px 2px #FFFFFF; + /* text-shadow: 1px 1px 2px #FFFFFF; */ } #dolpaymenttable { width: 600px; font-size: 13px; } @@ -3386,7 +3458,7 @@ background-color: #FFF !important; border-radius: inherit !important; } -.paging_full_numbers a.paginate_button_disabled:hover { +.paging_full_numbers a.paginate_button_disabled:hover, .paging_full_numbers a.disabled:hover { background-color: #FFF !important; } .paginate_button, .paginate_active { @@ -3414,7 +3486,9 @@ div.dataTables_length select { background: #fff; } - +.dataTables_wrapper .dataTables_paginate { + padding-top: 0px !important; +} /* ============================================================================== */ /* Select2 */ @@ -3511,6 +3585,62 @@ } +/* ============================================================================== */ +/* Multiselect with checkbox */ +/* ============================================================================== */ + +dl.dropdown { + margin:0px; + padding:0px; +} +.dropdown dd, .dropdown dt { + margin:0px; + padding:0px; +} +.dropdown ul { + margin: -1px 0 0 0; + text-align: left; +} +.dropdown dd { + position:relative; +} +.dropdown dt a { + display:block; + overflow: hidden; + border:0; +} +.dropdown dt a span, .multiSel span { + cursor:pointer; + display:inline-block; + padding: 0 3px 2px 0; +} +.dropdown dd ul { + background-color: #FFF; + border: 1px solid #888; + display:none; + right:0px; /* pop is align on right */ + padding: 2px 15px 2px 5px; + position:absolute; + top:2px; + list-style:none; + max-height: 200px; + overflow: auto; +} +.dropdown span.value { + display:none; +} +.dropdown dd ul li { + white-space: nowrap; + font-weight: normal; +} +.dropdown dd ul li a { + padding:5px; + display:block; +} +.dropdown dd ul li a:hover { + background-color:#fff; +} + /* ============================================================================== */ /* JMobile */ @@ -3579,7 +3709,7 @@ color: rgb(); } .liste_titre .ui-link { - color: # !important; + color: rgb() !important; } a.ui-link { @@ -3643,10 +3773,10 @@ background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); font-weight: bold; - color: # !important; + color: rgb() !important; } .alilevel0 { - color: # !important; + color: rgb() !important; text-shadow: 1px 0px 1px #; } .ui-btn-icon-right { @@ -3684,7 +3814,7 @@ border-top-right-radius: 6px; }*/ .alilevel1 { - color: # !important; + color: rgb() !important; text-shadow: 1px 0px 1px #; } .lilevel1 { @@ -3750,7 +3880,22 @@ } @media only screen and (max-width: 570px) { - div.mainmenu { + /* Reduce login top right info */ + .usertextatoplogin { + display: none; + } + div#tmenu_tooltip { + + display:none; + + padding-: 78px; + + } + div.login_block { + top: 9px; + } + + div.mainmenu { min-width: 20px; } .topmenuimage { @@ -3760,9 +3905,8 @@ #tooltip { position: absolute; width: px; - } + } } - close(); diff --git a/htdocs/theme/md/img/filter.png b/htdocs/theme/md/img/filter.png index 917715107bde9..ee34a22c78e0c 100644 Binary files a/htdocs/theme/md/img/filter.png and b/htdocs/theme/md/img/filter.png differ diff --git a/htdocs/theme/md/img/list.png b/htdocs/theme/md/img/list.png new file mode 100644 index 0000000000000..f5df34a3bc9f8 Binary files /dev/null and b/htdocs/theme/md/img/list.png differ diff --git a/htdocs/theme/md/img/object_building.png b/htdocs/theme/md/img/object_building.png new file mode 100644 index 0000000000000..c9d1539dddcdc Binary files /dev/null and b/htdocs/theme/md/img/object_building.png differ diff --git a/htdocs/theme/md/img/object_contact.png b/htdocs/theme/md/img/object_contact.png index e98202b367d15..d4272f367c6e5 100644 Binary files a/htdocs/theme/md/img/object_contact.png and b/htdocs/theme/md/img/object_contact.png differ diff --git a/htdocs/theme/md/img/object_group.png b/htdocs/theme/md/img/object_group.png index 552eb39fa3149..be0255f7ec267 100644 Binary files a/htdocs/theme/md/img/object_group.png and b/htdocs/theme/md/img/object_group.png differ diff --git a/htdocs/theme/md/img/object_user.png b/htdocs/theme/md/img/object_user.png index d26d8899ee80f..efd446a1a4c05 100644 Binary files a/htdocs/theme/md/img/object_user.png and b/htdocs/theme/md/img/object_user.png differ diff --git a/htdocs/theme/md/img/search.png b/htdocs/theme/md/img/search.png index 4c52b1e401ebb..f0d4e97577508 100644 Binary files a/htdocs/theme/md/img/search.png and b/htdocs/theme/md/img/search.png differ diff --git a/htdocs/theme/md/img/searchclear.png b/htdocs/theme/md/img/searchclear.png index 203a85e10c4c0..12437f848238b 100644 Binary files a/htdocs/theme/md/img/searchclear.png and b/htdocs/theme/md/img/searchclear.png differ diff --git a/htdocs/theme/md/img/sort_asc.png b/htdocs/theme/md/img/sort_asc.png index aca0f6eb77aa8..82b250c72bd73 100644 Binary files a/htdocs/theme/md/img/sort_asc.png and b/htdocs/theme/md/img/sort_asc.png differ diff --git a/htdocs/theme/md/img/sort_desc.png b/htdocs/theme/md/img/sort_desc.png index 57c1ad0fcb41a..a5aa5f4e50653 100644 Binary files a/htdocs/theme/md/img/sort_desc.png and b/htdocs/theme/md/img/sort_desc.png differ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 37265b852f4f7..47da31761261f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -91,10 +91,14 @@ $colorbacklinepair2='248,248,248'; // line pair $colorbacklinepairhover='238,246,252'; // line pair $colorbackbody='255,255,255'; -$colortext='50,50,130'; +//$colortexttitlenotab='40,0,70'; +$colortexttitlenotab='80,80,0'; +$colortexttitle=''; +$colortext=''; $fontsize='13'; $fontsizesmaller='11'; $usegradient=1; +$useboldtitle=1; // Case of option always editable if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=join(',',colorStringToArray('#37474F')); // topmenu (140,160,185) @@ -117,8 +121,9 @@ $conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_USE_HOVER=='238,246,252'; $conf->global->THEME_ELDY_BACKBODY='255,255,255'; - + //$conf->global->THEME_ELDY_TEXTTITLE='0,0,0'; $conf->global->THEME_ELDY_TEXT='50,50,130'; + $conf->global->THEME_ELDY_FONT_SIZE1='13'; $conf->global->THEME_ELDY_FONT_SIZE2='11'; } @@ -137,6 +142,7 @@ $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); $colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortexttitle =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLE) ?$colortext:$conf->global->THEME_ELDY_TEXTTITLE) :(empty($user->conf->THEME_ELDY_TEXTTITLE)?$colortexttitle:$user->conf->THEME_ELDY_TEXTTITLE); $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); $fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); @@ -148,6 +154,24 @@ $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); } +// Set text color to black or white +$tmppart=explode(',',$colorbackhmenu1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; +else $colortextbackhmenu='111111'; +$tmppart=explode(',',$colorbackvmenu1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } +else { $colortextbackvmenu='111111'; } +$tmppart=explode(',',$colorbacktitle1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 360) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } +else { $colortexttitle='111111'; $colorshadowtitle='FFFFFF'; } +$tmppart=explode(',',$colorbacktabcard1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } +else { $colortextbacktab='111111'; } + // Format color value to match expected format (may be 'FFFFFF' or '255,255,255') $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); $colorbackvmenu1=join(',',colorStringToArray($colorbackvmenu1)); @@ -160,27 +184,9 @@ $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); +$colortexttitle=join(',',colorStringToArray($colortexttitle)); $colortext=join(',',colorStringToArray($colorbackvmenu1)); -// Set text color to black or white -$tmppart=explode(',',$colorbackhmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) $colortextbackhmenu='FFF'; -else $colortextbackhmenu='111'; -$tmppart=explode(',',$colorbackvmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) { $colortextbackvmenu='FFF'; } -else { $colortextbackvmenu='111'; } -$tmppart=explode(',',$colorbacktitle1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 360) { $colortexttitle='FFF'; $colorshadowtitle='888'; } -else { $colortexttitle='111'; $colorshadowtitle='FFF'; } -$tmppart=explode(',',$colorbacktabcard1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 340) { $colortextbacktab='FFF'; } -else { $colortextbacktab='111'; } - - print '/*'."\n"; print 'colorbackbody='.$colorbackbody."\n"; print 'colorbackvmenu1='.$colorbackvmenu1."\n"; @@ -224,7 +230,7 @@ trans("DIRECTION").";\n"; ?> } -a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #4A4A4A; text-decoration: none; } +a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #000; text-decoration: none; } a:hover { text-decoration: underline; color: #000000;} @@ -251,6 +257,7 @@ border:solid 1px rgba(0,0,0,.3); border-top:solid 1px rgba(0,0,0,.3); border-bottom:solid 1px rgba(0,0,0,.2); + background-color: #FFF; /* box-shadow: 1px 1px 1px rgba(0,0,0,.2) inset;*/ padding:4px; margin-left:1px; @@ -456,6 +463,10 @@ div.divsearchfield { float: ; margin-: 12px; + margin-: 2px; + margin-top: 4px; + margin-bottom: 4px; + padding-left: 2px; } div.confirmmessage { padding-top: 6px; @@ -488,6 +499,7 @@ .maxwidth100 { max-width: 100px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } +.titlefield { width: 30%; } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } @@ -495,6 +507,7 @@ .maxwidth100onsmartphone { max-width: 100px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } +.titlefield { width: auto; } .linkobject { cursor: pointer; } @@ -547,11 +560,16 @@ } #id-right { /* This must stay id-right and not be replaced with echo $right */ width: 100%; + padding-left: 194px; padding-top: 12px; + } .side-nav { + + display: none; + background: #FFF; border-right: 1px solid rgba(0,0,0,0.2); bottom: 0; @@ -587,6 +605,7 @@ -webkit-overflow-scrolling: touch; overflow-x: hidden; overflow-y: auto; + } .side-nav-vert { margin-left: 194px; @@ -651,6 +670,38 @@ padding-top: 10px; padding-bottom: 10px; } +div.arearef { + /*border-bottom: 1px solid #bbb;*/ + padding-top: 2px; + padding-bottom: 5px; + /*padding-right: 3px; + padding-left: 2px;*/ + margin-bottom: 10px; +} +div.heightref { + min-height: 74px; +} +div.divphotoref { + padding-right: 20px; +} +div.statusref { + float: right; + padding-right: 12px; + margin-top: 7px; + margin-bottom: 10px; +} +img.photoref { + height: 80px; + width: 80px; + border: 1px solid #CCC; + -moz-box-shadow: 3px 3px 4px #DDD; + -webkit-box-shadow: 3px 3px 4px #DDD; + box-shadow: 3px 3px 4px #DDD; +} +.underrefbanner { + border-bottom: 2px solid #888; +} + /* ============================================================================== */ @@ -663,7 +714,7 @@ $heightmenu2=48; /* height of top menu, ârt with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE) || $dol_optimize_smallscreen) { $disableimages = 1; $maxwidthloginblock = 180; } +if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; } ?> div#tmenu_tooltip { @@ -686,7 +737,7 @@ display:none; - /* padding-: px; */ + /* padding-: px; */ } @@ -770,7 +821,7 @@ } li.tmenusel, li.tmenu:hover { background-image: -o-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: -moz-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; + background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.5) 0%, rgba(250,250,250,0) 100%) !important; background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0) 100%) !important; background-image: -ms-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; background-image: linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; @@ -868,7 +919,6 @@ div.mainmenu.products { background-image: url(); - margin-left: 10px; } div.mainmenu.project { @@ -898,7 +948,7 @@ $mainmenuusedarray=array_unique(explode(',',$mainmenuused)); $generic=1; -$divalreadydefined=array('home','companies','products','commercial','accountancy','project','tools','members','agenda','holiday','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','webservices'); +$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','holiday','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','webservices'); foreach($mainmenuusedarray as $val) { if (empty($val) || in_array($val,$divalreadydefined)) continue; @@ -1069,12 +1119,16 @@ .login_block_elem_name { margin-top: 5px; } +.atoplogin, .atoplogin:hover { + color: # !important; + font-weight: normal !important; +} .alogin, .alogin:hover { color: #888 !important; font-weight: normal !important; font-size: px !important; } -.alogin:hover { +.alogin:hover, .atoplogin:hover { text-decoration:underline !important; } img.login, img.printer, img.entity { @@ -1125,6 +1179,10 @@ } +.vmenusearchselectcombo { + width: 170px; +} + .menu_contenu { padding-top: 4px; padding-bottom: 3px;} #menu_contenu_logo { padding-right: 4px; } @@ -1476,10 +1534,10 @@ div.tabBar { color: #; - padding-top: 9px; - padding-left: px; - padding-right: px; - padding-bottom: 8px; + padding-top: px; + padding-left: px; + padding-right: px; + padding-bottom: px; margin: 0px 0px 14px 0px; -moz-border-radius:3px; -webkit-border-radius: 3px; @@ -1504,7 +1562,16 @@ padding: 0em 0em; text-align: right; } - +div.popuptabset { + padding: 6px; + border: 1px solid #888; +} +div.popuptab { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 5px; + padding-right: 5px; +} a.tabTitle { /* background: #657090; @@ -1551,9 +1618,9 @@ -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); box-shadow: 0 -1px 4px rgba(0,0,0,.1); - border-right: 1px solid #CCCCCC; - border-left: 1px solid #f4f4f4; - border-top: 1px solid #D8D8D8; + border-right: 1px solid #AAA !important; + border-left: 1px solid #AAA !important; + border-top: 1px solid #BBB !important; -moz-border-radius:3px 3px 0px 0px; -webkit-border-radius:3px 3px 0px 0px; @@ -1788,7 +1855,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border: 1px solid #f4f4f4; - border-collapse: collapse; + border-collapse: collapse !important; padding: 1px 2px 1px 3px; /* t r b l */ } @@ -1822,7 +1889,7 @@ /* Main boxes */ -table.noborder, table.formdoc, div.noborder { +table.liste, table.noborder, table.formdoc, div.noborder { width: 100%; border-collapse: separate !important; @@ -1856,6 +1923,9 @@ height: 26px; } +table.liste th, table.noborder th { + padding: 5px 2px 5px 3px; /* t r b l */ +} table.noborder th, table.noborder td, div.noborder form, div.noborder form div { padding: 1px 2px 1px 3px; /* t r b l */ } @@ -1883,35 +1953,9 @@ border-right-style: solid !important; } -/* For lists */ - -table.liste { - width: 100%; - border-collapse: collapse; - border-top-color: #FEFEFE; - - border-right-width: 1px; - border-right-color: #CCC; - border-right-style: solid; - -/* - border-bottom-width: 1px; - border-bottom-color: #BBBBBB; - border-bottom-style: solid; -*/ - border-left-width: 1px; - border-left-color: #CCC; - border-left-style: solid; - - margin-bottom: 2px; - margin-top: 0px; - - -moz-box-shadow: 0px 3px 4px #CCC; - -webkit-box-shadow: 0px 3px 4px #CC; - box-shadow: 0px 3px 4px #CCC; -} -table.liste td { - padding-right: 2px; +/* For table with no filter before */ +table.listwithfilterbefore { + border-top: none !important; } .tagtable, .table-border { display: table; } @@ -1920,13 +1964,18 @@ /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'8':'12'; ?>px; + padding-top: dol_use_jmobile)?'3':'14'; ?>px; } div.refid { - padding-top: dol_use_jmobile)?'5':'12'; ?>px; font-weight: bold; color: #766; - font-size: 120%; + font-size: 160%; +} +div.refidno { + padding-top: 2px; + font-weight: normal; + color: #444; + font-size: px; } div.pagination { @@ -2050,6 +2099,9 @@ div.pagination li.paginationafterarrows { margin-left: 10px; } +.paginationatbottom { + margin-top: 9px; +} /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td { @@ -2139,6 +2191,29 @@ } div.liste_titre { min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height doe not work either for div */ + + padding-top: 2px; + padding-bottom: 2px; + + border-right-width: 1px; + border-right-color: #BBB; + border-right-style: solid; + + border-left-width: 1px; + border-left-color: #BBB; + border-left-style: solid; + + border-top-width: 1px; + border-top-color: #BBB; + border-top-style: solid; +} +div.liste_titre_bydiv { + box-shadow: none; + border-collapse: collapse; + display: table; + padding: 2px 0px 2px 0; + box-shadow: 2px 2px 4px #CCC; + width: calc(100% - 1px); /* 1px more, i don't know why */ } tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr { @@ -2160,10 +2235,10 @@ background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); - font-weight: bold; + font-weight: ; */ - color: #; + color: rgb(); font-family: ; border-bottom: 1px solid #FDFFFF; text-align: ; @@ -2175,7 +2250,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div, div.liste_titre { font-family: ; - font-weight: bold; + font-weight: ; vertical-align: middle; } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { @@ -2183,7 +2258,7 @@ } .liste_titre td a { text-shadow: none !important; - color: #; + color: rgb(); } div.liste_titre { padding-left: 3px; @@ -2236,6 +2311,10 @@ box-shadow: 0px 0px 0px #f4f4f4 !important; } +#tablelines tr.liste_titre td, .paymenttable tr.liste_titre td, .margintable tr.liste_titre td, .tableforservicepart1 tr.liste_titre td { + border-bottom: 1px solid #AAA !important; +} + /* * Boxes @@ -2291,9 +2370,9 @@ */ background-repeat: repeat-x; - color: #; + color: rgb(); font-family: , sans-serif; - font-weight: bold; + font-weight: ; border-bottom: 1px solid #FDFFFF; white-space: nowrap; } @@ -2332,6 +2411,10 @@ position: relative; } +.prod_entry_mode_free, .prod_entry_mode_predef { + height: 26px !important; + vertical-align: middle; +} @@ -2425,7 +2508,12 @@ margin-bottom: 2px; margin-top: 2px; } -.photointooltip { +.photowithmargin { +/* -webkit-box-shadow: 0px 0px 3px #777; + -moz-box-shadow: 0px 0px 3px #777; + box-shadow: 0px 0px 3px #777;*/ +} +.photointoolitp { margin-top: 8px; float: left; /*text-align: center; */ @@ -2443,9 +2531,9 @@ div.titre { font-family: ; font-weight: bold; - color: rgb(); + color: rgb(); text-decoration: none; - text-shadow: 1px 1px 2px #FFFFFF; + /* text-shadow: 1px 1px 2px #FFFFFF; */ dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?> } @@ -3221,7 +3309,7 @@ background-color: #FFF !important; border-radius: inherit !important; } -.paging_full_numbers a.paginate_button_disabled:hover { +.paging_full_numbers a.paginate_button_disabled:hover, .paging_full_numbers a.disabled:hover { background-color: #FFF !important; } .paginate_button, .paginate_active { @@ -3242,10 +3330,26 @@ background-image: none; } +div.dataTables_length { + float: right !important; + padding-left: 8px; +} +div.dataTables_length select { + background: #fff; +} +.dataTables_wrapper .dataTables_paginate { + padding-top: 0px !important; +} + + /* ============================================================================== */ /* Select2 */ /* ============================================================================== */ +.selectoptiondisabledwhite { + background: #FFFFFF !important; +} + .select2-choice, .select2-drop.select2-drop-above.select2-drop-active, .select2-container-active .select2-choice, @@ -3333,6 +3437,63 @@ } +/* ============================================================================== */ +/* Multiselect with checkbox */ +/* ============================================================================== */ + +dl.dropdown { + margin:0px; + padding:0px; +} +.dropdown dd, .dropdown dt { + margin:0px; + padding:0px; +} +.dropdown ul { + margin: -1px 0 0 0; + text-align: left; +} +.dropdown dd { + position:relative; +} +.dropdown dt a { + display:block; + overflow: hidden; + border:0; +} +.dropdown dt a span, .multiSel span { + cursor:pointer; + display:inline-block; + padding: 0 3px 2px 0; +} +.dropdown dd ul { + background-color: #FFF; + border: 1px solid #888; + display:none; + right:0px; /* pop is align on right */ + padding: 2px 15px 2px 5px; + position:absolute; + top:2px; + list-style:none; + max-height: 200px; + overflow: auto; +} +.dropdown span.value { + display:none; +} +.dropdown dd ul li { + white-space: nowrap; + font-weight: normal; +} +.dropdown dd ul li a { + padding:5px; + display:block; +} +.dropdown dd ul li a:hover { + background-color:#fff; +} + + /* ============================================================================== */ /* JMobile */ /* ============================================================================== */ @@ -3400,7 +3561,7 @@ color: rgb(); } .liste_titre .ui-link { - color: # !important; + color: rgb() !important; } a.ui-link { @@ -3464,10 +3625,10 @@ background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); font-weight: bold; - color: # !important; + color: rgb() !important; } .alilevel0 { - color: # !important; + color: rgb() !important; text-shadow: 1px 0px 1px #; } .ui-btn-icon-right { @@ -3497,7 +3658,7 @@ border-top-right-radius: 6px; } .alilevel1 { - color: # !important; + color: rgb() !important; text-shadow: 1px 0px 1px #; } .lilevel1 { @@ -3559,11 +3720,26 @@ #tooltip { position: absolute; width: px; - } + } } @media only screen and (max-width: 570px) { - div.mainmenu { + /* Reduce login top right info */ + .usertextatoplogin { + display: none; + } + div#tmenu_tooltip { + + display:none; + + /* padding-: 78px; */ + + } + div.login_block { + top: 9px; + } + + div.mainmenu { min-width: 20px; } .topmenuimage { @@ -3573,7 +3749,7 @@ #tooltip { position: absolute; width: px; - } + } } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index cd38d7a2965d8..dc5ec528a2189 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -49,8 +49,8 @@ // Security check $id = GETPOST('id','int'); -$fuser = new User($db); -$fuser->fetch($id); +$object = new User($db); +$object->fetch($id); // Security check $socid=0; @@ -63,65 +63,73 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // If user is not user that read and no permission to read other users, we stop -if (($fuser->id != $user->id) && (! $user->rights->user->user->lire)) +if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); - +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); /* * Actions */ -if ($actionsave) -{ - $db->begin(); - - $i=1; $errorsaved=0; - $error=0; - $tabparam=array(); - // Save agendas - while ($i <= $MAXAGENDA) - { - $name=trim(GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$i,'alpha')); - $src=trim(GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$i,'alpha')); - $offsettz=trim(GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$i,'alpha')); - $color=trim(GETPOST('AGENDA_EXT_COLOR_'.$id.'_'.$i,'alpha')); - if ($color=='-1') $color=''; - $enabled=trim(GETPOST('AGENDA_EXT_ENABLED_'.$id.'_'.$i,'alpha')); - - if (! empty($src) && ! dol_is_url($src)) - { - setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); - $error++; - $errorsaved++; - break; - } - - $tabparam['AGENDA_EXT_NAME_'.$id.'_'.$i]=$name; - $tabparam['AGENDA_EXT_SRC_'.$id.'_'.$i]=$src; - $tabparam['AGENDA_EXT_OFFSETTZ_'.$id.'_'.$i]=$offsettz; - $tabparam['AGENDA_EXT_COLOR_'.$id.'_'.$i]=$color; - $tabparam['AGENDA_EXT_ENABLED_'.$id.'_'.$i]=$enabled; - - $i++; - } +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { + if ($actionsave) { + $db->begin(); + + $i = 1; + $errorsaved = 0; + $error = 0; + $tabparam = array(); + + // Save agendas + while ($i <= $MAXAGENDA) { + $name = trim(GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$i, 'alpha')); + $src = trim(GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$i, 'alpha')); + $offsettz = trim(GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$i, 'alpha')); + $color = trim(GETPOST('AGENDA_EXT_COLOR_'.$id.'_'.$i, 'alpha')); + if ($color == '-1') { + $color = ''; + } + $enabled = trim(GETPOST('AGENDA_EXT_ENABLED_'.$id.'_'.$i, 'alpha')); + + if (!empty($src) && !dol_is_url($src)) { + setEventMessage($langs->trans("ErrorParamMustBeAnUrl"), 'errors'); + $error ++; + $errorsaved ++; + break; + } if (! $error) { - $result=dol_set_user_param($db, $conf, $fuser, $tabparam); + $result=dol_set_user_param($db, $conf, $object, $tabparam); if (! $result > 0) $error++; } - if (! $error) - { - $db->commit(); - setEventMessage($langs->trans("SetupSaved")); - } - else - { - $db->rollback(); - if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); - } + $i ++; + } + + if (!$error) { + $result = dol_set_user_param($db, $conf, $fuser, $tabparam); + if (!$result > 0) { + $error ++; + } + } + + if (!$error) { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } else { + $db->rollback(); + if (empty($errorsaved)) { + setEventMessage($langs->trans("Error"), 'errors'); + } + } + } } /* @@ -141,10 +149,16 @@ print '
    '; print ''; -$head=user_prepare_head($fuser); +$head=user_prepare_head($object); dol_fiche_head($head, 'extsites', $langs->trans("User"), 0, 'user'); +dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + +print '
    '; + +print '
    '; + print $langs->trans("AgendaExtSitesDesc")."
    \n"; print "
    \n"; @@ -177,15 +191,15 @@ // Nb print '
    '.$langs->trans("AgendaExtNb",$key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key)?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key):$fuser->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key)?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key):$object->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); print '
    '; + dol_fiche_end(); print '
    '; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b74b921c735d1..407941c28fd81 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -101,276 +101,235 @@ * Actions */ -if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) -{ - if ($id <> $user->id) - { - $object->fetch($id); - $object->setstatus(0); - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } -} -if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) -{ - $error = 0; - - if ($id <> $user->id) - { - $object->fetch($id); - - if (!empty($conf->file->main_limit_users)) - { - $nb = $object->getNbOfUsers("active"); - if ($nb >= $conf->file->main_limit_users) - { - $error++; - setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); - } - } - - if (! $error) - { - $object->setstatus(1); - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } - } -} - -if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) -{ - if ($id <> $user->id) - { - $object = new User($db); - $object->id=$id; - $result = $object->delete(); - if ($result < 0) - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorUserCannotBeDelete"), 'errors'); - } - else - { - header("Location: index.php"); - exit; - } - } -} - -// Action Add user -if ($action == 'add' && $canadduser) -{ - $error = 0; - - if (! $_POST["lastname"]) - { - $error++; - setEventMessage($langs->trans("NameNotDefined"), 'errors'); - $action="create"; // Go back to create page - } - if (! $_POST["login"]) - { - $error++; - setEventMessage($langs->trans("LoginNotDefined"), 'errors'); - $action="create"; // Go back to create page - } +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { + + if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) { + if ($id <> $user->id) { + $object->fetch($id); + $object->setstatus(0); + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } + } + if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) { + $error = 0; - if (! empty($conf->file->main_limit_users)) // If option to limit users is set - { - $nb = $object->getNbOfUsers("active"); - if ($nb >= $conf->file->main_limit_users) - { - $error++; - setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); - $action="create"; // Go back to create page - } - } + if ($id <> $user->id) { + $object->fetch($id); - if (!$error) - { - $object->lastname = GETPOST("lastname",'alpha'); - $object->firstname = GETPOST("firstname",'alpha'); - $object->login = GETPOST("login",'alpha'); - $object->api_key = GETPOST("api_key",'alpha'); - $object->gender = GETPOST("gender",'alpha'); - $object->admin = GETPOST("admin",'alpha'); - $object->office_phone = GETPOST("office_phone",'alpha'); - $object->office_fax = GETPOST("office_fax",'alpha'); - $object->user_mobile = GETPOST("user_mobile"); - $object->skype = GETPOST("skype"); - $object->email = GETPOST("email",'alpha'); - $object->job = GETPOST("job",'alpha'); - $object->signature = GETPOST("signature"); - $object->accountancy_code = GETPOST("accountancy_code"); - $object->note = GETPOST("note"); - $object->ldap_sid = GETPOST("ldap_sid"); - $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; - - $object->thm = GETPOST("thm")!=''?GETPOST("thm"):''; - $object->tjm = GETPOST("tjm")!=''?GETPOST("tjm"):''; - $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; - $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; - $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; - - $object->color = GETPOST("color")!=''?GETPOST("color"):''; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if ($ret < 0) $error++; - - // Set entity property - $entity=GETPOST('entity','int'); - if (! empty($conf->multicompany->enabled)) - { - if (! empty($_POST["superadmin"])) - { - $object->entity = 0; - } - else if ($conf->multicompany->transverse_mode) - { - $object->entity = 1; // all users are forced into master entity - } - else - { - $object->entity = ($entity == '' ? 1 : $entity); - } - } - else - { - $object->entity = ($entity == '' ? 1 : $entity); - /*if ($user->admin && $user->entity == 0 && GETPOST("admin",'alpha')) - { - }*/ - } + if (!empty($conf->file->main_limit_users)) { + $nb = $object->getNbOfUsers("active"); + if ($nb >= $conf->file->main_limit_users) { + $error ++; + setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); + } + } - $db->begin(); + if (!$error) { + $object->setstatus(1); + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } + } + } - $id = $object->create($user); - if ($id > 0) - { - if (isset($_POST['password']) && trim($_POST['password'])) - { - $object->setPassword($user,trim($_POST['password'])); - } + if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) { + if ($id <> $user->id) { + $object = new User($db); + $object->id = $id; + $result = $object->delete(); + if ($result < 0) { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorUserCannotBeDelete"), 'errors'); + } else { + header("Location: index.php"); + exit; + } + } + } - $db->commit(); + // Action Add user + if ($action == 'add' && $canadduser) { + $error = 0; + + if (!$_POST["lastname"]) { + $error ++; + setEventMessage($langs->trans("NameNotDefined"), 'errors'); + $action = "create"; // Go back to create page + } + if (!$_POST["login"]) { + $error ++; + setEventMessage($langs->trans("LoginNotDefined"), 'errors'); + $action = "create"; // Go back to create page + } + + if (!empty($conf->file->main_limit_users)) { // If option to limit users is set + $nb = $object->getNbOfUsers("active"); + if ($nb >= $conf->file->main_limit_users) { + $error ++; + setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); + $action = "create"; // Go back to create page + } + } + + if (!$error) { + $object->lastname = GETPOST("lastname", 'alpha'); + $object->firstname = GETPOST("firstname", 'alpha'); + $object->login = GETPOST("login", 'alpha'); + $object->api_key = GETPOST("api_key", 'alpha'); + $object->gender = GETPOST("gender", 'alpha'); + $object->admin = GETPOST("admin", 'alpha'); + $object->office_phone = GETPOST("office_phone", 'alpha'); + $object->office_fax = GETPOST("office_fax", 'alpha'); + $object->user_mobile = GETPOST("user_mobile"); + $object->skype = GETPOST("skype"); + $object->email = GETPOST("email", 'alpha'); + $object->job = GETPOST("job", 'alpha'); + $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); + $object->note = GETPOST("note"); + $object->ldap_sid = GETPOST("ldap_sid"); + $object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0; + + $object->thm = GETPOST("thm") != '' ? GETPOST("thm") : ''; + $object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : ''; + $object->salary = GETPOST("salary") != '' ? GETPOST("salary") : ''; + $object->salaryextra = GETPOST("salaryextra") != '' ? GETPOST("salaryextra") : ''; + $object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : ''; + + $object->color = GETPOST("color") != '' ? GETPOST("color") : ''; + + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) { + $error ++; + } - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } - else - { - $langs->load("errors"); - $db->rollback(); - if (is_array($object->errors) && count($object->errors)) setEventMessage($object->errors,'errors'); - else setEventMessage($object->error, 'errors'); - $action="create"; // Go back to create page - } + // Set entity property + $entity = GETPOST('entity', 'int'); + if (!empty($conf->multicompany->enabled)) { + if (!empty($_POST["superadmin"])) { + $object->entity = 0; + } else { + if ($conf->multicompany->transverse_mode) { + $object->entity = 1; // all users are forced into master entity + } else { + $object->entity = ($entity == '' ? 1 : $entity); + } + } + } else { + $object->entity = ($entity == '' ? 1 : $entity); + /*if ($user->admin && $user->entity == 0 && GETPOST("admin",'alpha')) + { + }*/ + } - } -} + $db->begin(); -// Action add usergroup -if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) -{ - if ($group) - { - $editgroup = new UserGroup($db); - $editgroup->fetch($group); - $editgroup->oldcopy=clone $editgroup; + $id = $object->create($user); + if ($id > 0) { + if (isset($_POST['password']) && trim($_POST['password'])) { + $object->setPassword($user, trim($_POST['password'])); + } - $object->fetch($id); - if ($action == 'addgroup') $object->SetInGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); - if ($action == 'removegroup') $object->RemoveFromGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); + $db->commit(); + + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } else { + $langs->load("errors"); + $db->rollback(); + if (is_array($object->errors) && count($object->errors)) { + setEventMessage($object->errors, 'errors'); + } else { + setEventMessage($object->error, 'errors'); + } + $action = "create"; // Go back to create page + } + } + } - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} + // Action add usergroup + if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) + { + if ($group) + { + $editgroup = new UserGroup($db); + $editgroup->fetch($group); + $editgroup->oldcopy=clone $editgroup; -if ($action == 'update' && ! $_POST["cancel"]) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $object->fetch($id); + if ($action == 'addgroup') { + $object->SetInGroup($group, ($conf->multicompany->transverse_mode ? GETPOST("entity") : $editgroup->entity)); + } + if ($action == 'removegroup') { + $object->RemoveFromGroup($group, ($conf->multicompany->transverse_mode ? GETPOST("entity") : $editgroup->entity)); + } - if ($caneditfield) // Case we can edit all field - { - $error=0; + if ($result > 0) { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } else { + setEventMessage($object->error, 'errors'); + } + } + } - if (! $_POST["lastname"]) - { - setEventMessage($langs->trans("NameNotDefined"), 'errors'); - $action="edit"; // Go back to create page - $error++; - } - if (! $_POST["login"]) - { - setEventMessage($langs->trans("LoginNotDefined"), 'errors'); - $action="edit"; // Go back to create page - $error++; - } + if ($action == 'update' && !$_POST["cancel"]) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - if (! $error) - { - $object->fetch($id); + if ($caneditfield) // Case we can edit all field + { + $error = 0; - // Test if new login - if (GETPOST("login") && GETPOST("login") != $object->login) - { - dol_syslog("New login ".$object->login." is requested. We test it does not exists."); - $tmpuser=new User($db); - $result=$tmpuser->fetch(0, GETPOST("login")); - if ($result > 0) - { - setEventMessage($langs->trans("ErrorLoginAlreadyExists", GETPOST('login')), 'errors'); - $action="edit"; // Go back to create page - $error++; - } + if (!$_POST["lastname"]) { + setEventMessage($langs->trans("NameNotDefined"), 'errors'); + $action = "edit"; // Go back to create page + $error ++; + } + if (!$_POST["login"]) { + setEventMessage($langs->trans("LoginNotDefined"), 'errors'); + $action = "edit"; // Go back to create page + $error ++; } - } - if (! $error) - { - $db->begin(); + if (!$error) { + $object->fetch($id); $object->oldcopy = clone $object; - $object->lastname = GETPOST("lastname",'alpha'); - $object->firstname = GETPOST("firstname",'alpha'); - $object->login = GETPOST("login",'alpha'); - $object->gender = GETPOST("gender",'alpha'); - $object->pass = GETPOST("password"); - $object->api_key = (GETPOST("api_key", 'alpha'))?GETPOST("api_key", 'alpha'):$object->api_key; - $object->admin = empty($user->admin)?0:GETPOST("admin"); // A user can only be set admin by an admin - $object->office_phone=GETPOST("office_phone",'alpha'); - $object->office_fax = GETPOST("office_fax",'alpha'); - $object->user_mobile= GETPOST("user_mobile"); - $object->skype = GETPOST("skype"); - $object->email = GETPOST("email",'alpha'); - $object->job = GETPOST("job",'alpha'); - $object->signature = GETPOST("signature"); - $object->accountancy_code = GETPOST("accountancy_code"); - $object->openid = GETPOST("openid"); - $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; - - $object->thm = GETPOST("thm")!=''?GETPOST("thm"):''; - $object->tjm = GETPOST("tjm")!=''?GETPOST("tjm"):''; - $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; - $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; - $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; - - $object->color = GETPOST("color")!=''?GETPOST("color"):''; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if ($ret < 0) $error++; + if (!$error) { + $db->begin(); + + $object->oldcopy = dol_clone($object); + + $object->lastname = GETPOST("lastname", 'alpha'); + $object->firstname = GETPOST("firstname", 'alpha'); + $object->login = GETPOST("login", 'alpha'); + $object->gender = GETPOST("gender", 'alpha'); + $object->pass = GETPOST("password"); + $object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key; + $object->admin = empty($user->admin) ? 0 : GETPOST("admin"); // A user can only be set admin by an admin + $object->office_phone = GETPOST("office_phone", 'alpha'); + $object->office_fax = GETPOST("office_fax", 'alpha'); + $object->user_mobile = GETPOST("user_mobile"); + $object->skype = GETPOST("skype"); + $object->email = GETPOST("email", 'alpha'); + $object->job = GETPOST("job", 'alpha'); + $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); + $object->openid = GETPOST("openid"); + $object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0; + + $object->thm = GETPOST("thm") != '' ? GETPOST("thm") : ''; + $object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : ''; + $object->salary = GETPOST("salary") != '' ? GETPOST("salary") : ''; + $object->salaryextra = GETPOST("salaryextra") != '' ? GETPOST("salaryextra") : ''; + $object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : ''; if (! empty($conf->multicompany->enabled)) { @@ -392,121 +351,137 @@ $object->entity = (! GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } - if (GETPOST('deletephoto')) $object->photo=''; - if (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); - - if (! $error) - { - $ret=$object->update($user); - if ($ret < 0) - { - $error++; - if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorLoginAlreadyExists",$object->login), 'errors'); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } - - if (! $error && isset($_POST['contactid'])) - { - $contactid=GETPOST('contactid'); - - if ($contactid > 0) - { - $contact=new Contact($db); - $contact->fetch($contactid); + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) { + $error ++; + } - $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql.= " SET fk_socpeople=".$db->escape($contactid); - if ($contact->socid) $sql.=", fk_soc=".$db->escape($contact->socid); - $sql.= " WHERE rowid=".$object->id; - } - else - { - $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql.= " SET fk_socpeople=NULL, fk_soc=NULL"; - $sql.= " WHERE rowid=".$object->id; - } - dol_syslog("fiche::update", LOG_DEBUG); - $resql=$db->query($sql); - if (! $resql) - { - $error++; - setEventMessage($db->lasterror(), 'errors'); - } - } + if (!empty($conf->multicompany->enabled)) { + if (!empty($_POST["superadmin"])) { + $object->entity = 0; + } else { + if ($conf->multicompany->transverse_mode) { + $object->entity = 1; // all users in master entity + } else { + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + } + } + } else { + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + } - if (! $error && ! count($object->errors)) - { - if (GETPOST('deletephoto') && $object->photo) - { - $fileimg=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'user').'/logos/'.$object->photo; - $dirthumbs=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'user').'/logos/thumbs'; - dol_delete_file($fileimg); - dol_delete_dir_recursive($dirthumbs); + if (GETPOST('deletephoto')) { + $object->photo = ''; + } + if (!empty($_FILES['photo']['name'])) { + $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); } - if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) - { - $dir= $conf->user->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'user'); + if (!$error) { + $ret = $object->update($user); + if ($ret < 0) { + $error ++; + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorLoginAlreadyExists", $object->login), 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } - dol_mkdir($dir); + if (!$error && isset($_POST['contactid'])) { + $contactid = GETPOST('contactid'); - if (@is_dir($dir)) - { - $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); - $result=dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']); + if ($contactid > 0) { + $contact = new Contact($db); + $contact->fetch($contactid); - if (! $result > 0) - { - setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; + $sql .= " SET fk_socpeople=".$db->escape($contactid); + if ($contact->socid) { + $sql .= ", fk_soc=".$db->escape($contact->socid); } - else - { - // Create small thumbs for company (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality); + $sql .= " WHERE rowid=".$object->id; + } else { + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; + $sql .= " SET fk_socpeople=NULL, fk_soc=NULL"; + $sql .= " WHERE rowid=".$object->id; + } + dol_syslog("fiche::update", LOG_DEBUG); + $resql = $db->query($sql); + if (!$resql) { + $error ++; + setEventMessage($db->lasterror(), 'errors'); + } + } - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality); + if (!$error && !count($object->errors)) { + if (GETPOST('deletephoto') && $object->photo) { + $fileimg = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/'.$object->photo; + $dirthumbs = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/thumbs'; + dol_delete_file($fileimg); + dol_delete_dir_recursive($dirthumbs); + } + + if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) { + $dir = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user'); + + dol_mkdir($dir); + + if (@is_dir($dir)) { + $newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); + $result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']); + + if (!$result > 0) { + setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); + } else { + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality); + + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality); + } + } else { + $error ++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); } } - else + } + + if (!$error && !count($object->errors)) { + setEventMessage($langs->trans("UserModified")); + $db->commit(); + + $login = $_SESSION["dol_login"]; + if ($login && $login == $object->oldcopy->login && $object->oldcopy->login != $object->login) // Current user has changed its login { $error++; $langs->load("errors"); setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); } + } else { + $db->rollback(); } } - - if (! $error && ! count($object->errors)) + } else { + if ($caneditpassword) // Case we can edit only password { - setEventMessage($langs->trans("UserModified")); - $db->commit(); + $object->fetch($id); - $login=$_SESSION["dol_login"]; - if ($login && $login == $object->oldcopy->login && $object->oldcopy->login != $object->login) // Current user has changed its login - { - $_SESSION["dol_login"]=$object->login; // Set new login to avoid disconnect at next page + $object->oldcopy = dol_clone($object); + + $ret = $object->setPassword($user, $_POST["password"]); + if ($ret < 0) { + setEventMessage($object->error, 'errors'); } } - else - { - $db->rollback(); - } } } - else if ($caneditpassword) // Case we can edit only password - { - $object->fetch($id); $object->oldcopy = clone $object; @@ -516,100 +491,85 @@ setEventMessage($object->error, 'errors'); } } -} -// Change password with a new generated one -if ((($action == 'confirm_password' && $confirm == 'yes') -|| ($action == 'confirm_passwordsend' && $confirm == 'yes')) && $caneditpassword) -{ - $object->fetch($id); + // Change password with a new generated one + if ((($action == 'confirm_password' && $confirm == 'yes') + || ($action == 'confirm_passwordsend' && $confirm == 'yes')) && $caneditpassword + ) { + $object->fetch($id); - $newpassword=$object->setPassword($user,''); - if ($newpassword < 0) - { - // Echec - setEventMessage($langs->trans("ErrorFailedToSetNewPassword"), 'errors'); - } - else - { - // Succes - if ($action == 'confirm_passwordsend' && $confirm == 'yes') - { - if ($object->send_password($user,$newpassword) > 0) - { - setEventMessage($langs->trans("PasswordChangedAndSentTo",$object->email)); - } - else - { - setEventMessage($object->error, 'errors'); + $newpassword = $object->setPassword($user, ''); + if ($newpassword < 0) { + // Echec + setEventMessage($langs->trans("ErrorFailedToSetNewPassword"), 'errors'); + } else { + // Succes + if ($action == 'confirm_passwordsend' && $confirm == 'yes') { + if ($object->send_password($user, $newpassword) > 0) { + setEventMessage($langs->trans("PasswordChangedAndSentTo", $object->email)); + } else { + setEventMessage($object->error, 'errors'); + } + } else { + setEventMessage($langs->trans("PasswordChangedTo", $newpassword), 'errors'); } } - else - { - setEventMessage($langs->trans("PasswordChangedTo",$newpassword), 'errors'); - } } -} - -// Action initialisation donnees depuis record LDAP -if ($action == 'adduserldap') -{ - $selecteduser = $_POST['users']; - - $required_fields = array( - $conf->global->LDAP_KEY_USERS, - $conf->global->LDAP_FIELD_NAME, - $conf->global->LDAP_FIELD_FIRSTNAME, - $conf->global->LDAP_FIELD_LOGIN, - $conf->global->LDAP_FIELD_LOGIN_SAMBA, - $conf->global->LDAP_FIELD_PASSWORD, - $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, - $conf->global->LDAP_FIELD_PHONE, - $conf->global->LDAP_FIELD_FAX, - $conf->global->LDAP_FIELD_MOBILE, - $conf->global->LDAP_FIELD_SKYPE, - $conf->global->LDAP_FIELD_MAIL, - $conf->global->LDAP_FIELD_TITLE, - $conf->global->LDAP_FIELD_DESCRIPTION, - $conf->global->LDAP_FIELD_SID); - - $ldap = new Ldap(); - $result = $ldap->connect_bind(); - if ($result >= 0) - { - // Remove from required_fields all entries not configured in LDAP (empty) and duplicated - $required_fields=array_unique(array_values(array_filter($required_fields, "dol_validElement"))); - $ldapusers = $ldap->getRecords($selecteduser, $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields); - //print_r($ldapusers); + // Action initialisation donnees depuis record LDAP + if ($action == 'adduserldap') { + $selecteduser = $_POST['users']; + + $required_fields = array( + $conf->global->LDAP_KEY_USERS, + $conf->global->LDAP_FIELD_NAME, + $conf->global->LDAP_FIELD_FIRSTNAME, + $conf->global->LDAP_FIELD_LOGIN, + $conf->global->LDAP_FIELD_LOGIN_SAMBA, + $conf->global->LDAP_FIELD_PASSWORD, + $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, + $conf->global->LDAP_FIELD_PHONE, + $conf->global->LDAP_FIELD_FAX, + $conf->global->LDAP_FIELD_MOBILE, + $conf->global->LDAP_FIELD_SKYPE, + $conf->global->LDAP_FIELD_MAIL, + $conf->global->LDAP_FIELD_TITLE, + $conf->global->LDAP_FIELD_DESCRIPTION, + $conf->global->LDAP_FIELD_SID + ); - if (is_array($ldapusers)) - { - foreach ($ldapusers as $key => $attribute) - { - $ldap_lastname = $attribute[$conf->global->LDAP_FIELD_NAME]; - $ldap_firstname = $attribute[$conf->global->LDAP_FIELD_FIRSTNAME]; - $ldap_login = $attribute[$conf->global->LDAP_FIELD_LOGIN]; - $ldap_loginsmb = $attribute[$conf->global->LDAP_FIELD_LOGIN_SAMBA]; - $ldap_pass = $attribute[$conf->global->LDAP_FIELD_PASSWORD]; - $ldap_pass_crypted = $attribute[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED]; - $ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE]; - $ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX]; - $ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE]; - $ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE]; - $ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL]; - $ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID]; + $ldap = new Ldap(); + $result = $ldap->connect_bind(); + if ($result >= 0) { + // Remove from required_fields all entries not configured in LDAP (empty) and duplicated + $required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement"))); + + $ldapusers = $ldap->getRecords($selecteduser, $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields); + //print_r($ldapusers); + + if (is_array($ldapusers)) { + foreach ($ldapusers as $key => $attribute) { + $ldap_lastname = $attribute[$conf->global->LDAP_FIELD_NAME]; + $ldap_firstname = $attribute[$conf->global->LDAP_FIELD_FIRSTNAME]; + $ldap_login = $attribute[$conf->global->LDAP_FIELD_LOGIN]; + $ldap_loginsmb = $attribute[$conf->global->LDAP_FIELD_LOGIN_SAMBA]; + $ldap_pass = $attribute[$conf->global->LDAP_FIELD_PASSWORD]; + $ldap_pass_crypted = $attribute[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED]; + $ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE]; + $ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX]; + $ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE]; + $ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE]; + $ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL]; + $ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID]; + } } + } else { + setEventMessage($ldap->error, 'errors'); } } - else - { - setEventMessage($ldap->error, 'errors'); - } } - /* * View */ @@ -762,6 +722,12 @@ { print ''; } + print '
    '.fieldLabel('Employee','employee',0).''; + print $form->selectyesno("employee",(isset($_POST['employee'])?GETPOST('employee'):0),1); print '
    '; - - // Ref - print ''; - print ''; - print ''."\n"; + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); - if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; - if (! empty($conf->societe->enabled)) $rowspan++; - if (! empty($conf->adherent->enabled)) $rowspan++; - if (! empty($conf->skype->enabled)) $rowspan++; - if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; - if (! empty($conf->agenda->enabled)) $rowspan++; - // Lastname - print ''; - print ''; + print '
    '; + print '
    '; - // Photo - print '
    '; - - print ''."\n"; - - // Firstname - print ''; - print ''; - print ''."\n"; - - // Position/Job - print ''; - print ''; - print ''."\n"; - - // Gender - print ''; - print ''; + print '
    '; + print '
    '.$langs->trans("Ref").''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
    '.$langs->trans("Lastname").''.$object->lastname.''; - print $form->showphoto('userphoto',$object,100); - print '
    '.$langs->trans("Firstname").''.$object->firstname.'
    '.$langs->trans("PostOrFunction").''.$object->job.'
    '.$langs->trans("Gender").''; - if ($object->gender) print $langs->trans("Gender".$object->gender); - print '
    '; // Login print ''; if (! empty($object->ldap_sid) && $object->statut==0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -1253,24 +1183,24 @@ { if ($passDoNotExpire) { - print ''; + print ''; } else if($userChangePassNextLogon) { - print ''; + print ''; } else if($userDisabled) { - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''."\n"; + // Employee + print ''."\n"; + + // Position/Job + print ''; + print ''; + print ''."\n"; + + // Gender + print ''; + print ''; + // API key if(! empty($conf->api->enabled) && $user->admin) { print ''; - print ''; } // Administrator - print ''."\n"; } - // Tel pro - print ''; - print ''; - print ''."\n"; - - // Tel mobile - print ''; - print ''; - print ''."\n"; - - // Fax - print ''; - print ''; - print ''."\n"; - // Skype if (! empty($conf->skype->enabled)) { print ''; - print ''; + print ''; print "\n"; } - // EMail - print ''; - print ''; - print "\n"; - // Signature - print '\n"; // Hierarchy print ''; - print ''; - print ''; print "\n"; @@ -1389,14 +1315,14 @@ $text=$langs->trans("TJM"); print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; - print ''; print "\n"; // Salary print ''; - print ''; print "\n"; @@ -1404,7 +1330,7 @@ // Weeklyhours print ''; - print ''; print "\n"; @@ -1413,38 +1339,39 @@ if ($conf->salaries->enabled) { print ''; - print ''; + print ''; } // Color user if (! empty($conf->agenda->enabled)) { print ''; - print ''; print "\n"; } - // Status - print ''; - print ''; - print ''."\n"; + print '
    '.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.''.$object->login.'
    '.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("DomainPassword").''.$langs->trans("DomainPassword").''; + print ''; if ($object->pass) print preg_replace('/./i','*',$object->pass); else { @@ -1281,17 +1211,33 @@ } print '
    '.$langs->trans("Employee").''; + print yn($object->employee); + print '
    '.$langs->trans("PostOrFunction").''.$object->job.'
    '.$langs->trans("Gender").''; + if ($object->gender) print $langs->trans("Gender".$object->gender); + print '
    '.$langs->trans("ApiKey").''; + print ''; if (! empty($object->api_key)) print $langs->trans("Hidden"); - print ''; + print '
    '.$langs->trans("Administrator").''; + print '
    '.$langs->trans("Administrator").''; if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); @@ -1310,7 +1256,7 @@ print '
    '; $text=$langs->trans("Type"); print $form->textwithpicto($text, $langs->trans("InternalExternalDesc")); - print ''; + print ''; $type=$langs->trans("Internal"); if ($object->societe_id > 0) $type=$langs->trans("External"); print $type; @@ -1320,47 +1266,27 @@ // Ldap sid if ($object->ldap_sid) { - print '
    '.$langs->trans("Type").''; + print '
    '.$langs->trans("Type").''; print $langs->trans("DomainUser",$ldap->domainFQDN); print '
    '.$langs->trans("PhonePro").''.dol_print_phone($object->office_phone,'',0,0,1).'
    '.$langs->trans("PhoneMobile").''.dol_print_phone($object->user_mobile,'',0,0,1).'
    '.$langs->trans("Fax").''.dol_print_phone($object->office_fax,'',0,0,1).'
    '.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).''.dol_print_skype($object->skype,0,0,1).'
    '.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).'
    '.$langs->trans('Signature').''; + print '
    '.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); print "
    '.$langs->trans("HierarchicalResponsible").''; + print ''; if (empty($object->fk_user)) print $langs->trans("None"); else { $huser=new User($db); @@ -1379,7 +1305,7 @@ $text=$langs->trans("THM"); print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; + print ''; print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print '
    '; + print ''; print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print '
    '.$langs->trans("Salary").''; + print ''; print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print '
    '.$langs->trans("WeeklyHours").''; + print ''; print price2num($object->weeklyhours); print '
    '.$langs->trans("AccountancyCode").''.$object->accountancy_code.''.$object->accountancy_code.'
    '.$langs->trans("ColorUser").''; + print ''; print $formother->showColor($object->color, ''); print '
    '.$langs->trans("Status").''; - print $object->getLibStatut(4); - print '
    '; - print ''.$langs->trans("LastConnexion").''; - print ''.dol_print_date($object->datelastlogin,"dayhour").''; + print '
    '; + print '
    '; + + print '
    '; + print ''; + + print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { print ''; - print ''; + print ''; print "\n"; } @@ -1452,7 +1379,7 @@ if (! empty($conf->societe->enabled)) { print ''; - print ''; - print '
    '.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").'
    '.$langs->trans("PreviousConnexion").''.dol_print_date($object->datepreviouslogin,"dayhour").''.dol_print_date($object->datepreviouslogin,"dayhour").'
    '.$langs->trans("OpenIDURL").''.$object->openid.''.$object->openid.'
    '.$langs->trans("LinkToCompanyContact").''; + print ''; if (isset($object->societe_id) && $object->societe_id > 0) { $societe = new Societe($db); @@ -1480,7 +1407,7 @@ { $langs->load("members"); print '
    '.$langs->trans("LinkedToDolibarrMember").''; + print ''; if ($object->fk_member) { $adh=new Adherent($db); @@ -1502,7 +1429,7 @@ { if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { - print '
    '.$langs->trans("Entity").''; + print '
    '.$langs->trans("Entity").''; if (empty($object->entity)) { print $langs->trans("AllEntities"); @@ -1517,7 +1444,7 @@ } // Other attributes - $parameters=array('colspan' => ' colspan="2"'); + $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { @@ -1525,6 +1452,11 @@ } print "
    \n"; + print '
    '; + + print '
    '; + print '
    '; + dol_fiche_end(); @@ -1761,11 +1693,15 @@ print ''; - print ''; - print ''; - print ''; + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + print ''; + print ''; + } // Lastname print ""; @@ -1803,6 +1739,12 @@ } print ''; + // Employee + print ''; + print ''; + // Position/Job print ''; print '".''; + print ''; print ''; print ''; } - print ''; - print ''; + print ''; + print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; print "
    '.$langs->trans("Ref").''; - print $object->id; - print '
    '.$langs->trans("Ref").''; + print $object->id; + print '
    '.fieldLabel('Employee','employee',0).''; + print $form->selectyesno("employee",$object->employee,1); + print '
    '.$langs->trans("PostOrFunction").''; @@ -1884,10 +1826,16 @@ else { print ''; - $nbSuperAdmin = $user->getNbOfUsers('superadmin'); - if ($user->admin - && ($user->id != $object->id) // Don't downgrade ourself - && ($object->entity > 0 || $nbSuperAdmin > 1) // Don't downgrade a superadmin if alone + $nbAdmin = $user->getNbOfUsers('active','',1); + $nbSuperAdmin = $user->getNbOfUsers('active','superadmin',1); + //var_dump($nbAdmin); + //var_dump($nbSuperAdmin); + if ($user->admin // Need to be admin to allow downgrade of an admin + && ($user->id != $object->id) // Don't downgrade ourself + && ( + (empty($conf->multicompany->enabled) && $nbAdmin > 1) + || (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone + ) ) { print $form->selectyesno('admin',$object->admin,1); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6dc8de8db8e8a..f16af2ee72dba 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013-2014 Philippe Grand - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -46,6 +46,7 @@ class User extends CommonObject var $id=0; var $ldap_sid; var $search_sid; + var $employee; var $gender; var $email; var $skype; @@ -125,13 +126,17 @@ function __construct($db) { $this->db = $db; - // Preference utilisateur + // User preference $this->liste_limit = 0; $this->clicktodial_loaded = 0; + // For cache usage $this->all_permissions_are_loaded = 0; - $this->admin=0; - + + // Force some default values + $this->admin = 0; + $this->employee = 1; + $this->conf = new stdClass(); $this->rights = new stdClass(); $this->rights->user = new stdClass(); @@ -146,9 +151,10 @@ function __construct($db) * @param string $login Si defini, login a utiliser pour recherche * @param string $sid Si defini, sid a utiliser pour recherche * @param int $loadpersonalconf Also load personal conf of user (in $user->conf->xxx) + * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. * @return int <0 if KO, 0 not found, >0 if OK */ - function fetch($id='', $login='',$sid='',$loadpersonalconf=1) + function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1) { global $conf, $user; @@ -156,7 +162,7 @@ function fetch($id='', $login='',$sid='',$loadpersonalconf=1) $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; $sql.= " u.admin, u.login, u.note,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,"; $sql.= " u.fk_soc, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid,"; @@ -177,15 +183,22 @@ function fetch($id='', $login='',$sid='',$loadpersonalconf=1) $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - if ((empty($conf->multicompany->enabled) || empty($conf->multicompany->transverse_mode)) && (! empty($user->entity))) + if ($entity < 0) { - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + if ((empty($conf->multicompany->enabled) || empty($conf->multicompany->transverse_mode)) && (! empty($user->entity))) + { + $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + } + else + { + $sql.= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database + } } - else + else // The fetch was forced on an entity { - $sql.= " WHERE u.entity IS NOT NULL"; + $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; } - + if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba { $sql.= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; @@ -215,6 +228,8 @@ function fetch($id='', $login='',$sid='',$loadpersonalconf=1) $this->ldap_sid = $obj->ldap_sid; $this->lastname = $obj->lastname; $this->firstname = $obj->firstname; + + $this->employee = $obj->employee; $this->login = $obj->login; $this->gender = $obj->gender; @@ -1145,6 +1160,7 @@ function update($user,$notrigger=0,$nosyncmember=0,$nosyncmemberpass=0) // Clean parameters $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); + $this->employee = $this->employee?$this->employee:0; $this->login = trim($this->login); $this->gender = trim($this->gender); $this->pass = trim($this->pass); @@ -1185,6 +1201,7 @@ function update($user,$notrigger=0,$nosyncmember=0,$nosyncmemberpass=0) $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; $sql.= " lastname = '".$this->db->escape($this->lastname)."'"; $sql.= ", firstname = '".$this->db->escape($this->firstname)."'"; + $sql.= ", employee = ".$this->employee; $sql.= ", login = '".$this->db->escape($this->login)."'"; $sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null"); $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' @@ -1808,14 +1825,15 @@ function RemoveFromGroup($group, $entity, $notrigger=0) * @param int $width Width of image * @param int $height Height of image * @param string $cssclass Force a css class + * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='') + function getPhotoUrl($width, $height, $cssclass='', $imagesize='') { $result=''; $result.=''; - $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass); + $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); $result.=''; return $result; @@ -1825,25 +1843,27 @@ function getPhotoUrl($width, $height, $cssclass='') * Return a link to the user card (with optionaly the picto) * Use this->id,this->lastname, this->firstname * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) * @param string $option On what the link point to - * @param integer $infologin Add connection info to the tooltip - * @param integer $notooltip 1=Disable tooltip + * @param integer $infologin Add complete info tooltip + * @param integer $notooltip 1=Disable tooltip on picto and name * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user - * @param string $mode 'firstname'=Show only firstname + * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='') + function getNomUrl($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0; + $result = ''; $companylink = ''; + $link = ''; $label = '' . $langs->trans("User") . ''; $label.= '
    '; @@ -1866,7 +1886,7 @@ function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen if (! empty($this->photo)) { $label.= '
    '; - $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip'); + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); $label.= '
    '; } @@ -1891,18 +1911,41 @@ function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen if (! empty($_SESSION["disablemodules"])) $label.= '
    '.$langs->trans("DisabledModules").':
    '.join(', ',explode(',',$_SESSION["disablemodules"])); } - - $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $langs->load("users"); + $label=$langs->trans("ShowUser"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } $link.= '>'; $linkend=''; - if ($withpicto) + //if ($withpictoimg == -1) $result.='
    '; + $result.=$link; + if ($withpictoimg) { - $result.=($link.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$linkend); - if ($withpicto != 2) $result.=' '; - } - $result.= $link . $this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen) . $linkend . $companylink; + $paddafterimage=''; + if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; + if ($withpictoimg > 0) $picto='
    '.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
    '; + else $picto='
    '.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
    '; + $result.=$picto; + } + if (abs($withpictoimg) != 2) + { + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
    '; + if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); + else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
    '; + } + $result.=$linkend; + //if ($withpictoimg == -1) $result.='
    '; + $result.=$companylink; return $result; } @@ -2194,25 +2237,27 @@ function getNbOfEMailings() /** * Return number of existing users * - * @param string $limitTo Limit to 'active' or 'superadmin' users - * @param bool $all Return for all entities + * @param string $limitTo Limit to '' or 'active' + * @param string $option 'superadmin' = return for entity 0 only + * @param int $admin Filter on admin tag * @return int Number of users */ - function getNbOfUsers($limitTo='active', $all=false) + function getNbOfUsers($limitTo, $option='', $admin=-1) { global $conf; $sql = "SELECT count(rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."user"; - if ($limitTo == 'superadmin') + if ($option == 'superadmin') { $sql.= " WHERE entity = 0"; + if ($admin >= 0) $sql.= " AND admin = ".$admin; } else { - if ($all) $sql.= " WHERE entity > 0"; // all users except superadmins - else $sql.= " WHERE entity = ".$conf->entity; + $sql.=" WHERE entity IN (".getEntity('user',0).")"; if ($limitTo == 'active') $sql.= " AND statut = 1"; + if ($admin >= 0) $sql.= " AND admin = ".$admin; } $resql=$this->db->query($sql); @@ -2226,7 +2271,7 @@ function getNbOfUsers($limitTo='active', $all=false) } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -1; } } @@ -2355,7 +2400,7 @@ function get_full_tree($deleteafterid=0, $filter='') $this->load_parentof(); // Init $this->users array - $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates + $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) { @@ -2385,6 +2430,8 @@ function get_full_tree($deleteafterid=0, $filter='') $this->users[$obj->rowid]['entity'] = $obj->entity; $this->users[$obj->rowid]['email'] = $obj->email; $this->users[$obj->rowid]['gender'] = $obj->gender; + $this->users[$obj->rowid]['admin'] = $obj->admin; + $this->users[$obj->rowid]['photo'] = $obj->photo; $i++; } } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 7aaaebbac3eb7..13aaff9560ff0 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -41,25 +41,33 @@ } $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); /* * Actions */ -if ($action == 'update' && ! GETPOST('cancel')) -{ - $edituser = new User($db); - $edituser->fetch($id); +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - $edituser->clicktodial_url = GETPOST("url"); - $edituser->clicktodial_login = GETPOST("login"); - $edituser->clicktodial_password = GETPOST("password"); - $edituser->clicktodial_poste = GETPOST("poste"); +if (empty($reshook)) { + if ($action == 'update' && !GETPOST('cancel')) { + $edituser = new User($db); + $edituser->fetch($id); - $result=$edituser->update_clicktodial(); - if ($result < 0) setEventMessage($edituser->error,'errors'); -} + $edituser->clicktodial_url = GETPOST("url"); + $edituser->clicktodial_login = GETPOST("login"); + $edituser->clicktodial_password = GETPOST("password"); + $edituser->clicktodial_poste = GETPOST("poste"); + $result = $edituser->update_clicktodial(); + if ($result < 0) { + setEventMessage($edituser->error, 'errors'); + } + } +} /* @@ -73,49 +81,24 @@ if ($id > 0) { - $fuser = new User($db); - $fuser->fetch($id); - $fuser->fetch_clicktodial(); + $object = new User($db); + $object->fetch($id); + $object->fetch_clicktodial(); - /* - * Affichage onglets - */ - $head = user_prepare_head($fuser); + $head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'clicktodial', $title, 0, 'user'); - /* - * Fiche en mode visu - */ - - print ''; - - // Ref - print ''; - print ''; - print ''; - - // Name - print ''; - print ''; - print "\n"; - - // Firstname - print ''; - print ''; - print "\n"; - - print "
    '.$langs->trans("Ref").''; - print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); - print '
    '.$langs->trans("Lastname").''.$fuser->lastname.'
    '.$langs->trans("Firstname").''.$fuser->firstname.'
    \n"; - print "
    \n"; - - // Edit mode + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
    '; + + // Edit mode if ($action == 'edit') { - print ''; + print ''; print ''; print ''; print ''; @@ -124,8 +107,8 @@ { print ''; print ''; } - print ''; + print ''; print ''; + print ''; print "\n"; - print ''; + print ''; print ''; + print ''; print ''; - print ''; + print ''; print ''; + print ''; print "\n"; print '
    ClickToDial URL'; - print ''; - if (empty($conf->global->CLICKTODIAL_URL) && empty($fuser->clicktodial_url)) + print ''; + if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url)) { $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete").''; @@ -138,19 +121,19 @@ print '
    ClickToDial '.$langs->trans("IdPhoneCaller").'
    ClickToDial '.$langs->trans("IdPhoneCaller").''; - print '
    ClickToDial '.$langs->trans("Login").'
    ClickToDial '.$langs->trans("Login").''; - print '
    ClickToDial '.$langs->trans("Password").'
    ClickToDial '.$langs->trans("Password").''; - print '
    '; @@ -169,10 +152,10 @@ if (! empty($user->admin)) { - print "
    ClickToDial URL
    ClickToDial URL'; $url=$conf->global->CLICKTODIAL_URL; - if (! empty($fuser->clicktodial_url)) $url=$fuser->clicktodial_url; + if (! empty($object->clicktodial_url)) $url=$object->clicktodial_url; if (empty($url)) { $langs->load("errors"); @@ -180,28 +163,29 @@ } else { - print $form->textwithpicto((empty($fuser->clicktodial_url)?$langs->trans("DefaultLink").': ':'').$url,$langs->trans("ClickToDialUrlDesc")); + print $form->textwithpicto((empty($object->clicktodial_url)?$langs->trans("DefaultLink").': ':'').$url,$langs->trans("ClickToDialUrlDesc")); } print '
    ClickToDial '.$langs->trans("IdPhoneCaller").''.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').'
    ClickToDial '.$langs->trans("IdPhoneCaller").''.(! empty($object->clicktodial_poste)?$object->clicktodial_poste:'').'
    ClickToDial '.$langs->trans("Login").''.(! empty($fuser->clicktodial_login)?$fuser->clicktodial_login:'').'
    ClickToDial '.$langs->trans("Login").''.(! empty($object->clicktodial_login)?$object->clicktodial_login:'').'
    ClickToDial '.$langs->trans("Password").''.preg_replace('/./','*',(! empty($fuser->clicktodial_password)?$fuser->clicktodial_password:'')).'
    ClickToDial '.$langs->trans("Password").''.preg_replace('/./','*',(! empty($object->clicktodial_password)?$object->clicktodial_password:'')).'
    \n"; } - print "\n"; + dol_fiche_end(); + /* * Barre d'actions @@ -210,11 +194,10 @@ if (! empty($user->admin) && $action <> 'edit') { - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } print "\n"; - print "
    \n"; } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 25dea7eb3986f..ef4f6650818ea 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2013 Cédric Salvador @@ -93,12 +93,20 @@ $upload_dir = $conf->user->multidir_output[$entitytouseforuserdir] . "/" . $object->id ; } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); + /* * Actions */ -include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if (empty($reshook)) { + include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php'; +} /* * View @@ -121,7 +129,10 @@ dol_fiche_head($head, 'document', $langs->trans("User"),0,'user'); - + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
    '; + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -133,20 +144,6 @@ print ''; - // Reference - print ''; - print ''; - print ''; - - // Lastname - print ''; - print ''; - - // Firstname - print ''; - // Login print ''; diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 058f3ac92e296..f515c8307e7cf 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -94,7 +94,7 @@ print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],"g.entity",$param,"",'align="center"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("NbOfUsers"),$_SERVER["PHP_SELF"],"nb",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; $var=True; while ($i < $num) diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 23356c0888956..14b8ec4265b35 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -82,13 +82,17 @@ { $userstatic->id=$val['id']; $userstatic->ref=$val['label']; + $userstatic->login=$val['login']; $userstatic->firstname=$val['firstname']; $userstatic->lastname=$val['lastname']; $userstatic->statut=$val['statut']; $userstatic->email=$val['email']; $userstatic->gender=$val['gender']; $userstatic->societe_id=$val['fk_soc']; - + $userstatic->admin=$val['admin']; + $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; + $entity=$val['entity']; $entitystring=''; @@ -109,13 +113,22 @@ } } - $li=$userstatic->getNomUrl(1,'').' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; - + $li=$userstatic->getNomUrl(-1,'',0,1); + if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity) + { + $li.=img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($userstatic->admin) + { + $li.=img_picto($langs->trans("Administrator"),'star'); + } + $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; + $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_user'], 'statut'=>$val['statut'], - 'entry'=>'
    '.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
    '.$langs->trans("Lastname").''.$object->lastname.' 
    '.$langs->trans("Firstname").''.$object->firstname.' 
    '.$langs->trans("Login").''.$object->login.' 
    '.$li.''.$userstatic->getLibStatut(5).'
    ' + 'entry'=>'
    '.$li.''.$userstatic->getLibStatut(3).'
    ' ); } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 921697ade5110..3af01d290464b 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -45,23 +45,35 @@ $search_login=GETPOST('search_login','alpha'); $search_lastname=GETPOST('search_lastname','alpha'); $search_firstname=GETPOST('search_firstname','alpha'); +$search_accountancy_code=GETPOST('search_accountancy_code','alpha'); +$search_email=GETPOST('search_email','alpha'); $search_statut=GETPOST('search_statut','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); +$search_supervisor=GETPOST('search_supervisor','alpha'); +$search_previousconn=GETPOST('search_previousconn','alpha'); $optioncss = GETPOST('optioncss','alpha'); if ($search_statut == '') $search_statut='1'; +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = $conf->liste_limit; if (! $sortfield) $sortfield="u.login"; if (! $sortorder) $sortorder="ASC"; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('userlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('user'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $userstatic=new User($db); $companystatic = new Societe($db); $form = new Form($db); @@ -72,10 +84,40 @@ $search_login=""; $search_lastname=""; $search_firstname=""; + $search_accountancy_code=""; + $search_email=""; $search_statut=""; $search_thirdparty=""; + $search_supervisor=""; + $search_datelastlogin=""; + $search_datepreviouslogin=""; + $search_date_creation=""; + $search_date_update=""; + $search_array_options=array(); } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'u.login'=>"Login", + 'u.lastname'=>"Lastname", + 'u.firstname'=>"Firstname", + 'u.accountancy_code'=>"AccountancyCode", + 'u.email'=>"EMail", + 'u.note'=>"Note" +); + + +/* + * Actions + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + /* * View @@ -87,14 +129,20 @@ print load_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy); -$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.gender,"; -$sql.= " u.datec,"; -$sql.= " u.tms as datem,"; -$sql.= " u.datelastlogin,"; +$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.accountancy_code, u.gender, u.photo,"; +$sql.= " u.datelastlogin, u.datepreviouslogin,"; $sql.= " u.ldap_sid, u.statut, u.entity,"; -$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,"; +$sql.= " u.tms as date_update, u.datec as date_creation,"; +$sql.= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2,"; $sql.= " s.nom as name, s.canvas"; +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user_extrafields as ef on (u.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) @@ -106,14 +154,35 @@ $sql.= " WHERE u.entity IN (".getEntity('user',1).")"; } if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; -if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); -if ($search_login != '') $sql.= natural_search("u.login", $search_login); -if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); -if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_login != '') $sql.= natural_search("u.login", $search_login); +if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); +if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); +if ($search_email != '') $sql.= natural_search("u.email", $search_email); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall); +if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.=$db->order($sortfield,$sortorder); +//$sql.= $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); if ($result) @@ -121,54 +190,183 @@ $num = $db->num_rows($result); $i = 0; + $param=''; + if ($sall != '') $param.='&sall='.urlencode($sall); + if ($search_user != '') $param.="&search_user=".$search_user; + if ($search_login != '') $param.="&search_login=".$search_login; + if ($search_lastname != '') $param.="&search_lastname=".$search_lastname; + if ($search_firstname != '') $param.="&search_firstname=".$search_firstname; + if ($search_accountancy_code != '') $param.="&search_accountancy_code=".$search_accountancy_code; + if ($search_email != '') $param.="&search_email=".$search_email; + if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor; + if ($search_statut != '') $param.="&search_statut=".$search_statut; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print ''."\n"; if ($optioncss != '') print ''; - - $param="search_user=".$search_user."&sall=".$sall; - $param.="&search_statut=".$search_statut; - if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print ''; - print ''; - print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) + print ''; + print ''; + print ''; + print ''; + + if ($sall) { - print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); } - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER['PHP_SELF'],"u.datec",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + + $arrayfields=array( + 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), + 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), + 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), + 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), + 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), + 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), + 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), + 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'u.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 '
    '; + print ''; + if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"u.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"u.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"u.statut","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; // Search bar - $colspan=3; - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Status - print ''; - - print ''; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_user']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) print ''; + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) + { + // Date creation + print ''; + } + if (! empty($arrayfields['u.tms']['checked'])) + { + // Date modification + print ''; + } + if (! empty($arrayfields['u.statut']['checked'])) + { + // Status + print ''; + } + // Action column + print ''; - + print "\n"; $user2=new User($db); $var=True; + //while ($i < min($num,$conf->liste_limit)) while ($i < $num) { $obj = $db->fetch_object($result); @@ -181,89 +379,177 @@ $userstatic->email=$obj->email; $userstatic->gender=$obj->gender; $userstatic->societe_id=$obj->fk_soc; - $userstatic->firstname=''; - $userstatic->lastname=$obj->login; - - $li=$userstatic->getNomUrl(1,'',0,0,24,1); + $userstatic->firstname=$obj->firstname; + $userstatic->lastname=$obj->lastname; + $userstatic->photo=$obj->photo; + + $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); print ""; - print ''; - print ''; - print ''; - print "'; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print "'; + } + // Multicompany enabled + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) { - $companystatic->id=$obj->fk_soc; - $companystatic->name=$obj->name; - $companystatic->canvas=$obj->canvas; - print $companystatic->getNomUrl(1); + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } } - else if ($obj->ldap_sid) + // Supervisor + if (! empty($arrayfields['u.fk_user']['checked'])) + { + // Resp + print ''; + } + + // Date last login + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''; + } + // Date previous login + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['u.datec']['checked'])) { - print $langs->trans("DomainUser"); + print ''; } - else - { - print $langs->trans("InternalUser"); - } - print ''; - - // Multicompany enabled - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) + // Date modification + if (! empty($arrayfields['u.tms']['checked'])) { - print ''; + print ''; } - - // Date creation - print ''; - - // Date last login - print ''; - - // Resp - print ''; } - print ''; + // Action column + print ''; - // Statut - $userstatic->statut=$obj->statut; - print ''; - print ''; print "\n"; $i++; } + + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print "
     '; - print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); - print ''; + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + print ''; + print ''; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; + print ''; print ''; print '
    '; - print $li; - if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) - { - print img_picto($langs->trans("SuperAdministrator"),'redstar'); - } - else if ($obj->admin) - { - print img_picto($langs->trans("Administrator"),'star'); - } - print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).'"; - if ($obj->fk_soc) + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + print $li; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"),'star'); + } + print ''.$obj->lastname.''.$obj->firstname.''.$obj->accountancy_code.''.$obj->email.'"; + if ($obj->fk_soc) + { + $companystatic->id=$obj->fk_soc; + $companystatic->name=$obj->name; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1); + } + else if ($obj->ldap_sid) + { + print $langs->trans("DomainUser"); + } + else + { + print $langs->trans("InternalUser"); + } + print ''; + if (! $obj->entity) + { + print $langs->trans("AllEntities"); + } + else + { + // $mc is defined in conf.class.php if multicompany enabled. + if (is_object($mc)) + { + $mc->getInfo($obj->entity); + print $mc->label; + } + } + print ''; + if ($obj->login2) + { + $user2->id=$obj->id2; + $user2->login=$obj->login2; + $user2->lastname=$obj->lastname2; + $user2->firstname=$obj->firstname2; + $user2->gender=$obj->gender2; + $user2->photo=$obj->photo2; + $user2->admin=$obj->admin2; + $user2->email=$obj->email2; + $user2->societe_id=$obj->fk_soc2; + print $user2->getNomUrl(-1,'',0,0,24,0,''); + if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin2) + { + print img_picto($langs->trans("Administrator"),'star'); + } + } + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''; + print dol_print_date($obj->date_creation, 'dayhour'); + print ''; - if (! $obj->entity) - { - print $langs->trans("AllEntities"); - } - else - { - // $mc is defined in conf.class.php if multicompany enabled. - if (is_object($mc)) - { - $mc->getInfo($obj->entity); - print $mc->label; - } - } - print ''; + print dol_print_date($obj->date_update, 'dayhour'); + print ''.dol_print_date($db->jdate($obj->datec),"dayhour").''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''; - if ($obj->login2) + // Status + if (! empty($arrayfields['u.statut']['checked'])) { - $user2->login=$obj->login2; - //$user2->lastname=$obj->lastname2; - //$user2->firstname=$obj->firstname2; - $user2->lastname=$user2->login; - $user2->firstname=''; - print $user2->getNomUrl(1); + $userstatic->statut=$obj->statut; + print ''.$userstatic->getLibStatut(3).''.$userstatic->getLibStatut(5).' 
    "; print "\n"; $db->free($result); diff --git a/htdocs/user/info.php b/htdocs/user/info.php index e2fdcc7b6ec4a..f069ac4782bdb 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -54,6 +54,8 @@ * View */ +$form = new Form($db); + llxHeader(); $object->info($id); @@ -64,12 +66,24 @@ dol_fiche_head($head, 'info', $title, 0, 'user'); -print '
    '; +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + +print '
    '; + +print '
    '; + +print '
    '; + dol_print_object_info($object); -print '
    '; print ''; -$db->close(); + +dol_fiche_end(); + llxFooter(); +$db->close(); diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 0ee41812c29a0..48e4f8fcbb606 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -45,37 +45,41 @@ $object->fetch($id); $object->getrights(); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); /* * Actions */ -if ($_GET["action"] == 'dolibarr2ldap') -{ - $db->begin(); - $ldap=new Ldap(); - $result=$ldap->connect_bind(); +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - $info=$object->_load_ldap_info(); - $dn=$object->_load_ldap_dn($info); - $olddn=$dn; // We can say that old dn = dn as we force synchro +if (empty($reshook)) { + if ($_GET["action"] == 'dolibarr2ldap') { + $db->begin(); - $result=$ldap->update($dn,$info,$user,$olddn); + $ldap = new Ldap(); + $result = $ldap->connect_bind(); - if ($result >= 0) - { - setEventMessage($langs->trans("UserSynchronized")); - $db->commit(); - } - else - { - setEventMessage($ldap->error, 'errors'); - $db->rollback(); + $info = $object->_load_ldap_info(); + $dn = $object->_load_ldap_dn($info); + $olddn = $dn; // We can say that old dn = dn as we force synchro + + $result = $ldap->update($dn, $info, $user, $olddn); + + if ($result >= 0) { + setEventMessage($langs->trans("UserSynchronized")); + $db->commit(); + } else { + setEventMessage($ldap->error, 'errors'); + $db->rollback(); + } } } - /* * View */ @@ -89,27 +93,14 @@ $title = $langs->trans("User"); dol_fiche_head($head, 'ldap', $title, 0, 'user'); -print ''; +dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); -// Ref -print ''; -print ''; -print ''; - -// Lastname -print ''; -print ''; -print "\n"; +print '
    '; -// Firstname -print ''; -print ''; -print "\n"; +print '
    '.$langs->trans("Ref").''; -print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); -print '
    '.$langs->trans("Lastname").''.$object->lastname.'
    '.$langs->trans("Firstname").''.$object->firstname.'
    '; // Login -print ''; +print ''; if ($object->ldap_sid) { print ''; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 7fe5766cd3a0d..7780227fb008a 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -48,30 +48,32 @@ if ($user->id == $id) $feature2=''; // A user can always read its own card $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); - +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); /******************************************************************************/ /* Actions */ /******************************************************************************/ -if ($action == 'update' && $user->rights->user->user->creer && ! $_POST["cancel"]) -{ - $db->begin(); - - $res=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES)); - if ($res < 0) - { - $mesg='
    '.$adh->error.'
    '; - $db->rollback(); - } - else - { - $db->commit(); +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { + if ($action == 'update' && $user->rights->user->user->creer && !$_POST["cancel"]) { + $db->begin(); + + $res = $object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES)); + if ($res < 0) { + $mesg = '
    '.$adh->error.'
    '; + $db->rollback(); + } else { + $db->commit(); + } } } - /******************************************************************************/ /* Affichage fiche */ /******************************************************************************/ @@ -87,33 +89,21 @@ $title = $langs->trans("User"); dol_fiche_head($head, 'note', $title, 0, 'user'); - if ($msg) print '
    '.$msg.'
    '; - - print ""; + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
    '; + + print ""; print ''; print '
    '.$langs->trans("Login").'
    '.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").'
    '; - // Reference - print ''; - print ''; - print ''; - - // Lastname - print ''; - print ''; - - // Firstname - print ''; - // Login - print ''; + print ''; // Note print ''; - print '
    '.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
    '.$langs->trans("Lastname").''.$object->lastname.' 
    '.$langs->trans("Firstname").''.$object->firstname.' 
    '.$langs->trans("Login").''.$object->login.' 
    '.$langs->trans("Login").''.$object->login.' 
    '.$langs->trans("Note").''; + print ''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 9e67a1015c75a..85b4ba04e8493 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -74,24 +74,32 @@ $form = new Form($db); $formadmin=new FormAdmin($db); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('usercard','globalcard')); /* * Actions */ -if ($action == 'update' && ($caneditfield || ! empty($user->admin))) -{ - if (! $_POST["cancel"]) - { - $tabparam=array(); - - if ($_POST["check_MAIN_LANG_DEFAULT"]=="on") $tabparam["MAIN_LANG_DEFAULT"]=$_POST["main_lang_default"]; - else $tabparam["MAIN_LANG_DEFAULT"]=''; - - if ($_POST["check_SIZE_LISTE_LIMIT"]=="on") $tabparam["MAIN_SIZE_LISTE_LIMIT"]=$_POST["main_size_liste_limit"]; - else $tabparam["MAIN_SIZE_LISTE_LIMIT"]=''; +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { + if ($action == 'update' && ($caneditfield || !empty($user->admin))) { + if (!$_POST["cancel"]) { + $tabparam = array(); + + if ($_POST["check_MAIN_LANG_DEFAULT"] == "on") { + $tabparam["MAIN_LANG_DEFAULT"] = $_POST["main_lang_default"]; + } else { + $tabparam["MAIN_LANG_DEFAULT"] = ''; + } - if ($_POST["check_MAIN_THEME"]=="on") $tabparam["MAIN_THEME"]=$_POST["main_theme"]; - else $tabparam["MAIN_THEME"]=''; + if ($_POST["check_SIZE_LISTE_LIMIT"] == "on") { + $tabparam["MAIN_SIZE_LISTE_LIMIT"] = $_POST["main_size_liste_limit"]; + } else { + $tabparam["MAIN_SIZE_LISTE_LIMIT"] = ''; + } $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); if ($val == '') $tabparam['THEME_ELDY_TOPMENU_BACK1']=''; @@ -108,15 +116,18 @@ $tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"]; $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"]; - $result=dol_set_user_param($db, $conf, $object, $tabparam); + $tabparam["MAIN_SEARCHFORM_CONTACT"] = $_POST["main_searchform_contact"]; + $tabparam["MAIN_SEARCHFORM_SOCIETE"] = $_POST["main_searchform_societe"]; + $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"] = $_POST["main_searchform_produitservice"]; + + $result = dol_set_user_param($db, $conf, $object, $tabparam); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } } } - - /* * View */ @@ -136,33 +147,18 @@ } -dol_fiche_head($head, 'guisetup', $title, 0, 'user'); - - -print ''; - -// Ref -print ''; -print ''; -print ''; - -// LastName -print ''; -print ''; -print "\n"; - -// FirstName -print ''; -print ''; -print "\n"; - -print '
    '.$langs->trans("Ref").''; -print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); -print '
    '.$langs->trans("LastName").''.$object->lastname.'
    '.$langs->trans("FirstName").''.$object->firstname.'

    '; - - if ($action == 'edit') { + dol_fiche_head($head, 'guisetup', $title, 0, 'user'); + + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + + print '
    '; + + print '
    '; + + if (! empty($conf->use_javascript_ajax)) {/* print '