Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Marc Guenneugues 2020-04-25 10:13:38 +02:00
commit 2f443ebf1d
2405 changed files with 55008 additions and 47522 deletions

View File

@ -4,7 +4,7 @@ How to contribute to Dolibarr
Bug reports and feature requests Bug reports and feature requests
-------------------------------- --------------------------------
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum). <a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum).
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
@ -104,31 +104,32 @@ Long description (Can span accross multiple lines).
Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and
a process to follow to optimize the chance to have PRs merged efficiently... a process to follow to optimize the chance to have PRs merged efficiently...
When submitting a pull request, use same rule as [Commits](#commits) for the message. * A PR must be atomic. It means it must contains the lower possible changes for 1 need (1 bug fix or 1 new feature) without breaking usability of code. If a PR can be split into several PRs, it often means your PR is not atomic.
If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you.
Otherwise, please be a bit verbose about what you're providing. * Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks.
* When submitting a pull request, use same rule as [Commits](#commits) for the message. If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you. Otherwise, please be a bit verbose about what you're providing.
Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks.
Also, some code changes need a prior approbation: Also, some code changes need a prior approbation:
* if you want to include a new external library (into htdocs/includes directory), please ask before to the project manager (@eldy) to see if such a library can be accepted. * if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-yoda in your issue) to see if such a library can be accepted.
* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@eldy) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. * if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-yoda) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest.
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case). Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
If the label of PR start with "WIP" (Work In Progress), it will not be analyzed (until you change the label of PR). If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion).
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration. If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet. If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR. In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR.
Statistics on Dolibarr project shows that around 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source project (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%. A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level. Statistics on Dolibarr project shows that 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source projects (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%. A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level.
### Resources ### Resources
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation) [Developer documentation](https://wiki.dolibarr.org/index.php/Developer_documentation)
Translations Translations
------------ ------------
@ -144,11 +145,11 @@ to retreive all old translation of a source text, and restore the translation in
### Resources ### Resources
[Translator documentation](http://wiki.dolibarr.org/index.php/Translator_documentation) [Translator documentation](https://wiki.dolibarr.org/index.php/Translator_documentation)
Documentation Documentation
------------- -------------
The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php). The project's documentation is maintained on the [Wiki](https://wiki.dolibarr.org/index.php).
*Note*: to help prevent spam, you need to create an account before being able to edit. Everybody is welcome to contribute to its content. *Note*: to help prevent spam, you need to create an account before being able to edit. Everybody is welcome to contribute to its content.

View File

@ -41,7 +41,7 @@ Ace 1.4.8 BSD Yes
ChartJS 2.9.3 MIT License Yes JS library for graph ChartJS 2.9.3 MIT License Yes JS library for graph
jQuery 3.4.1 MIT License Yes JS library jQuery 3.4.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images)

View File

@ -13,7 +13,7 @@ For Developers or integrators:
- replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
- remove input field in form '<input type="hidden" name="page" value="'.$page.'">';' - remove input field in form '<input type="hidden" name="page" value="'.$page.'">';'
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste - add parameter $pagenavastextinput to value 1 when calling print_barre_liste
* UserGroup class has been refactored with new architecture. Triggers of class UserGroup are now USERGROUP_CREATE, USERGROUP_MODIFY, USERGROUP_DELETE
WARNING: WARNING:

View File

@ -5,7 +5,7 @@
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelances. It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers.
You can freely use, study, modify or distribute it according to its Free Software licence. You can freely use, study, modify or distribute it according to its Free Software licence.
@ -27,7 +27,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
- DoliWamp for Windows - [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)
- DoliDeb for Debian or Ubuntu - DoliDeb for Debian or Ubuntu
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
@ -67,6 +67,7 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL)
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free. If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
## UPGRADING ## UPGRADING
- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr
@ -85,28 +86,27 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Main application/modules (all optional) ### Main application/modules (all optional)
- Customers, Prospects (Leads) and/or Suppliers directory - Customers, Prospects (Leads) and/or Suppliers directory + Contacts
- Members management
- Products and/or Services catalog - Products and/or Services catalog
- Commercial proposals management - Commercial proposals management
- Customer and Supplier Orders management - Customer & Supplier Orders management
- Shipping management
- Warehouse/Stock management
- Invoices and payment management - Invoices and payment management
- Standing orders management (European SEPA) - Standing orders management (European SEPA)
- Bank accounts management - Bank accounts management
- Accounting management - Accounting management
- Shared calendar/agenda (with ical and vcal export for third party tools integration) - Shared calendar/agenda (with ical and vcal export for third party tools integration)
- Opportunities and/or project management - Opportunities and/or project management
- Projects management - Projects & Tasks management
- Contracts management - Contracts management
- Warehouse/Stock management
- Shipping management
- Interventions management - Interventions management
- Employee's leave requests management - Employee's leave requests management
- Expense reports - Expense reports
- Timesheets - Timesheets
- Electronic Document Management (EDM) - Electronic Document Management (EDM)
- Foundations members management - Foundations members management
- Mass emailing
- Surveys
- Point of Sale (POS) - Point of Sale (POS)
- … - …
@ -115,11 +115,13 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Bookmarks management - Bookmarks management
- Donations management - Donations management
- Reporting - Reporting
- Surveys
- Data export/import - Data export/import
- Barcodes support - Barcodes support
- Margin calculations - Margin calculations
- LDAP connectivity - LDAP connectivity
- ClickToDial integration - ClickToDial integration
- Mass emailing
- RSS integration - RSS integration
- Skype integration - Skype integration
- Payment platforms integration (PayPal, Stripe, Paybox...) - Payment platforms integration (PayPal, Stripe, Paybox...)

View File

@ -1,45 +1,47 @@
[CustomMessages] [CustomMessages]
NameAndVersion=%1 versió %2 NameAndVersion=%1 versió %2
AdditionalIcons=Icones addicionals: AdditionalIcons=Icones addicionals:
CreateDesktopIcon=Crea una icona a l'&Escriptori CreateDesktopIcon=Crea una icona a l'&Escriptori
CreateQuickLaunchIcon=Crea una icona a la &Barra de tasques CreateQuickLaunchIcon=Crea una icona a la &Barra de tasques
ProgramOnTheWeb=%1 a Internet ProgramOnTheWeb=%1 a Internet
UninstallProgram=Desinstal·la %1 UninstallProgram=Desinstal·la %1
LaunchProgram=Obre %1 LaunchProgram=Obre %1
AssocFileExtension=&Associa %1 amb l'extensió de fitxer %2 AssocFileExtension=&Associa %1 amb l'extensió de fitxer %2
AssocingFileExtension=Associant %1 amb l'extensió de fitxer %2... AssocingFileExtension=Associant %1 amb l'extensió de fitxer %2...
YouWillInstallDoliWamp=Va a instal·lar o actualitzar (Apache + Mysql + PHP + Dolibarr) al seu ordinador. YouWillInstallDoliWamp=Instal·laràs DoliWamp (Dolibarr i altres programaris com Apache, Mysql i PHP) al teu ordinador.
ThisAssistantInstallOrUpgrade=Aquest assistent instal·la o actualitza Dolibarr ERP-CRM i tots els seus requisits (Apache, Mysql i PHP) optimitzats per a l'ús de Dolibarr. ThisAssistantInstallOrUpgrade=ALERTA: Utilitzar un ERP CRM instal·lat en un ordinador en local pot ser perillós: si l'ordinador s'espatlla, pots perdre totes les teves dades. Fes-ho si estàs preparat per autogestionar-te còpies de seguretat. Si no, pots utilitzar una instal·lació Saas (pots veure https://saas.dolibarr.org).
IfYouHaveTechnicalKnowledge=Si teniu coneixements tècnics i necessita usar la seva Apache, Mysql i PHP amb altres aplicacions a part de Dolibarr, no utilitzeu aquest assistent, hauria lació manual d'Dolibarr sobre un Apache, Mysql i PHP existent. IfYouHaveTechnicalKnowledge=Si tens coneixements tècnics i vols autogestionar el teu Apache, Mysql i PHP, no utilitzis aquest assistent i fes una instal·lació manual de Dolibarr sobre un servidor existent d'Apache, Mysql i PHP.
ButIfYouLook=Però si busca una instal·lació automàtica, es troba en el bon camí... ButIfYouLook=Però si busques una instal·lació automàtica en el teu propi ordinador, et trobes en el bon camí...
DoYouWantToStart=Vol iniciar el procés d'instal·lació/actualització? DoYouWantToStart=Vols iniciar el procés d'instal·lació?
TechnicalParameters=Paràmetres tècnics TechnicalParameters=Paràmetres tècnics
IfFirstInstall=Si es tracta de la primera instal lació, haurà d'especificar alguns paràmetres tècnics. Si no els entén, no sabeu o va a procedir a una actualització, deixi els camps amb els valors proposats per defecte. IfFirstInstall=Si es tracta de la primera instal·lació, hauràs d'especificar alguns paràmetres tècnics. Si no els entens, no n'estàs segur, o estàs fent una actualització, pots deixar els valors per defecte.
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS ; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS
SMTPServer=Servidor SMTP (El seu o el del seu ISP, únicament primera instal.lació) : SMTPServer=Servidor SMTP (propi o ISP, només primera instal·lació) :
ApachePort=Puerto Apache (únicament primera instal.lació, normalment és el 80) : ApachePort=Port Apache (només primera instal·lació, normalment el 80) :
MySqlPort=Puerto Mysql (únicament primera instal.lació, normalment és el 3306) : MySqlPort=Port MySql (només primera instal·lació, normalment el 3306) :
MySqlPassword=Contrasenya del servidor i la base de dades MySQL de root (únicament primera instal.lació): MySqlPassword=Contrasenya del servidor i base de dades MySql de root (només primera instal·lació):
FailedToDeleteLock=FailedToDeleteLock=Error en l'eliminació del fitxer %1/www/dolibarr/install.lock. Pot ignorar l'avís però és possible que hagi de eliminar-lo manualment més tard. En aquest cas, serà informat. Feu clic a OK per continuar... FailedToDeleteLock=FailedToDeleteLock=Error en l'eliminació del fitxer %1/www/dolibarr/install.lock. Pots ignorar l'avís però és possible que hagis d'eliminar-lo manualment més tard. En aquest cas, serà informat. Fes clic a OK per continuar...
PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Cancel·lar i escollir un altre valor? PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Vols cancel·lar i escollir un altre valor?
FirefoxDetected=S'ha detectat Firefox al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr? FirefoxDetected=S'ha detectat Firefox al teu ordinador. El vols utilitzar com a navegador per defecte per Dolibarr?
ChromeDetected=S'ha detectat Chrome al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr? ChromeDetected=S'ha detectat Chrome al teu ordinador. El vols utilitzar com a navegador per defecte per Dolibarr?
ChooseDefaultBrowser=Esculli el seu navegador per defecte. Si no està segur, simplement feu clic a Obrir: ChooseDefaultBrowser=Escull el teu navegador per defecte (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...).. Si no estàs segur, simplement fes clic a Obre:
LaunchNow=Llançar ara Dolibarr LaunchNow=Obre ara el Dolibarr
ProgramHasBeenRemoved=Els arxius del programa Dolibarr han estat eliminats. No obstant això tots els seus arxius de dades es troben encara al directori %1. Haurà eliminar aquest directori manualment per a una desinstal completa. ProgramHasBeenRemoved=Els arxius del programa Dolibarr han estat eliminats. No obstant això tots els seus arxius de dades es troben encara al directori %1. Hauràs d'eliminar aquest directori manualment per a una desinstal·lació completa.
DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reiniciar Apache i MySQL, això pot durar des de diversos segons a un minut després de la confirmació. Iniciar la instal·lació o actualització dels servidors web i bases de dades requerides per Dolibarr? DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reiniciar Apache i MySQL, això pot durar des de diversos segons a un minut després de la confirmació. Vols iniciar la instal·lació o actualització dels servidors web i de base de dades requerides per Dolibarr?
OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr
OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr
DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp.
ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit)

View File

@ -2,7 +2,7 @@
[CustomMessages] [CustomMessages]
NameAndVersion=%1 Version %2 NameAndVersion=%1 Version %2
AdditionalIcons=Zusätzliche Symbole: AdditionalIcons=Zusätzliche Symbole:
CreateDesktopIcon=&Desktop-Symbol erstellen CreateDesktopIcon=&Desktop-Symbol erstellen
CreateQuickLaunchIcon=Symbol in der Schnellstartleiste erstellen CreateQuickLaunchIcon=Symbol in der Schnellstartleiste erstellen
ProgramOnTheWeb=%1 im Internet ProgramOnTheWeb=%1 im Internet
@ -10,3 +10,38 @@ UninstallProgram=%1 entfernen
LaunchProgram=%1 starten LaunchProgram=%1 starten
AssocFileExtension=&Registriere %1 mit der %2-Dateierweiterung AssocFileExtension=&Registriere %1 mit der %2-Dateierweiterung
AssocingFileExtension=%1 wird mit der %2-Dateierweiterung registriert... AssocingFileExtension=%1 wird mit der %2-Dateierweiterung registriert...
YouWillInstallDoliWamp=Sie installieren DoliWamp (also Dolibarr + alle erforderliche Software von Drittanbietern wie Apache, MySQL und PHP) auf Ihrem Computer.
ThisAssistantInstallOrUpgrade=WARNUNG: Die Verwendung eines auf einem lokalen Computer installierten ERP-CRM kann gefährlich sein: Wenn Ihr Computer ausfällt, können Sie alle Ihre Daten verlieren. Tun Sie dies, wenn Sie bereit sind, das Backup selbst ernsthaft zu verwalten. Wenn nicht, verwenden Sie stattdessen eine Installation in Saas (siehe https://saas.dolibarr.org).
IfYouHaveTechnicalKnowledge=Wenn Sie über technische Kenntnisse verfügen und Apache, MySQL und PHP selbst verwalten möchten, sollten Sie diesen Assistenten nicht verwenden und eine manuelle Installation von Dolibarr auf Ihrem vorhandenen Server mit Apache, MySQL und PHP durchführen.
ButIfYouLook=Aber wenn Sie auf Ihrem lokalen Computer nach einer automatischen Einrichtung suchen, sind Sie auf dem besten Weg ...
DoYouWantToStart=Möchten Sie den Installationsprozess starten?
TechnicalParameters=technische Parameter
IfFirstInstall=Geben Sie bei der Erstinstallation einige technische Parameter an. Wenn Sie nicht verstehen, sich nicht sicher sind oder ein Upgrade durchführen, belassen Sie einfach die Standardwerte.
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS
SMTPServer=SMTP Server (your own or ISP SMTP server, first install only) :
ApachePort=Apache Port (first install only, Standard ist 80) :
MySqlPort=MySQL Port (first install only, Standard ist 3306) :
MySqlPassword=MySQL Server und Datenbank Passwort für root (first install only):
FailedToDeleteLock=Fehler beim Löschen der Datei %1/www/dolibarr/install.lock. Sie können die Warnung ignorieren, müssen sie jedoch möglicherweise später manuell entfernen, wenn Sie dazu aufgefordert werden. Klicken Sie auf OK, um fortzufahren ...
PortAlreadyInUse=Port %1 scheint bereits verwendet zu werden. Sie sollten zurückgehen und einen anderen Wert für %2 Port wählen. Auswahl abbrechen und einen anderen Wert wählen ?
FirefoxDetected=Firefox wurde auf Ihrem Computer erkannt. Möchten Sie ihn als Standardbrowser für Dolibarr verwenden?
ChromeDetected=Chrome wurde auf Ihrem Computer erkannt. Möchten Sie ihn als Standardbrowser für Dolibarr verwenden?
ChooseDefaultBrowser=Bitte wählen Sie Ihren Standardbrowser (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Wenn Sie sich nicht sicher sind, klicken Sie einfach auf Öffnen:
LaunchNow=Starten Sie jetzt Dolibarr
ProgramHasBeenRemoved=Die Dolibarr-Programmdateien wurden entfernt. Alle Ihre Daten befinden sich jedoch noch im Verzeichnis %1. Für eine vollständige Deinstallation, müssen Sie dieses Verzeichnis manuell entfernen.
DoliWampWillStartApacheMysql=Die DoliWamp-Installation wird nun starten oder Apache und MySQL neu starten. Dies kann nach dieser Bestätigung einige Sekunden bis eine Minute dauern. Wollen Sie mit der Installation oder Aktualisierung des von Dolibarr benötigten Web- und Datenbankservers starten ?
OldVersionFoundAndMoveInNew=Eine alte Datenbankversion wurde gefunden und verschoben, um von der neuen Dolibarr-Version verwendet zu werden.
OldVersionFoundButFailedToMoveInNew=Eine alte Datenbankversion wurde gefunden, konnte jedoch nicht verschoben werden, um mit der neuen Dolibarr-Version verwendet zu werden.
DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
ContinueAnyway=Fahren Sie trotzdem fort (der Installationsvorgang kann ohne diese Voraussetzung fehlschlagen).

View File

@ -1,45 +1,47 @@
[CustomMessages] [CustomMessages]
NameAndVersion=%1 versión %2 NameAndVersion=%1 versión %2
AdditionalIcons=Iconos adicionales: AdditionalIcons=Iconos adicionales:
CreateDesktopIcon=Crear un icono en el &escritorio CreateDesktopIcon=Crear un icono en el &escritorio
CreateQuickLaunchIcon=Crear un icono de Inicio Rápido CreateQuickLaunchIcon=Crear un icono de Inicio Rápido
ProgramOnTheWeb=%1 en la Web ProgramOnTheWeb=%1 en la Web
UninstallProgram=Desinstalar %1 UninstallProgram=Desinstalar %1
LaunchProgram=Ejecutar %1 LaunchProgram=Ejecutar %1
AssocFileExtension=&Asociar %1 con la extensión de archivo %2 AssocFileExtension=&Asociar %1 con la extensión de archivo %2
AssocingFileExtension=Asociando %1 con la extensión de archivo %2... AssocingFileExtension=Asociando %1 con la extensión de archivo %2...
YouWillInstallDoliWamp=Va a instalar o actualizar (Apache+Mysql+PHP+Dolibarr) en su ordenador. YouWillInstallDoliWamp=Va a instalar DoliWamp (Dolibarr y otro software como Apache, Mysql y PHP) en su ordenador.
ThisAssistantInstallOrUpgrade=Este asistente instala o actualiza Dolibarr ERP-CRM y todos sus requisitos (Apache, Mysql y PHP) optimizados para el uso de Dolibarr. ThisAssistantInstallOrUpgrade=ALERTA: Utilizar un ERP CRM instalado en un ordenador en local puede ser peligroso: si el ordenador se estropea, puede perder todos sus datos. Hágalo si está preparado para autogestionar sus copias de seguridad. Si no, puede utilizar una instalacion Saas (puede ver https://saas.dolibarr.org).
IfYouHaveTechnicalKnowledge=Si tiene conocimientos técnicos y necesita usar su Apache, Mysql y PHP con otras aplicaciones aparte de Dolibarr, no debería usar este asistente, debería realizar una instalación manual de Dolibarr sobre un Apache, Mysql y PHP existente. IfYouHaveTechnicalKnowledge=Si tiene conocimientos técnicos y necesita usar su Apache, Mysql y PHP con otras aplicaciones aparte de Dolibarr, no debería usar este asistente, debería realizar una instalación manual de Dolibarr sobre un Apache, Mysql y PHP existente.
ButIfYouLook=Pero si busca una instalación automática, se encuentra en el buen camino... ButIfYouLook=Pero si busca una instalación automática en tu propio ordenador, se encuentra en el buen camino...
DoYouWantToStart=¿Quiere iniciar el proceso de instalación/actualización? DoYouWantToStart=¿Quiere iniciar el proceso de instalación?
TechnicalParameters=Parámetros técnicos TechnicalParameters=Parámetros técnicos
IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto. IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto.
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS ; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS
SMTPServer=Servidor SMTP (El suyo o el de su ISP, únicamente primera instalación) : SMTPServer=Servidor SMTP (propio o su ISP, sólo primera instalación) :
ApachePort=Puerto Apache (únicamente primera instalación, normalmente es el 80) : ApachePort=Puerto Apache (sólo primera instalación, normalmente el 80) :
MySqlPort=Puerto Mysql (únicamente primera instalación, normalmente es el 3306) : MySqlPort=Puerto Mysql (sólo primera instalación, normalmente el 3306) :
MySqlPassword=Contraseña del servidor y la base de datos MySQL de root (únicamente primera instalación): MySqlPassword=Contraseña del servidor y la base de datos MySQL de root (sólo primera instalación):
FailedToDeleteLock=Error en la eliminación del archivo %1/www/dolibarr/install.lock. Puede ignorar el aviso pero es posible que deba eliminarlo manualmente más tarde. En este caso, será informado. Haga clic en OK para continuar... FailedToDeleteLock=Error en la eliminación del archivo %1/www/dolibarr/install.lock. Puede ignorar el aviso pero es posible que deba eliminarlo manualmente más tarde. En este caso, será informado. Haga clic en OK para continuar...
PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor? PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor?
FirefoxDetected=Se ha detectado Firefox en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ? FirefoxDetected=Se ha detectado Firefox en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ?
ChromeDetected=Se ha detectado Chrome en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ? ChromeDetected=Se ha detectado Chrome en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ?
ChooseDefaultBrowser=Escoja su navegador por defecto. Si no está seguro, simplementa haga clic en Abrir : ChooseDefaultBrowser=Escoja su navegador por defecto (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si no está seguro, simplementa haga clic en Abrir :
LaunchNow=Lanzar ahora Dolibarr LaunchNow=Lanzar ahora Dolibarr
ProgramHasBeenRemoved=Los archivos del programa Dolibarr han sido eliminados. Sin embargo todos sus archivos de datos se encuentran todavía en el directorio %1. Deberá eliminar este directorio manualmente para una desinstalación completa. ProgramHasBeenRemoved=Los archivos del programa Dolibarr han sido eliminados. Sin embargo todos sus archivos de datos se encuentran todavía en el directorio %1. Deberá eliminar este directorio manualmente para una desinstalación completa.
DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reiniciar Apache y MySQL, esto puede durar desde varios segundos a un minuto después de la confirmación. ¿Iniciar la instalación o actualización de los servidores Web y bases de datos requeridas por Dolibarr? DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reiniciar Apache y MySQL, esto puede durar desde varios segundos a un minuto después de la confirmación. ¿Iniciar la instalación o actualización de los servidores Web y bases de datos requeridas por Dolibarr?
OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr
OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr
DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp.
ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito)

View File

@ -104,6 +104,27 @@ with
//return false; //return false;
} }
* Replace in tcpdf.php
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
with
// @CHANGE LDR Add support for src="file://..." links
if (strpos($imgsrc, 'file://') === 0) {
$imgsrc = str_replace('file://', '/', $imgsrc);
$imgsrc = urldecode($imgsrc);
$testscrtype = @parse_url($imgsrc);
if (empty($testscrtype['query'])) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
} elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
}
}
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace * In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
@ -277,3 +298,15 @@ JEDITABLE.JS
* <button type="submit" /> => <button class="button" type="submit" /> * <button type="submit" /> => <button class="button" type="submit" />
* <button type="cancel" /> => <button class="button" type="cancel" /> * <button type="cancel" /> => <button class="button" type="cancel" />
SELECT2
-------
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
.select2-hidden-accessible {
margin: -1px !important; /* line to restore */
}

File diff suppressed because one or more lines are too long

View File

@ -222,6 +222,9 @@
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" /> <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties> <properties>
<property name="equalsSpacing" value="1"/> <property name="equalsSpacing" value="1"/>

View File

@ -488,11 +488,11 @@ if ($resql)
// Action // Action
print '<td class="center">'; print '<td class="center">';
if ($user->rights->accounting->chartofaccount) { if ($user->rights->accounting->chartofaccount) {
print '<a href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">'; print '<a class="editfielda" href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
print '&nbsp;'; print '&nbsp;';
print '<a href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">'; print '<a class="marginleftonly" href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }

View File

@ -696,7 +696,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>'; if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -408,7 +408,7 @@ llxHeader('', $langs->trans('DictionaryAccountancyCategory'));
$titre = $langs->trans($tablib[$id]); $titre = $langs->trans($tablib[$id]);
$linkback = ''; $linkback = '';
$titlepicto = 'title_setup'; $titlepicto = 'title_accountancy';
print load_fiche_titre($titre, $linkback, $titlepicto); print load_fiche_titre($titre, $linkback, $titlepicto);
@ -806,7 +806,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>'; if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -274,23 +274,23 @@ if ($action == 'create')
// Label // Label
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32');
print '</td><td colspan="2">'; print '</td><td colspan="2">';
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32');
print "</td></tr>"; print "</td></tr>";
// Date start // Date start
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
print '</td><td colspan="2">'; print '</td><td colspan="2">';
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
print '</td></tr>'; print '</td></tr>';
// Date end // Date end
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
print '</td><td colspan="2">'; print '</td><td colspan="2">';
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
print '</td></tr>'; print '</td></tr>';
// Statut // Statut

View File

@ -236,6 +236,7 @@ if (!empty($user->admin))
} }
print '</tr>'; print '</tr>';
/* Set this option as a hidden option but keep it for some needs.
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>'; print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
@ -248,6 +249,7 @@ if (!empty($user->admin))
print '</a></td>'; print '</a></td>';
} }
print '</tr>'; print '</tr>';
*/
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>'; print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';

View File

@ -657,7 +657,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>'; if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -362,7 +362,6 @@ if ($result)
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy'); print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
print '<br>'; print '<br>';
@ -412,7 +411,7 @@ if ($result)
//print '<br><div class="center">'.$buttonsave.'</div>'; //print '<br><div class="center">'.$buttonsave.'</div>';
$texte = $langs->trans("ListOfProductsServices"); $texte = $langs->trans("ListOfProductsServices");
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit); print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">'; print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';

View File

@ -1006,7 +1006,7 @@ while ($i < min($num, $limit))
// Amount debit // Amount debit
if (!empty($arrayfields['t.debit']['checked'])) if (!empty($arrayfields['t.debit']['checked']))
{ {
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>'; print '<td class="nowrap right">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
$totalarray['val']['totaldebit'] += $line->debit; $totalarray['val']['totaldebit'] += $line->debit;
@ -1015,7 +1015,7 @@ while ($i < min($num, $limit))
// Amount credit // Amount credit
if (!empty($arrayfields['t.credit']['checked'])) if (!empty($arrayfields['t.credit']['checked']))
{ {
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>'; print '<td class="nowrap right">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
$totalarray['val']['totalcredit'] += $line->credit; $totalarray['val']['totalcredit'] += $line->credit;

View File

@ -217,7 +217,7 @@ class Lettering extends BookKeeping
} }
if ($error) { if ($error) {
foreach ($this->errors as $errmsg) { foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this) . "::" . __METHOD__ . $errmsg, LOG_ERR); dol_syslog(__METHOD__.' '.$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg); $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
} }
return -1 * $error; return -1 * $error;
@ -237,8 +237,6 @@ class Lettering extends BookKeeping
$error = 0; $error = 0;
$lettre = 'AAA'; $lettre = 'AAA';
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
$sql = "SELECT DISTINCT lettering_code FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE "; $sql = "SELECT DISTINCT lettering_code FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE ";
$sql .= " lettering_code != '' ORDER BY lettering_code DESC limit 1; "; $sql .= " lettering_code != '' ORDER BY lettering_code DESC limit 1; ";

View File

@ -567,12 +567,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>'; print '<td>'.$objp->tva_intra.'</td>';
// Found accounts // Found accounts
print '<td style="'.$code_sell_p_notset.'">'; print '<td>';
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>'; $s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC"); if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport"); elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("NotDefined")); $s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0) if ($objp->product_id > 0)
{ {
@ -583,7 +583,7 @@ if ($result) {
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT"); elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber"); elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport"); elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s .= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p)); $s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
} }
print '</td>'; print '</td>';

View File

@ -88,7 +88,7 @@ if ($conf->accounting->enabled)
} }
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'title_accountancy', 0, '', '', $showtutorial);
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
print "<br>\n"; print "<br>\n";

View File

@ -994,7 +994,7 @@ if (empty($action) || $action == 'view') {
print '<div class="tabsAction tabsActionNoBottom">'; print '<div class="tabsAction tabsActionNoBottom">';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {

View File

@ -508,7 +508,7 @@ if (empty($action) || $action == 'view') {
} }
print '<div class="tabsAction tabsActionNoBottom">'; print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />'; print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
} }

View File

@ -740,7 +740,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>'); print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
} }
print '<div class="tabsAction tabsActionNoBottom">'; print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />'; print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
} }

View File

@ -677,7 +677,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>'); print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
} }
print '<div class="tabsAction tabsActionNoBottom">'; print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />'; print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
} }

View File

@ -373,7 +373,7 @@ if ($result) {
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>'; print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
// Ref product // Ref product
print '<td>'; print '<td class="tdoverflowmax100">';
if ($product_static->id > 0) print $product_static->getNomUrl(1); if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>'; if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print $objp->product_label; if ($objp->product_label) print $objp->product_label;

View File

@ -462,7 +462,7 @@ if ($result) {
} }
} elseif ($objp->type_l == 0) { } elseif ($objp->type_l == 0) {
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = ''; $suggestedaccountingaccountbydefaultfor = '';
} else { } else {
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
@ -553,12 +553,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>'; print '<td>'.$objp->tva_intra.'</td>';
// Found accounts // Found accounts
print '<td style="'.$code_buy_p_notset.'">'; print '<td>';
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>'; $s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC"); if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport"); elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
$s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("NotDefined")); $s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0) if ($objp->product_id > 0)
{ {
@ -567,7 +567,7 @@ if ($result) {
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC"); if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport"); elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s .= (empty($objp->code_buy_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_buy_p)); $s .= (empty($objp->code_buy_p) ? '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_buy_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
} }
print '</td>'; print '</td>';

View File

@ -1773,9 +1773,11 @@ else
if ($action != 'editlogin' && $action != 'editthirdparty') if ($action != 'editlogin' && $action != 'editthirdparty')
{ {
// Send // Send
if (empty($user->socid)) {
if ($object->statut == 1) { if ($object->statut == 1) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>';
} }
}
// Send card by email // Send card by email
// TODO Remove this to replace with a template // TODO Remove this to replace with a template

View File

@ -60,6 +60,9 @@ class Adherent extends CommonObject
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
public $picto = 'member';
public $mesgs; public $mesgs;
/** /**
@ -273,7 +276,7 @@ class Adherent extends CommonObject
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85), 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90), 'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90),
'country' => array('type' => 'integer', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95), 'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95),
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 100), 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 100),
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 105), 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 105),
'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115), 'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115),
@ -657,7 +660,7 @@ class Adherent extends CommonObject
$action = 'update'; $action = 'update';
// Actions on extra fields // Actions on extra fields
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) { if ($result < 0) {
@ -927,8 +930,6 @@ class Adherent extends CommonObject
// Removed extrafields // Removed extrafields
if (!$error) { if (!$error) {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
if ($result < 0) { if ($result < 0) {
$error++; $error++;
@ -936,7 +937,6 @@ class Adherent extends CommonObject
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
} }
} }
}
// Remove adherent // Remove adherent
if (!$error) { if (!$error) {

View File

@ -409,7 +409,7 @@ class AdherentType extends CommonObject
$action = 'update'; $action = 'update';
// Actions on extra fields // Actions on extra fields
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)

View File

@ -86,13 +86,14 @@ class Members extends DolibarrApi
* @param int $limit Limit for list * @param int $limit Limit for list
* @param int $page Page number * @param int $page Page number
* @param string $typeid ID of the type of member * @param string $typeid ID of the type of member
* @param int $category Use this param to filter list by category
* @param string $sqlfilters Other criteria to filter answers separated by a comma. * @param string $sqlfilters Other criteria to filter answers separated by a comma.
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))" * Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
* @return array Array of member objects * @return array Array of member objects
* *
* @throws RestException * @throws RestException
*/ */
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@ -104,11 +105,19 @@ class Members extends DolibarrApi
$sql = "SELECT t.rowid"; $sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as t"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as t";
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_member as c";
}
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')'; $sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
if (!empty($typeid)) if (!empty($typeid))
{ {
$sql .= ' AND t.fk_adherent_type='.$typeid; $sql .= ' AND t.fk_adherent_type='.$typeid;
} }
// Select members of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$db->escape($category);
$sql .= " AND c.fk_member = t.rowid ";
}
// Add sql filters // Add sql filters
if ($sqlfilters) if ($sqlfilters)
{ {

View File

@ -45,11 +45,12 @@ $confirm=GETPOST('confirm', 'alpha');
$result = restrictedArea($user, 'adherent', $id); $result = restrictedArea($user, 'adherent', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page ; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -191,10 +191,10 @@ if ($conf->use_javascript_ajax)
} }
$total = $SommeA + $SommeB + $SommeC + $SommeD; $total = $SommeA + $SommeB + $SommeC + $SommeD;
$dataseries = array(); $dataseries = array();
$dataseries[] = array($langs->trans("MenuMembersNotUpToDate"), round($SommeB)); $dataseries[] = array($langs->transnoentitiesnoconv("MenuMembersNotUpToDate"), round($SommeB));
$dataseries[] = array($langs->trans("MenuMembersUpToDate"), round($SommeC)); $dataseries[] = array($langs->transnoentitiesnoconv("MenuMembersUpToDate"), round($SommeC));
$dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SommeD));
$dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SommeA));
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';

View File

@ -106,6 +106,9 @@ $fieldstosearchall = array(
'd.address'=>'Address', 'd.address'=>'Address',
'd.zip'=>'Zip', 'd.zip'=>'Zip',
'd.town'=>'Town', 'd.town'=>'Town',
'd.phone'=>"Phone",
'd.phone_perso'=>"PhonePerso",
'd.phone_mobile'=>"PhoneMobile",
'd.note_public'=>'NotePublic', 'd.note_public'=>'NotePublic',
'd.note_private'=>'NotePrivate', 'd.note_private'=>'NotePrivate',
); );
@ -422,10 +425,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information"; $topicmail = "Information";
$modelmail = "member"; $modelmail = "member";
@ -947,8 +949,6 @@ print "</table>\n";
print "</div>"; print "</div>";
print '</form>'; print '</form>';
if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 1);
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -58,7 +58,7 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra
$title = $langs->trans("MembersStatisticsByProperties"); $title = $langs->trans("MembersStatisticsByProperties");
print load_fiche_titre($title, ''); print load_fiche_titre($title, '', 'object_group');
dol_mkdir($dir); dol_mkdir($dir);
@ -113,7 +113,8 @@ if (! count($data))
} }
else else
{ {
print load_fiche_titre($langs->trans("MembersByNature"), '', ''); print $langs->trans("MembersByNature").'<br>';
print '<br>';
} }
// Print array // Print array

View File

@ -64,7 +64,7 @@ if ($mode == 'memberbyregion') $title=$langs->trans("MembersStatisticsByRegion")
llxHeader('', $title, '', '', 0, 0, $arrayjs); llxHeader('', $title, '', '', 0, 0, $arrayjs);
print load_fiche_titre($title, $mesg); print load_fiche_titre($title, '', 'object_group');
dol_mkdir($dir); dol_mkdir($dir);

View File

@ -259,10 +259,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information"; $topicmail = "Information";
$modelmail = "subscription"; $modelmail = "subscription";

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.net> * Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.net>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -239,6 +240,8 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$i = 0; $i = 0;
$param = ''; $param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->adherent->configurer) if ($user->rights->adherent->configurer)
@ -252,10 +255,9 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = ''; $moreforfilter = '';
@ -375,13 +377,8 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Other attributes // Other attributes
$parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit', $parameters);
}
print '<tbody>'; print '<tbody>';
print "</table>\n"; print "</table>\n";
@ -822,15 +819,6 @@ if ($rowid > 0)
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit', $parameters);
}
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();

View File

@ -109,7 +109,7 @@ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">'
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n"; print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
// Name // Name
@ -128,7 +128,7 @@ print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global
// Country // Country
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">'; print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -192,7 +192,8 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{ {
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} elseif ($action == "setshippableiconinlist") { }
elseif ($action == "setshippableiconinlist") {
// Activate Set Shippable Icon In List // Activate Set Shippable Icon In List
$setshippableiconinlist = GETPOST('value', 'int'); $setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
@ -203,6 +204,25 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'setribchq')
{
$rib = GETPOST('rib', 'alpha');
$chq = GETPOST('chq', 'alpha');
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Activate ask for payment bank // Activate ask for payment bank
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
@ -517,7 +537,122 @@ foreach ($dirmodels as $reldir)
} }
print '</table>'; print '</table>';
print "<br>";
/*
* Payment mode
*/
print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>';
print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>';
print '<td align="right">';
if (empty($conf->facture->enabled)) {
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
}
print '</td>';
print "</tr>\n";
print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>";
if (empty($conf->facture->enabled))
{
if (!empty($conf->banque->enabled))
{
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";
$sql .= " AND courant = 1";
$sql .= " AND entity IN (".getEntity('bank_account').")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0)
{
print '<select name="rib" class="flat" id="rib">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_RIB_NUMBER == $row[0] ? ' selected' : '';
print '>'.$row[1].'</option>';
$i++;
}
print "</select>";
}
else
{
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
}
}
}
else
{
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
}
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>";
print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
print "<td>";
if (empty($conf->facture->enabled))
{
print '<select class="flat" name="chq" id="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";
$sql .= " AND courant = 1";
$sql .= " AND entity IN (".getEntity('bank_account').")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_CHQ_NUMBER == $row[0] ? ' selected' : '';
print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).'</option>';
$i++;
}
}
print "</select>";
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>";
print "</table>";
print "</form>";
print '<br>';
/* /*
* Other options * Other options

View File

@ -410,7 +410,7 @@ print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n"; print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
// Name // Name
@ -429,7 +429,7 @@ print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SO
// Country // Country
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">'; print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print $form->select_country($mysoc->country_id, 'country_id'); print $form->select_country($mysoc->country_id, 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
@ -493,7 +493,7 @@ if (!empty($mysoc->logo_mini)) {
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
print '</div>'; print '</div>';
} }
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a></div>'; print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} else { } else {
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">'; print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
} }
@ -511,7 +511,7 @@ if (!empty($mysoc->logo_squarred_mini)) {
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
print '</div>'; print '</div>';
} }
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a></div>'; print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} else { } else {
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">'; print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
} }
@ -527,7 +527,7 @@ print '</table>';
// Social networks // Social networks
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>'; print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -547,7 +547,7 @@ print "</table>";
print '<br>'; print '<br>';
// IDs of the company (country-specific) // IDs of the company (country-specific)
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
$langs->load("companies"); $langs->load("companies");
@ -680,7 +680,7 @@ print '</table>';
// Fiscal year start // Fiscal year start
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>'; print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -695,7 +695,7 @@ print '<br>';
// Sales taxes (VAT, IRPF, ...) // Sales taxes (VAT, IRPF, ...)
print load_fiche_titre($langs->trans("TypeOfSaleTaxes")); print load_fiche_titre($langs->trans("TypeOfSaleTaxes"));
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>'; print '<td width="25%">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
@ -721,7 +721,7 @@ print "</table>";
// Second tax // Second tax
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>'; print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
@ -758,9 +758,9 @@ if ($mysoc->useLocalTax(1))
} else { } else {
if (empty($mysoc->country_code)) if (empty($mysoc->country_code))
{ {
print '<tr class="oddeven"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
} else { } else {
print '<tr class="oddeven"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</td></tr>';
} }
} }
@ -768,7 +768,7 @@ print "</table>";
// Third tax system // Third tax system
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>'; print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
@ -804,18 +804,18 @@ if ($mysoc->useLocalTax(2))
} else { } else {
if (empty($mysoc->country_code)) if (empty($mysoc->country_code))
{ {
print '<tr class="oddeven"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
} else { } else {
print '<tr class="oddeven"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</td></tr>';
} }
} }
print "</table>"; print "</table>";
// Third tax system // Tax stamp
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>'; print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
@ -823,7 +823,7 @@ print "</tr>\n";
if ($mysoc->useRevenueStamp()) if ($mysoc->useRevenueStamp())
{ {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option // Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr class=\"oddeven\"><td>"; print '<tr class="oddeven"><td>';
print $langs->trans("UseRevenueStamp"); print $langs->trans("UseRevenueStamp");
print "</td>"; print "</td>";
print '<td colspan="2">'; print '<td colspan="2">';
@ -832,9 +832,9 @@ if ($mysoc->useRevenueStamp())
} else { } else {
if (empty($mysoc->country_code)) if (empty($mysoc->country_code))
{ {
print '<tr class="oddeven"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
} else { } else {
print '<tr class="oddeven"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</td></tr>'; print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</td></tr>';
} }
} }

View File

@ -208,18 +208,18 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
{ {
print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
} }
print getTitleFieldOfList("Action", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print "</tr>\n"; print "</tr>\n";
// Line to add new record // Line to add new record
print "\n"; print "\n";
print '<tr class="oddeven"><td><input type="text" class="flat" size="24" name="constname" value="'.$constname.'"></td>'."\n"; print '<tr class="oddeven nohover"><td><input type="text" class="flat minwidth100" name="constname" value="'.$constname.'"></td>'."\n";
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="30" name="constvalue" value="'.$constvalue.'">'; print '<input type="text" class="flat minwidth100" name="constvalue" value="'.$constvalue.'">';
print '</td><td>'; print '</td><td>';
print '<input type="text" class="flat" size="40" name="constnote" value="'.$constnote.'">'; print '<input type="text" class="flat minwidth100" name="constnote" value="'.$constnote.'">';
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print '</td>'; print '</td>';

View File

@ -1718,7 +1718,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // Modify link
if ($canbemodified) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>'; if ($canbemodified) print '<td align="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -28,14 +28,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
if (!$user->admin) if (!$user->admin) {
accessforbidden(); accessforbidden();
}
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("users", "admin", "other")); $langs->loadLangs(array("users", "admin", "other"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$securityevent = new Events($db); $securityevent = new Events($db);
$eventstolog = $securityevent->eventstolog; $eventstolog = $securityevent->eventstolog;
@ -44,6 +56,7 @@ $eventstolog = $securityevent->eventstolog;
/* /*
* Actions * Actions
*/ */
if ($action == "save") if ($action == "save")
{ {
$i = 0; $i = 0;
@ -67,6 +80,12 @@ if ($action == "save")
* View * View
*/ */
$form = new Form($db);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = '';
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('', $langs->trans("Audit"), $wikihelp); llxHeader('', $langs->trans("Audit"), $wikihelp);
@ -85,9 +104,10 @@ $head = security_prepare_head();
dol_fiche_head($head, 'audit', $langs->trans("Security"), -1); dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
print "<table class=\"noborder\" width=\"100%\">"; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print "<td colspan=\"2\">".$langs->trans("LogEvents")."</td>"; print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print "</tr>\n"; print "</tr>\n";
// Loop on each event type // Loop on each event type
foreach ($eventstolog as $key => $arr) foreach ($eventstolog as $key => $arr)
@ -96,10 +116,10 @@ foreach ($eventstolog as $key => $arr)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$arr['id'].'</td>'; print '<td>'.$arr['id'].'</td>';
print '<td>'; print '<td class="center">';
$key = 'MAIN_LOGEVENTS_'.$arr['id']; $key = 'MAIN_LOGEVENTS_'.$arr['id'];
$value = $conf->global->$key; $value = $conf->global->$key;
print '<input class="oddeven" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>'; print '<input class="oddeven checkforselect" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
} }
@ -109,7 +129,7 @@ dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
print "</div>"; print '</div>';
print "</form>\n"; print "</form>\n";

View File

@ -6,6 +6,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -30,6 +31,7 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/rssparser.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/rssparser.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->load("admin"); $langs->load("admin");
@ -222,10 +224,13 @@ print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">'; print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">';
print '</div><br><br>'; print '</div>';
print '</form>'; print '</form>';
print '<br><br>';
print '<span class="opacitymedium">'.$langs->trans('RssNote').'</span> - <a href="'.DOL_MAIN_URL_ROOT.'/admin/boxes.php">'.$langs->trans('JumpToBoxes').'</a>';
print '<br><br>';
$sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def"; $sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def";
$sql .= " WHERE file = 'box_external_rss.php'"; $sql .= " WHERE file = 'box_external_rss.php'";
@ -235,6 +240,7 @@ dol_syslog("select rss boxes", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
@ -252,32 +258,32 @@ if ($resql)
$result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp); $result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp);
print "<br>"; print "<br>";
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">"; print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
print "<tr class=\"liste_titre\">"; print '<tr class="liste_titre">';
print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>"; print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>";
print '<td class="right">'; print '<td class="right">';
print "<input type=\"submit\" class=\"button\" name=\"modify\" value=\"".$langs->trans("Modify")."\">"; print '<input type="submit" class="button buttongen" name="modify" value="'.$langs->trans("Modify").'">';
print " &nbsp; "; print " &nbsp; ";
print "<input type=\"submit\" class=\"button\" name=\"delete\" value=\"".$langs->trans("Delete")."\">"; print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
print "<input type=\"hidden\" name=\"norss\" value=\"".$idrss."\">"; print '<input type="hidden" name="norss" value="'.$idrss.'">';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>"."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td width=\"100px\">".$langs->trans("Title")."</td>"; print "<td width=\"100px\">".$langs->trans("Title")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrsstitle)."\"></td>"; print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrsstitle)."\"></td>";
print "</tr>"; print "</tr>"."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("URL")."</td>"; print "<td>".$langs->trans("URL")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrssurl)."\"></td>"; print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrssurl)."\"></td>";
print "</tr>"; print "</tr>"."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -295,7 +301,7 @@ if ($resql)
print '</div>'; print '</div>';
} }
print "</td>"; print "</td>";
print "</tr>"; print "</tr>"."\n";
// Logo // Logo
if ($result > 0 && empty($rss->error)) if ($result > 0 && empty($rss->error))
@ -309,12 +315,19 @@ if ($resql)
if ($imageurl) print '<img height="32" src="'.$imageurl.'">'; if ($imageurl) print '<img height="32" src="'.$imageurl.'">';
else print $langs->trans("None"); else print $langs->trans("None");
print '</td>'; print '</td>';
print "</tr>"; print "</tr>"."\n";
} }
print '</table>'; // Active
$active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('WidgetEnabled').'</td>';
print '<td>'.yn($active).'</td>';
print "</tr>"."\n";
print "</form>"; print '</table>'."\n";
print "</form>"."\n";
$i++; $i++;
} }
@ -327,3 +340,23 @@ else
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();
/**
* Check if the given RSS feed if inside the list of boxes/widgets
*
* @param int $idrss The id of the RSS feed
* @param array $boxlist A list with boxes/widgets
* @return bool true if the rss feed is inside the box/widget list, otherwise false
*/
function _isInBoxList($idrss, array $boxlist)
{
foreach($boxlist as $box)
{
if($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
{
return true;
}
}
return false;
}

View File

@ -643,7 +643,7 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
} }
/* /*
* Modes de reglement * Payment modes
*/ */
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', ''); print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', '');

View File

@ -96,7 +96,26 @@ print "</tr>\n";
_printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); _printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices'));
_printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote')); _printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote'));
_printOnOff('INVOICE_USE_SITUATION_RETAINED_WARRANTY', $langs->trans('Retainedwarranty')); //_printOnOff('INVOICE_USE_RETAINED_WARRANTY', $langs->trans('Retainedwarranty'));
$confkey = 'INVOICE_USE_RETAINED_WARRANTY';
$arrayAvailableType = array(
Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation"),
Facture::TYPE_STANDARD.'+'.Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation").' + '.$langs->trans("InvoiceStandard"),
);
$selected = array();
$implodeglue = '+';
if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) {
$selected = explode('+', $conf->global->{$confkey});
}
$curentInput = (empty($inputCount) ? 1 : ($inputCount + 1));
$formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1);
_printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType);
//_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituation'));
_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituationFinal'));
$metas = array( $metas = array(
'type' => 'number', 'type' => 'number',
@ -227,8 +246,12 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra
print '<input type="hidden" name="action" value="setModuleOptions">'; print '<input type="hidden" name="action" value="setModuleOptions">';
if ($type == 'textarea') { if ($type == 'textarea') {
print '<textarea '.$metascompil.' >'.dol_htmlentities($conf->global->{$confkey}).'</textarea>'; print '<textarea '.$metascompil.' >'.dol_htmlentities($conf->global->{$confkey}).'</textarea>';
} else { }elseif ($type == 'input') {
print '<input '.$metascompil.' />'; print '<input '.$metascompil.' />';
}
else {
// custom
print $type;
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -154,8 +154,10 @@ if ($action == 'update')
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
@ -241,9 +243,9 @@ print '<input type="hidden" name="action" value="update">';
clearstatcache(); clearstatcache();
print '<br>'; print '<br>';
print '<table summary="edit" class="noborder centpercent">'; print '<table summary="edit" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td></td>'; print '<tr class="liste_titre"><th>'.$langs->trans("Language").'</th><th></th>';
print '<td width="20">&nbsp;</td>'; print '<th width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
// Default language // Default language
@ -268,9 +270,9 @@ showSkins(null, 1);
print '<br>'; print '<br>';
// Other // Other
print '<table summary="otherparameters" class="noborder centpercent">'; print '<table summary="otherparameters" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Miscellaneous").'</td><td></td>'; print '<tr class="liste_titre"><th>'.$langs->trans("Miscellaneous").'</th><th></th>';
print '<td width="20">&nbsp;</td>'; print '<th width="20">&nbsp;</tg>';
print '</tr>'; print '</tr>';
// Disable javascript and ajax // Disable javascript and ajax
@ -385,9 +387,9 @@ print '<br>';
// Other // Other
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent">'; print '<table summary="edit" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>'; print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage").'</th><th></th>';
print '<td width="20">&nbsp;</td>'; print '<th width="20">&nbsp;</th>';
print '</tr>'; print '</tr>';
// Message on login page // Message on login page

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -23,7 +23,7 @@
/** /**
* \file htdocs/admin/ldap.php * \file htdocs/admin/ldap.php
* \ingroup ldap * \ingroup ldap
* \brief Page d'administration/configuration du module Ldap * \brief Page to setup module LDAP
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -57,19 +57,20 @@ if (empty($reshook))
$error = 0; $error = 0;
$db->begin(); $db->begin();
if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port", 'int'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass", 'none'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!$error) if (!$error)
{ {

View File

@ -209,6 +209,8 @@ else
// Show examples // Show examples
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
print '<span class="opacitymedium">'.$langs->trans("Format").':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";
// Always show vat rates with vat 0 // Always show vat rates with vat 0
$s = 2 / 7; $qty = 1; $vat = 0; $s = 2 / 7; $qty = 1; $vat = 0;
$tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); $tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);

View File

@ -754,9 +754,9 @@ if ($resql)
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button buttongen" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>'; print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button buttongen" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
$fieldsforcontent = array('topic', 'joinfiles', 'content'); $fieldsforcontent = array('topic', 'joinfiles', 'content');
@ -902,10 +902,10 @@ if ($resql)
// Modify link / Delete link // Modify link / Delete link
print '<td class="center nowraponall" width="64">'; print '<td class="center nowraponall" width="64">';
if ($canbemodified) print '<a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a>'; if ($canbemodified) print '<a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a>';
if ($iserasable) if ($iserasable)
{ {
print ' &nbsp; <a href="'.$url.'action=delete">'.img_delete().'</a>'; print '<a class="marginleftonly" href="'.$url.'action=delete">'.img_delete().'</a>';
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin //else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
} }
print '</td>'; print '</td>';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('errors', 'admin')); $langs->loadLangs(array('errors', 'admin', 'modulebuilder'));
$mode = GETPOST('mode', 'alpha'); $mode = GETPOST('mode', 'alpha');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
@ -275,7 +275,7 @@ $picto = 'object_'.$objMod->picto;
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto); print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto);
print '<br>'; print '<br>';
dol_fiche_head($head, $mode, $title, -1); dol_fiche_head($head, $mode, '', -1);
if (!$modulename) if (!$modulename)
{ {
@ -318,10 +318,13 @@ if ($mode == 'desc')
$text .= '<span class="opacitymedium">'.$langs->trans("Version").':</span> '.$version; $text .= '<span class="opacitymedium">'.$langs->trans("Version").':</span> '.$version;
$moduledescriptorfile = get_class($objMod).'.class.php';
$text .= '<br><span class="opacitymedium">'.$langs->trans("DescriptorFile").':</span> '.$moduledescriptorfile;
$textexternal = ''; $textexternal = '';
if ($objMod->isCoreOrExternalModule() == 'external') if ($objMod->isCoreOrExternalModule() == 'external')
{ {
$textexternal.='<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule", $dirofmodule); $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $dirofmodule);
if ($objMod->editor_name != 'dolibarr') $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name); if ($objMod->editor_name != 'dolibarr') $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name);
$editor_url = $objMod->editor_url; $editor_url = $objMod->editor_url;
if (!preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url; if (!preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url;

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "modulebuilder")); $langs->loadLangs(array("errors", "admin", "modulebuilder"));
$mode = GETPOST('mode', 'alpha'); $mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : 'commonkanban';
if (empty($mode)) $mode = 'common'; if (empty($mode)) $mode = 'common';
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
//var_dump($_POST);exit; //var_dump($_POST);exit;
@ -311,7 +311,7 @@ $filename = array();
$modules = array(); $modules = array();
$orders = array(); $orders = array();
$categ = array(); $categ = array();
$dirmod = array();
$i = 0; // is a sequencer of modules found $i = 0; // is a sequencer of modules found
$j = 0; // j is module number. Automatically affected if module number not defined. $j = 0; // j is module number. Automatically affected if module number not defined.
$modNameLoaded = array(); $modNameLoaded = array();
@ -420,8 +420,7 @@ foreach ($modulesdir as $dir)
} }
$orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number $orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
$dirmod[$i] = $dir;
//print $i.'-'.$dirmod[$i].'<br>';
// Set categ[$i] // Set categ[$i]
$specialstring = 'unknown'; $specialstring = 'unknown';
if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring = 'expdev'; if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring = 'expdev';
@ -483,11 +482,11 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM
print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
// Start to show page // Start to show page
if ($mode == 'common') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc")."</span><br>\n"; if ($mode == 'common') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."<br></span>\n";
if ($mode == 'commonkanban') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc")."</span><br>\n"; if ($mode == 'commonkanban') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."<br></span>\n";
if ($mode == 'marketplace') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."</span><br>\n"; if ($mode == 'marketplace') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br></span>\n";
if ($mode == 'deploy') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."</span><br>\n"; if ($mode == 'deploy') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."<br></span>\n";
if ($mode == 'develop') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."</span><br>\n"; if ($mode == 'develop') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br></span>\n";
$head = modules_prepare_head(); $head = modules_prepare_head();
@ -508,7 +507,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">';
$newmode = $mode; $newmode = $mode;
if ($newmode == 'commonkanban') $newmode = 'common'; if ($newmode == 'common') $newmode = 'commonkanban';
dol_fiche_head($head, $newmode, '', -1); dol_fiche_head($head, $newmode, '', -1);
@ -518,7 +517,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
$moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">'; $moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1); $moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) if (!empty($conf->global->MAIN_FEATURES_LEVEL))
{ {
@ -527,11 +526,11 @@ if ($mode == 'common' || $mode == 'commonkanban')
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental'] = $langs->trans("Experimental"); if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental'] = $langs->trans("Experimental");
if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development'] = $langs->trans("Development"); if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development'] = $langs->trans("Development");
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1); $moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1); $moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= ' '; $moreforfilter .= ' ';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
@ -542,8 +541,8 @@ if ($mode == 'common' || $mode == 'commonkanban')
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right">'; $moreforfilter .= '<div class="floatright right">';
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition')); $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right margintoponly marginrightonly" style="padding-top: 3px">'.$moreinfo.'</div>'; $moreforfilter .= '<div class="floatright right margintoponly marginrightonly" style="padding-top: 3px">'.$moreinfo.'</div>';
@ -569,9 +568,11 @@ if ($mode == 'common' || $mode == 'commonkanban')
// Show list of modules // Show list of modules
$oldfamily = ''; $oldfamily = '';
$linenum = 0;
foreach ($orders as $key => $value) foreach ($orders as $key => $value)
{ {
$linenum++;
$tab = explode('_', $value); $tab = explode('_', $value);
$familykey = $tab[1]; $familykey = $tab[1];
$module_position = $tab[2]; $module_position = $tab[2];
@ -617,6 +618,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
if ($search_nature) if ($search_nature)
{ {
if (preg_match('/^external/', $search_nature) && $objMod->isCoreOrExternalModule() != 'external') continue; if (preg_match('/^external/', $search_nature) && $objMod->isCoreOrExternalModule() != 'external') continue;
$reg = array();
if (preg_match('/^external_(.*)$/', $search_nature, $reg)) if (preg_match('/^external_(.*)$/', $search_nature, $reg))
{ {
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher()); //print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
@ -685,12 +687,161 @@ if ($mode == 'common' || $mode == 'commonkanban')
$imginfo = "info_black"; $imginfo = "info_black";
} }
$codeenabledisable = '';
$codetoconfig = '';
// Activate/Disable and Setup (2 columns)
if (!empty($conf->global->$const_name)) // If module is already activated
{
// Set $codeenabledisable
$disableSetup = 0;
if (!empty($arrayofwarnings[$modName]))
{
$codeenabledisable .= '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
}
if (!empty($objMod->disabled))
{
$codeenabledisable .= $langs->trans("Disabled");
}
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
{
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) $codeenabledisable .= $langs->trans("Used");
else {
$codeenabledisable .= img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium valignmiddle');
//print $langs->trans("Required");
}
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
}
else
{
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
$codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset_confirm&amp;confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&amp;value='.$modName.'&amp;mode='.$mode.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
$codeenabledisable .= '</a>';
}
else {
$codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset&amp;value='.$modName.'&amp;mode='.$mode.'&amp;confirm=yes'.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
$codeenabledisable .= '</a>';
}
}
// Set $codetoconfig
if (!empty($objMod->config_page_url) && !$disableSetup)
{
$backtourlparam = '';
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
$regs = array();
if (is_array($objMod->config_page_url))
{
$i = 0;
foreach ($objMod->config_page_url as $page)
{
$urlpage = $page;
if ($i++)
{
$codetoconfig .= '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
// print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;';
}
else
{
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
{
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
$codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
}
else
{
$urltouse = $urlpage;
$codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
}
}
}
}
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
{
$codetoconfig .= '<a class="valignmiddle" href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
}
else
{
$codetoconfig .= '<a class="valignmiddle" href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
}
}
else
{
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15');
}
}
else // Module not yet activated
{
// Set $codeenabledisable
if (!empty($objMod->always_enabled))
{
// Should never happened
}
elseif (!empty($objMod->disabled))
{
$codeenabledisable .= $langs->trans("Disabled");
}
else
{
// Module qualified for activation
$warningmessage = '';
if (!empty($arrayofwarnings[$modName]))
{
$codeenabledisable .= '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
{
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
{
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
}
}
}
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
{
$codeenabledisable .= '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
{
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
{
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
{
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
{
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
}
}
}
}
}
$codeenabledisable .= '<!-- Message to show: '.$warningmessage.' -->'."\n";
$codeenabledisable .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=set&amp;value='.$modName.'&amp;mode='.$mode.$param.'"';
if ($warningmessage) $codeenabledisable .= ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
$codeenabledisable .= '>';
$codeenabledisable .= img_picto($langs->trans("Disabled"), 'switch_off');
$codeenabledisable .= "</a>\n";
}
// Set $codetoconfig
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"');
}
if ($mode == 'commonkanban') { if ($mode == 'commonkanban') {
// Output Kanban // Output Kanban
print $objMod->getKanbanView(); print $objMod->getKanbanView($codeenabledisable, $codetoconfig);
} else { } else {
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>'; if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.$linenum.'</td>';
// Picto + Name of module // Picto + Name of module
print ' <td width="200px">'; print ' <td width="200px">';
@ -717,13 +868,13 @@ if ($mode == 'common' || $mode == 'commonkanban')
// Help // Help
print '<td class="center nowrap" style="width: 82px;">'; print '<td class="center nowrap" style="width: 82px;">';
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>'; print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($objMod->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '</td>'; print '</td>';
// Version // Version
print '<td class="center nowrap" width="120px">'; print '<td class="center nowrap" width="120px">';
print $versiontrans; print $versiontrans;
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
if (!empty($objMod->url_last_version)) { if (!empty($objMod->url_last_version)) {
$newversion = getURLContent($objMod->url_last_version); $newversion = getURLContent($objMod->url_last_version);
@ -736,158 +887,15 @@ if ($mode == 'common' || $mode == 'commonkanban')
} }
print "</td>\n"; print "</td>\n";
// Activate/Disable and Setup (2 columns)
if (!empty($conf->global->$const_name)) // If module is already activated
{
$disableSetup = 0;
// Link enable/disabme
print '<td class="center valignmiddle" width="60px">';
if (!empty($arrayofwarnings[$modName]))
{
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
}
if (!empty($objMod->disabled))
{
print $langs->trans("Disabled");
}
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
{
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
else {
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
//print $langs->trans("Required");
}
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
}
else
{
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset_confirm&amp;confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&amp;value='.$modName.'&amp;mode='.$mode.$param.'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}
else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset&amp;value='.$modName.'&amp;mode='.$mode.'&amp;confirm=yes'.$param.'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}
}
print '</td>'."\n";
// Link config
print '<td class="tdsetuppicto right" width="60px">';
if (!empty($objMod->config_page_url) && !$disableSetup)
{
$backtourlparam = '';
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
$regs = array();
if (is_array($objMod->config_page_url))
{
$i = 0;
foreach ($objMod->config_page_url as $page)
{
$urlpage = $page;
if ($i++)
{
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
// print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;';
}
else
{
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
{
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
}
else
{
$urltouse = $urlpage;
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
}
}
}
}
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
{
print '<a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
}
else
{
print '<a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
}
}
else
{
print img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"');
}
print '</td>';
}
else // Module not yet activated
{
// Link enable/disable // Link enable/disable
print '<td class="center valignmiddle" width="60px">'; print '<td class="center valignmiddle" width="60px">';
if (!empty($objMod->always_enabled)) print $codeenabledisable;
{
// Should never happened
}
elseif (!empty($objMod->disabled))
{
print $langs->trans("Disabled");
}
else
{
// Module qualified for activation
$warningmessage = '';
if (!empty($arrayofwarnings[$modName]))
{
print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
{
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
{
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
}
}
}
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
{
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
{
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
{
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
{
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
{
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
}
}
}
}
}
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=set&amp;value='.$modName.'&amp;mode='.$mode.$param.'"';
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
print '>';
print img_picto($langs->trans("Disabled"), 'switch_off');
print "</a>\n";
}
print "</td>\n"; print "</td>\n";
// Link config // Link config
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>'; print '<td class="tdsetuppicto right valignmiddle" width="60px">';
} print $codetoconfig;
print '</td>';
print "</tr>\n"; print "</tr>\n";
} }
@ -952,26 +960,24 @@ if ($mode == 'marketplace')
$previouslink = $dolistore->get_previous_link(); $previouslink = $dolistore->get_previous_link();
$nextlink = $dolistore->get_next_link(); $nextlink = $dolistore->get_next_link();
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">' print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$dolistore->url.'">';
?> ?>
<form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
<input type="hidden" name="token" value="<?php echo newToken(); ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace"> <input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>: <div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br> <input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
</div> </div>
<div class="divsearchfield"> <div class="divsearchfield">
<input class="button" value="<?php echo $langs->trans('Rechercher') ?>" type="submit"> <input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a> <a class="buttonreset" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp; &nbsp;
</div> </div>
<div class="divsearchfield right">
<?php <?php
print $previouslink; print $previouslink;
print $nextlink; print $nextlink;
print '</div>';
print '</form>'; print '</form>';

View File

@ -281,8 +281,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print '<td>'.$form->textwithpicto($langs->trans("CurrencyLayerAccount"), $langs->trans("CurrencyLayerAccount_help_to_synchronize", $urlforapilayer)).'</td>'."\n"; print '<td>'.$form->textwithpicto($langs->trans("CurrencyLayerAccount"), $langs->trans("CurrencyLayerAccount_help_to_synchronize", $urlforapilayer)).'</td>'."\n";
print '<td class="right">'; print '<td class="right">';
print '<textarea id="response" class="hideobject" name="response"></textarea>'; print '<textarea id="response" class="hideobject" name="response"></textarea>';
print '<input type="submit" name="modify_apilayer" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" name="modify_apilayer" class="button buttongen" value="'.$langs->trans("Modify").'">';
print '<input type="submit" id="bt_sync" name="bt_sync_apilayer" class="button" value="'.$langs->trans('Synchronize').'" />'; print '<input type="submit" id="bt_sync" name="bt_sync_apilayer" class="button buttongen" value="'.$langs->trans('Synchronize').'" />';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org> * Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org> * Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org>
* Copyright (C) 2020 Thibault FOUCART <suport@ptibogxiv.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -43,6 +44,32 @@ $action = GETPOST('action', 'aZ09');
* Actions * Actions
*/ */
// Action to update or add a constant
if ($action == 'update' || $action == 'add')
{
$constlineid = GETPOST('rowid', 'int');
$constname=GETPOST('constname', 'alpha');
$constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
$consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
$constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
if ($action == 'setvalue' && $user->admin) if ($action == 'setvalue' && $user->admin)
{ {
$db->begin(); $db->begin();
@ -149,6 +176,43 @@ $title = $langs->trans("ListOfNotificationsPerUser");
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact"); if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
print load_fiche_titre($title, '', ''); print load_fiche_titre($title, '', '');
// Load array of available notifications
$notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
// Editing global variables not related to a specific theme
$constantes=array();
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
elseif ($notifiedevent['elementtype'] == 'shipping') $elementLabel = $langs->trans('Shipping');
elseif ($notifiedevent['elementtype'] == 'expensereport') $elementLabel = $langs->trans('ExpenseReport');
if ($notifiedevent['elementtype'] == 'propal') $model = 'propal_send';
elseif ($notifiedevent['elementtype'] == 'commande') $model = 'order_send';
elseif ($notifiedevent['elementtype'] == 'facture') $model = 'facture_send';
elseif ($notifiedevent['elementtype'] == 'shipping') $model = 'shipping_send';
elseif ($notifiedevent['elementtype'] == 'ficheinter') $model = 'fichinter_send';
elseif ($notifiedevent['elementtype'] == 'expensereport') $model = 'expensereport_send';
elseif ($notifiedevent['elementtype'] == 'order_supplier') $model = 'order_supplier_send';
//elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
elseif ($notifiedevent['elementtype'] == 'member') $model = 'member';
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
}
$helptext='';
form_constantes($constantes, 0, $helptext);
} else {
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
@ -157,10 +221,6 @@ print '<td>'.$langs->trans("Label").'</td>';
//print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>'; //print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print "</tr>\n"; print "</tr>\n";
// Load array of available notifications
$notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
@ -183,12 +243,15 @@ foreach ($listofnotifiedevents as $notifiedevent)
$i++; $i++;
} }
print '</td></tr>';
print '</td></tr>';
print '</table>'; print '</table>';
}
print '<div class="opacitymedium">'; print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>'; print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>'; if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '</div>'; print '</div>';
print '<br><br>'; print '<br><br>';
@ -205,10 +268,6 @@ print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>'; print '<td>'.'</td>';
print "</tr>\n"; print "</tr>\n";
// Load array of available notifications
$notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
foreach ($listofnotifiedevents as $notifiedevent) foreach ($listofnotifiedevents as $notifiedevent)
{ {
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];

View File

@ -89,7 +89,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit')
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n"; print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';

View File

@ -203,7 +203,7 @@ if ($result)
// Show break line // Show break line
print '<tr class="oddeven trforbreak">'; print '<tr class="oddeven trforbreak">';
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">'; print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
print '<a name="'.$objMod->getName().'"></a>'; print '<a name="'.$objMod->getName().'"></a>';
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
@ -218,8 +218,6 @@ if ($result)
// Picto and label of module // Picto and label of module
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">'; print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
//print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName();
//print '<a name="'.$objMod->getName().'">&nbsp;</a>';
print '</td>'; print '</td>';
// Tick // Tick

View File

@ -515,11 +515,11 @@ foreach ($dirmodels as $reldir)
print '</table>'; print '</table>';
/* /*
* Payment mode * Payment mode
*/ */
if (empty($conf->facture->enabled))
{
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', ''); print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', '');
@ -532,12 +532,18 @@ if (empty($conf->facture->enabled))
print '<td>'; print '<td>';
print '<input type="hidden" name="action" value="setribchq">'; print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>'; print $langs->trans("PaymentMode").'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="right">';
if (empty($conf->facture->enabled)) {
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
}
print '</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>"; print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled))
{
if (!empty($conf->banque->enabled)) if (!empty($conf->banque->enabled))
{ {
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
@ -574,13 +580,19 @@ if (empty($conf->facture->enabled))
} }
else else
{ {
print $langs->trans("BankModuleNotActive"); print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
}
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
} }
print "</td></tr>"; print "</td></tr>";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>"; print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled))
{
print '<select class="flat" name="chq" id="chq">'; print '<select class="flat" name="chq" id="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>'; print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>'; print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
@ -608,10 +620,14 @@ if (empty($conf->facture->enabled))
} }
} }
print "</select>"; print "</select>";
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
print "</form>"; print "</form>";
}
print '<br>'; print '<br>';

View File

@ -401,7 +401,7 @@ function getTableColumnFunction(array $functions)
* @param array $loaded A list with all loaded PHP extensions * @param array $loaded A list with all loaded PHP extensions
* @param array $functions A list with all PHP functions to check * @param array $functions A list with all PHP functions to check
* *
* @return array * @return string
*/ */
function getResultColumn($name, array $activated, array $loaded, array $functions) function getResultColumn($name, array $activated, array $loaded, array $functions)
{ {

View File

@ -195,7 +195,7 @@ dol_fiche_end();
* Projects Numbering model * Projects Numbering model
*/ */
print load_fiche_titre($langs->trans("TicketNumberingModules")); print load_fiche_titre($langs->trans("TicketNumberingModules"), '', '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@ -298,7 +298,7 @@ if (!$conf->use_javascript_ajax) {
print '<input type="hidden" name="action" value="setvarother">'; print '<input type="hidden" name="action" value="setvarother">';
} }
print load_fiche_titre($langs->trans("TicketParams")); print load_fiche_titre($langs->trans("Other"), '', '');
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -307,78 +307,6 @@ print '<td></td>';
print '<td></td>'; print '<td></td>';
print "</tr>\n"; print "</tr>\n";
// Activate email notifications
/*
print '<tr class="pair"><td>' . $langs->trans("TicketsDisableEmail") . '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_DISABLE_ALL_MAILS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_DISABLE_ALL_MAILS", $arrval, $conf->global->TICKET_DISABLE_ALL_MAILS);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Activate log by email
print '<tr class="pair"><td>' . $langs->trans("TicketsLogEnableEmail") . '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help');
print '</td>';
print '</tr>';
*/
// Also send to main email address
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
print '</td>';
print '</tr>';
}
// Limiter la vue des tickets à ceux assignés à l'utilisateur
/*
print '<tr class="pair"><td>' . $langs->trans("TicketsLimitViewAssignedOnly") . '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_LIMIT_VIEW_ASSIGNED_ONLY');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_LIMIT_VIEW_ASSIGNED_ONLY", $arrval, $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsLimitViewAssignedOnlyHelp"), 1, 'help');
print '</td>';
print '</tr>';
*/
/*if (!$conf->use_javascript_ajax) {
print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
print '</tr>';
}*/
// Auto assign ticket at user who created it // Auto assign ticket at user who created it
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
print '<td class="left">'; print '<td class="left">';
@ -401,7 +329,7 @@ if (!$conf->use_javascript_ajax) {
} }
// Admin var of module // Admin var of module
print load_fiche_titre($langs->trans("Notification")); print load_fiche_titre($langs->trans("Notification"), '', '');
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@ -419,22 +347,6 @@ if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
print "</tr>\n"; print "</tr>\n";
} }
// Activate log by email
/*print '<tr class="pair"><td>' . $langs->trans("TicketsLogEnableEmail") . '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help');
print '</td>';
print '</tr>';
*/
// @todo Use module notification instead... // @todo Use module notification instead...
// Email d'envoi des notifications // Email d'envoi des notifications
@ -446,18 +358,36 @@ print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"),
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Email de réception des notifications // Email for notification of TICKET_CREATE
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").' ('.$langs->trans("Creation").')</td>';
print '<td class="left">'; print '<td class="left">';
print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : $conf->global->TICKET_NOTIFICATION_EMAIL_FROM).'" size="20" ></td>'; print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
print '<td class="center">'; print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
print '</td>';
print '</tr>';
}
// Texte d'introduction // Texte d'introduction
$mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText'); $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText');
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").'</label>'; print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").' ('.$langs->trans("Responses").')';
print '</td><td>'; print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);

View File

@ -41,11 +41,12 @@ if ($user->socid > 0)
$socid = $user->socid; $socid = $user->socid;
} }
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page ; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC"; if (!$sortorder) $sortorder = "DESC";

View File

@ -153,7 +153,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
// Show message // Show message
$message = ''; $message = '';
$url = $urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]'; $url = $urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
$message .= $langs->trans("UrlToGetKeyToUseAPIs").':<br>'; $message .= '<span class="opacitymedium">'.$langs->trans("UrlToGetKeyToUseAPIs").':</span><br>';
$message .= img_picto('', 'globe').' '.$url; $message .= img_picto('', 'globe').' '.$url;
print $message; print $message;
print '<br>'; print '<br>';

View File

@ -1409,15 +1409,15 @@ class Setup extends DolibarrApi
* *
* Note that conf variables that stores security key or password hashes can't be loaded with API. * Note that conf variables that stores security key or password hashes can't be loaded with API.
* *
* @url GET /conf * @param string $constantname Name of conf variable to get
*
* @param string $confname Name of conf variable to get
* @return array|mixed Data without useless information * @return array|mixed Data without useless information
* *
* @url GET conf/{constantname}
*
* @throws RestException 403 Forbidden * @throws RestException 403 Forbidden
* @throws RestException 500 Error Bad or unknown value for constname * @throws RestException 500 Error Bad or unknown value for constantname
*/ */
public function getConf($confname) public function getConf($constantname)
{ {
global $conf; global $conf;
@ -1426,14 +1426,14 @@ class Setup extends DolibarrApi
throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK'); throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK');
} }
if (! preg_match('/^[a-zA-Z0-9_]+$/', $confname) || ! isset($conf->global->$confname)) { if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || ! isset($conf->global->$constantname)) {
throw new RestException(500, 'Error Bad or unknown value for constname'); throw new RestException(500, 'Error Bad or unknown value for constantname');
} }
if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) { if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) {
throw new RestException(403, 'Forbidden'); throw new RestException(403, 'Forbidden');
} }
return $conf->global->$confname; return $conf->global->$constantname;
} }
/** /**

View File

@ -34,15 +34,18 @@ $langs->loadLangs(array("asset"));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
// Initialize technical objects // Initialize technical objects
$object = new Asset($db); $object = new Asset($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('assetcard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -59,23 +62,20 @@ foreach ($object->fields as $key => $val)
if (empty($action) && empty($id) && empty($ref)) $action = 'view'; if (empty($action) && empty($id) && empty($ref)) $action = 'view';
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'asset', $id);
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$permissiontoread = $user->rights->asset->read;
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php $permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php $permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1];
/* /*
* Actions * Actions
*
* Put here all code to do according to value of "action" parameter
*/ */
$parameters = array(); $parameters = array();
@ -86,16 +86,35 @@ if (empty($reshook))
{ {
$error = 0; $error = 0;
$permissiontoadd = $user->rights->asset->create;
$permissiontodelete = $user->rights->asset->delete;
$backurlforlist = dol_buildpath('/asset/list.php', 1); $backurlforlist = dol_buildpath('/asset/list.php', 1);
// Actions cancel, add, update or delete // Actions cancel, add, update or delete
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
// Actions when printing a doc from card // Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Action to move up and down lines of object
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
// Action to build doc
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
if ($action == 'set_thirdparty' && $permissiontoadd)
{
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
}
if ($action == 'classin' && $permissiontoadd)
{
$object->setProject(GETPOST('projectid', 'int'));
}
// Actions to send emails // Actions to send emails
$triggersendname = 'ASSET_SENTBYMAIL'; $triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
@ -143,11 +162,12 @@ if ($action == 'create')
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
dol_fiche_head(array(), ''); dol_fiche_head(array(), '');
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent tableforfieldcreate">'."\n";
// Common attributes // Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
@ -166,6 +186,8 @@ if ($action == 'create')
print '</div>'; print '</div>';
print '</form>'; print '</form>';
//dol_set_focus('input[name="ref"]');
} }
// Part to edit record // Part to edit record
@ -178,10 +200,12 @@ if (($id || $ref) && $action == 'edit')
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
dol_fiche_head(); dol_fiche_head();
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent tableforfieldedit">'."\n";
// Common attributes // Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
@ -206,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$res = $object->fetch_optionals(); $res = $object->fetch_optionals();
$head = asset_prepare_head($object); $head = asset_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic'); dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto);
$formconfirm = ''; $formconfirm = '';
@ -255,10 +279,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
// Common attributes // Common attributes
//$keyforbreak='fieldkeytoswithonsecondcolumn'; //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just after this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_soc']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Other attributes // Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>'; print '</table>';
@ -266,7 +292,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '<div class="clearboth"></div><br>'; print '<div class="clearboth"></div>';
dol_fiche_end(); dol_fiche_end();
@ -281,7 +307,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) if (empty($reshook))
{ {
// Send // Send
if (empty($user->socid)) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
}
if ($user->rights->asset->write) if ($user->rights->asset->write)
{ {
@ -347,14 +375,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
//Select mail models is same action as presend //Select mail models is same action as presend
/*
if (GETPOST('modelselected')) $action = 'presend'; if (GETPOST('modelselected')) $action = 'presend';
// Presend form // Presend form
$modelmail='inventory'; /*
$modelmail='asset';
$defaulttopic='InformationMessage'; $defaulttopic='InformationMessage';
$diroutput = $conf->product->dir_output.'/inventory'; $diroutput = $conf->asset->dir_output.'/asset';
$trackid = 'stockinv'.$object->id; $trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
*/ */

View File

@ -77,12 +77,12 @@ class Asset extends CommonObject
*/ */
public $fields = array( public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object",), 'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>1),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text",), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1),
'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), 'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), 'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",), 'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",),
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),

View File

@ -202,7 +202,7 @@ class AssetType extends CommonObject
$action = 'update'; $action = 'update';
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (! $error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)

View File

@ -45,11 +45,12 @@ $ref = GETPOST('ref', 'alpha');
//$result = restrictedArea($user, 'asset', $id); //$result = restrictedArea($user, 'asset', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -328,12 +328,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('NewAsset'), '', 'fa fa-plus-circle', dol_buildpath('/asset/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); $newcardbutton = dolGetButtonTitle($langs->trans('NewAsset'), '', 'fa fa-plus-circle', dol_buildpath('/asset/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form) // Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendAssetsRef"; $topicmail = "SendAssetsRef";

View File

@ -253,7 +253,7 @@ if ($conf->product->enabled || $conf->product->service)
$nbno = $nbtotal = 0; $nbno = $nbtotal = 0;
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'products'); print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product');
print '<br>'."\n"; print '<br>'."\n";
$sql = "SELECT count(rowid) as nb, fk_product_type, datec"; $sql = "SELECT count(rowid) as nb, fk_product_type, datec";

View File

@ -256,7 +256,7 @@ jQuery(document).ready(function() {
// Part to create // Part to create
if ($action == 'create') if ($action == 'create')
{ {
print load_fiche_titre($langs->trans("NewBOM"), '', 'cubes'); print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
@ -601,7 +601,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) if (empty($reshook))
{ {
// Send // Send
//if (empty($user->socid)) {
// print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n"; // print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
//}
// Back to draft // Back to draft
if ($object->status == $object::STATUS_VALIDATED) if ($object->status == $object::STATUS_VALIDATED)

View File

@ -46,11 +46,12 @@ $ref = GETPOST('ref', 'alpha');
//$result = restrictedArea($user, 'bom', $id); //$result = restrictedArea($user, 'bom', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -440,12 +440,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write); $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form) // Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendBillOfMaterialsRef"; $topicmail = "SendBillOfMaterialsRef";

View File

@ -0,0 +1,74 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013-2020 Charlene BENKE <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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 <https://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
print "<!-- BEGIN PHP TEMPLATE -->\n";
global $user, $db;
global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
// Load translation files required by the page
$langs->load("bom");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total = 0;
$ilink = 0;
foreach ($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$product_static= new Product($db);
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total';
echo '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element" >'.$langs->trans("Bom");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
$product_static->fetch($objectlink->fk_product);
echo '<td class="linkedcol-ref" align="center">'.$product_static->getNomUrl(1).'</td>';
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}
echo '</td>';
echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
echo '<td class="linkedcol-action right">';
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
}
echo '</td>';
echo "</tr>\n";
}
echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -128,12 +128,16 @@ $coldisplay++;
print '<td class="nobottom nowrap linecollost right">'; print '<td class="nobottom nowrap linecollost right">';
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>'; print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
$coldisplay++;
print '<td class="nobottom nowrap linecolcostprice right">';
print '</td>';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">'; print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<input type="submit" class="button" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button buttongen marginbottomonly" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">';
print '<br>'; print '<br>';
print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -52,7 +52,7 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>'; print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
// Qty // Qty
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).'</td>';
if ($conf->global->PRODUCT_USE_UNITS) if ($conf->global->PRODUCT_USE_UNITS)
{ {

View File

@ -172,7 +172,7 @@ if ($action == 'create')
// Owner // Owner
print '<tr><td>'.$langs->trans("Owner").'</td><td>'; print '<tr><td>'.$langs->trans("Owner").'</td><td>';
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>'; print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
// Position // Position
@ -276,11 +276,11 @@ if ($id > 0 && ! preg_match('/^add/i', $action))
print '<tr><td>'.$langs->trans("Owner").'</td><td>'; print '<tr><td>'.$langs->trans("Owner").'</td><td>';
if ($action == 'edit' && $user->admin) if ($action == 'edit' && $user->admin)
{ {
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($object->fk_user?$object->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
} }
else else
{ {
if ($object->fk_user) if ($object->fk_user > 0)
{ {
$fuser = new User($db); $fuser = new User($db);
$fuser->fetch($object->fk_user); $fuser->fetch($object->fk_user);

View File

@ -155,13 +155,12 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = ''; $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer)); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -178,6 +177,8 @@ print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $par
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
$cacheOfUsers = array();
$i = 0; $i = 0;
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
@ -222,9 +223,13 @@ while ($i < min($num, $limit))
print '<td class="center">'; print '<td class="center">';
if ($obj->fk_user) if ($obj->fk_user)
{ {
$userstatic->id = $obj->fk_user; if (empty($cacheOfUsers[$obj->fk_user])) {
$userstatic->lastname = $obj->login; $tmpuser = new User($db);
print $userstatic->getNomUrl(1); $tmpuser->fetch($obj->fk_user);
$cacheOfUsers[$obj->fk_user] = $tmpuser;
}
$tmpuser = $cacheOfUsers[$obj->fk_user];
print $tmpuser->getNomUrl(1);
} }
else else
{ {
@ -242,11 +247,11 @@ while ($i < min($num, $limit))
print '<td class="nowrap right">'; print '<td class="nowrap right">';
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
print '<a href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>"; print '<a class="editfielda" href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
} }
if ($user->rights->bookmark->supprimer) if ($user->rights->bookmark->supprimer)
{ {
print "<a href=\"".$_SERVER["PHP_SELF"]."?action=delete&id=$obj->rowid\">".img_delete()."</a>"; print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$obj->rowid.'">'.img_delete().'</a>';
} }
else else
{ {

View File

@ -144,6 +144,26 @@ class Categorie extends CommonObject
'website_page' => 'WebsitePage' 'website_page' => 'WebsitePage'
); );
/**
* @var array Title Area mapping from type string
*
* @note Move to const array when PHP 5.6 will be our minimum target
*/
public static $MAP_TYPE_TITLE_AREA = array(
'product' => 'ProductsCategoriesArea',
'customer' => 'CustomersCategoriesArea',
'supplier' => 'SuppliersCategoriesArea',
'member' => 'MembersCategoriesArea',
'contact' => 'ContactsCategoriesArea',
'user' => 'UsersCategoriesArea',
'account' => 'AccountsCategoriesArea', // old for bank account
'bank_account' => 'AccountsCategoriesArea',
'project' => 'ProjectsCategoriesArea',
'warehouse'=> 'StocksCategoriesArea',
'actioncomm' => 'ActioncommCategoriesArea',
'website_page' => 'WebsitePageCategoriesArea'
);
/** /**
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name. * @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
* *
@ -291,6 +311,7 @@ class Categorie extends CommonObject
if (!is_numeric($type)) $type = $this->MAP_ID[$type]; if (!is_numeric($type)) $type = $this->MAP_ID[$type];
$sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext"; $sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id > 0) if ($id > 0)
{ {
@ -325,6 +346,10 @@ class Categorie extends CommonObject
$this->type = $res['type']; $this->type = $res['type'];
$this->ref_ext = $res['ref_ext']; $this->ref_ext = $res['ref_ext'];
$this->entity = $res['entity']; $this->entity = $res['entity'];
$this->date_creation = $this->db->jdate($res['date_creation']);
$this->date_modification = $this->db->jdate($res['tms']);
$this->user_creation = $res['fk_user_creat'];
$this->user_modification = $res['fk_user_modif'];
// Retreive all extrafield // Retreive all extrafield
// fetch optionals attributes and labels // fetch optionals attributes and labels
@ -389,7 +414,7 @@ class Categorie extends CommonObject
} }
$this->db->begin(); $this->db->begin();
$now = dol_now();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (";
$sql .= "fk_parent,"; $sql .= "fk_parent,";
$sql .= " label,"; $sql .= " label,";
@ -403,7 +428,9 @@ class Categorie extends CommonObject
$sql .= " type,"; $sql .= " type,";
$sql .= " import_key,"; $sql .= " import_key,";
$sql .= " ref_ext,"; $sql .= " ref_ext,";
$sql .= " entity"; $sql .= " entity,";
$sql .= " date_creation,";
$sql .= " fk_user_creat";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= $this->db->escape($this->fk_parent).","; $sql .= $this->db->escape($this->fk_parent).",";
$sql .= "'".$this->db->escape($this->label)."',"; $sql .= "'".$this->db->escape($this->label)."',";
@ -417,7 +444,9 @@ class Categorie extends CommonObject
$sql .= $this->db->escape($type).","; $sql .= $this->db->escape($type).",";
$sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').","; $sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').",";
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').","; $sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').",";
$sql .= $this->db->escape($conf->entity); $sql .= $this->db->escape($conf->entity).",";
$sql .= "'".$this->db->idate($now)."', ";
$sql .= (int) $user->id;
$sql .= ")"; $sql .= ")";
$res = $this->db->query($sql); $res = $this->db->query($sql);
@ -432,7 +461,7 @@ class Categorie extends CommonObject
$action = 'create'; $action = 'create';
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -515,6 +544,7 @@ class Categorie extends CommonObject
} }
$sql .= ", visible = '".$this->db->escape($this->visible)."'"; $sql .= ", visible = '".$this->db->escape($this->visible)."'";
$sql .= ", fk_parent = ".$this->fk_parent; $sql .= ", fk_parent = ".$this->fk_parent;
$sql .= ", fk_user_modif = ".(int) $user->id;
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);
@ -523,7 +553,7 @@ class Categorie extends CommonObject
$action = 'update'; $action = 'update';
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -616,7 +646,7 @@ class Categorie extends CommonObject
} }
// Removed extrafields // Removed extrafields
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
if ($result < 0) if ($result < 0)
@ -1362,9 +1392,10 @@ class Categorie extends CommonObject
* @param string $sep Separator * @param string $sep Separator
* @param string $url Url * @param string $url Url
* @param int $nocolor 0 * @param int $nocolor 0
* @param string $addpicto Add picto into link
* @return array * @return array
*/ */
public function print_all_ways($sep = " &gt;&gt; ", $url = '', $nocolor = 0) public function print_all_ways($sep = ' &gt;&gt; ', $url = '', $nocolor = 0, $addpicto = 0)
{ {
// phpcs:enable // phpcs:enable
$ways = array(); $ways = array();
@ -1397,11 +1428,11 @@ class Categorie extends CommonObject
{ {
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$cat->id.'&type='.$cat->type.'" class="'.$forced_color.'">'; $link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$cat->id.'&type='.$cat->type.'" class="'.$forced_color.'">';
$linkend = '</a>'; $linkend = '</a>';
$w[] = $link.$cat->label.$linkend; $w[] = $link.($addpicto ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend;
} }
else else
{ {
$w[] = "<a href='".DOL_URL_ROOT."/$url?catid=".$cat->id."'>".$cat->label."</a>"; $w[] = "<a href='".DOL_URL_ROOT."/".$url."?catid=".$cat->id."'>".($addpicto ? img_object('', 'category') : '').$cat->label."</a>";
} }
} }
$newcategwithpath = preg_replace('/toreplace/', $forced_color, implode($sep, $w)); $newcategwithpath = preg_replace('/toreplace/', $forced_color, implode($sep, $w));

View File

@ -86,7 +86,7 @@ print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("Search").'</td>'; print '<td colspan="3">'.$langs->trans("Search").'</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven nohover"><td>';
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>'; print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
/* /*
// faire une rech dans une sous categorie uniquement // faire une rech dans une sous categorie uniquement
@ -197,7 +197,7 @@ print '<table class="liste nohover" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td></td><td class="right">'; print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td></td><td class="right">';
if (!empty($conf->use_javascript_ajax)) if (!empty($conf->use_javascript_ajax))
{ {
print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">'.img_picto('', 'folder').' '.$langs->trans("UndoExpandAll").'</a> | <a class="notasortlink" href="#">'.img_picto('', 'folder-open').' '.$langs->trans("ExpandAll").'</a></div>'; print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a> | <a class="notasortlink" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a></div>';
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -0,0 +1,95 @@
<?php
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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 <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/categories/info.php
* \ingroup categories
* \brief Category info page
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
if (!$user->rights->categorie->lire) {
accessforbidden();
}
// Load translation files required by the page
$langs->loadLangs(array('categories', 'sendings'));
$socid = 0;
$id = GETPOST('id', 'int');
// Security check
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db);
if (!$object->fetch($id) > 0) {
dol_print_error($db);
exit;
}
$type = $object->type;
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
/*
* View
*/
$form = new Form($db);
llxHeader('', $langs->trans('Categories'), '');
//$object->info($object->id);
$head = categories_prepare_head($object, $type);
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
dol_fiche_head($head, 'info', $langs->trans($title), -1, 'category');
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$type;
$object->ref = $object->label;
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
$ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
foreach ($ways as $way) {
$morehtmlref .= $way."<br>\n";
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -112,20 +112,12 @@ $formother = new FormOther($db);
if ($object->id) if ($object->id)
{ {
if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort"); $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort");
else $title = $langs->trans("Category");
$head = categories_prepare_head($object, $type); $head = categories_prepare_head($object, $type);
dol_fiche_head($head, 'photos', $title, -1, 'category'); dol_fiche_head($head, 'photos', $langs->trans($title), -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type; $object->next_prev_filter = ' type = '.$object->type;

View File

@ -173,15 +173,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formother = new FormOther($db); $formother = new FormOther($db);
if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort"); $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort");
else $title = $langs->trans("Category");
$head = categories_prepare_head($object, $type); $head = categories_prepare_head($object, $type);
@ -195,7 +187,7 @@ if (!empty($object->multilangs))
} }
} }
dol_fiche_head($head, 'translation', $title, -1, 'category'); dol_fiche_head($head, 'translation', $langs->trans($title), -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type; $object->next_prev_filter = ' type = '.$object->type;

View File

@ -207,21 +207,12 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
$helpurl = ''; $helpurl = '';
llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss);
if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; } $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; }
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; }
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; }
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
$head = categories_prepare_head($object, $type); $head = categories_prepare_head($object, $type);
dol_fiche_head($head, 'card', $title, -1, 'category'); dol_fiche_head($head, 'card', $langs->trans($title), -1, 'category');
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type; $object->next_prev_filter = ' type = '.$object->type;
@ -313,7 +304,7 @@ if (! empty($user->rights->categorie->creer))
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print load_fiche_titre($langs->trans("SubCats"), $newcardbutton); print load_fiche_titre($langs->trans("SubCats"), $newcardbutton, 'object_category');
print '<table class="liste nohover" width="100%">'; print '<table class="liste nohover" width="100%">';
@ -326,9 +317,9 @@ print '<td class="right">';
if (!empty($conf->use_javascript_ajax)) if (!empty($conf->use_javascript_ajax))
{ {
print '<div id="iddivjstreecontrol">'; print '<div id="iddivjstreecontrol">';
print '<a class="notasortlink" href="#">'.img_picto('', 'object_category').' '.$langs->trans("UndoExpandAll").'</a>'; print '<a class="notasortlink" href="#">'.img_picto('', 'folder').' '.$langs->trans("UndoExpandAll").'</a>';
print " | "; print " | ";
print '<a class="notasortlink" href="#">'.img_picto('', 'object_category-expanded').' '.$langs->trans("ExpandAll").'</a>'; print '<a class="notasortlink" href="#">'.img_picto('', 'folder-open').' '.$langs->trans("ExpandAll").'</a>';
print '</div>'; print '</div>';
} }
@ -350,7 +341,7 @@ else
{ {
$categstatic = new Categorie($db); $categstatic = new Categorie($db);
$fulltree = $categstatic->get_full_arbo($typetext, $object->id, 1); $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
// Load possible missing includes // Load possible missing includes
if ($conf->global->CATEGORY_SHOW_COUNTS) if ($conf->global->CATEGORY_SHOW_COUNTS)
@ -784,7 +775,7 @@ if ($type == Categorie::TYPE_CONTACT)
} }
} }
// List of accounts // List of bank accounts
if ($type == Categorie::TYPE_ACCOUNT) if ($type == Categorie::TYPE_ACCOUNT)
{ {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -807,7 +798,7 @@ if ($type == Categorie::TYPE_ACCOUNT)
print '<br>'; print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($accounts); $nbtotalofrecords = ''; $newcardbutton = ''; $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($accounts); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n"; print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";

View File

@ -317,7 +317,7 @@ if (empty($reshook) && $action == 'add')
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int"); if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int");
} }
$object->note = trim(GETPOST("note")); $object->note_private = trim(GETPOST("note"));
if (isset($_POST["contactid"])) $object->contact = $contact; if (isset($_POST["contactid"])) $object->contact = $contact;
@ -465,7 +465,6 @@ if (empty($reshook) && $action == 'update')
$object->contactid = key($object->socpeopleassigned); $object->contactid = key($object->socpeopleassigned);
} }
$object->fk_project = GETPOST("projectid", 'int'); $object->fk_project = GETPOST("projectid", 'int');
$object->note = GETPOST("note", "none"); // deprecated
$object->note_private = GETPOST("note", "none"); $object->note_private = GETPOST("note", "none");
$object->fk_element = GETPOST("fk_element", "int"); $object->fk_element = GETPOST("fk_element", "int");
$object->elementtype = GETPOST("elementtype", "alphanohtml"); $object->elementtype = GETPOST("elementtype", "alphanohtml");
@ -1122,7 +1121,7 @@ if ($action == 'create')
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
@ -1188,7 +1187,7 @@ if ($id > 0)
$object->contactid = GETPOST("contactid", 'int'); $object->contactid = GETPOST("contactid", 'int');
$object->fk_project = GETPOST("projectid", 'int'); $object->fk_project = GETPOST("projectid", 'int');
$object->note = GETPOST("note", 'none'); $object_private = GETPOST("note", 'none');
} }
if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
@ -1540,7 +1539,7 @@ if ($id > 0)
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// Editeur wysiwyg // Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', $object->note, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%'); $doleditor = new DolEditor('note', $object->note_private, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';

View File

@ -5,7 +5,7 @@
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -380,7 +380,7 @@ class ActionComm extends CommonObject
// Clean parameters // Clean parameters
$this->label = dol_trunc(trim($this->label), 128); $this->label = dol_trunc(trim($this->label), 128);
$this->location = dol_trunc(trim($this->location), 128); $this->location = dol_trunc(trim($this->location), 128);
$this->note = dol_htmlcleanlastbr(trim($this->note)); $this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private));
if (empty($this->percentage)) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0;
@ -488,7 +488,7 @@ class ActionComm extends CommonObject
$sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", "; $sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", ";
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";
$sql .= " '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."', "; $sql .= " '".$this->db->escape($this->note_private)."', ";
$sql .= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid : "null").", "; $sql .= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid : "null").", ";
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", "; $sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", "; $sql .= ($userownerid > 0 ? $userownerid : "null").", ";
@ -567,15 +567,12 @@ class ActionComm extends CommonObject
if (!$error) if (!$error)
{ {
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
} }
} }
}
if (!$error && !$notrigger) if (!$error && !$notrigger)
{ {
@ -740,7 +737,7 @@ class ActionComm extends CommonObject
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
$this->note = $obj->note; $this->note = $obj->note; // deprecated
$this->note_private = $obj->note; $this->note_private = $obj->note;
$this->percentage = $obj->percentage; $this->percentage = $obj->percentage;
@ -898,25 +895,29 @@ class ActionComm extends CommonObject
$error = 0; $error = 0;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$this->db->begin(); $this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; // remove categorie association
$sql .= " WHERE id=".$this->id; if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm";
$sql .= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res < 0) { if (!$res) {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
}
// remove actioncomm_resources
if (!$error) { if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql .= " WHERE fk_actioncomm=".$this->id; $sql .= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res < 0) { if (!$res) {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -932,6 +933,18 @@ class ActionComm extends CommonObject
} }
} }
// remove actioncomm
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE id=".$this->id;
$res = $this->db->query($sql);
if (!$res) {
$this->error = $this->db->lasterror();
$error++;
}
}
if (!$error) if (!$error)
{ {
if (!$notrigger) if (!$notrigger)
@ -977,7 +990,7 @@ class ActionComm extends CommonObject
// Clean parameters // Clean parameters
$this->label = trim($this->label); $this->label = trim($this->label);
$this->note = trim($this->note); $this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private));
if (empty($this->percentage)) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->transparency)) $this->transparency = 0; if (empty($this->transparency)) $this->transparency = 0;
@ -1011,7 +1024,7 @@ class ActionComm extends CommonObject
$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null'); $sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
$sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape($this->durationp)."'" : "null"); // deprecated $sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape($this->durationp)."'" : "null"); // deprecated
$sql .= ", note = '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."'"; $sql .= ", note = '".$this->db->escape($this->note_private)."'";
$sql .= ", fk_project =".($this->fk_project > 0 ? $this->fk_project : "null"); $sql .= ", fk_project =".($this->fk_project > 0 ? $this->fk_project : "null");
$sql .= ", fk_soc =".($socid > 0 ? $socid : "null"); $sql .= ", fk_soc =".($socid > 0 ? $socid : "null");
$sql .= ", fk_contact =".($contactid > 0 ? $contactid : "null"); $sql .= ", fk_contact =".($contactid > 0 ? $contactid : "null");
@ -1032,7 +1045,7 @@ class ActionComm extends CommonObject
$action = 'update'; $action = 'update';
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -1381,7 +1394,7 @@ class ActionComm extends CommonObject
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL'); if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
} }
$tooltip = '<u>'.$langs->trans('ShowAction').'</u>'; $tooltip = '<u>'.$langs->trans('Action').'</u>';
if (!empty($this->ref)) if (!empty($this->ref))
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($label)) if (!empty($label))
@ -1390,8 +1403,8 @@ class ActionComm extends CommonObject
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype; $tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype;
if (!empty($this->location)) if (!empty($this->location))
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location; $tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location;
if (!empty($this->note)) if (!empty($this->note_private))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note) ? str_replace(array("\r", "\n"), "", $this->note) : str_replace(array("\r", "\n"), '<br>', $this->note)); $tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '<br>', $this->note_private));
$linkclose = ''; $linkclose = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"'; $linkclose = ' style="background-color:#'.$this->type_color.'"';
@ -1924,8 +1937,7 @@ class ActionComm extends CommonObject
$this->location = 'Location'; $this->location = 'Location';
$this->transparency = 1; // 1 means opaque $this->transparency = 1; // 1 means opaque
$this->priority = 1; $this->priority = 1;
$this->note = "This is a 'public' note"; //$this->note_public = "This is a 'public' note.";
$this->note_public = "This is a 'public' note.";
$this->note_private = "This is a 'private' note."; $this->note_private = "This is a 'private' note.";
$this->userownerid = $user->id; $this->userownerid = $user->id;

View File

@ -62,11 +62,12 @@ if ($id > 0)
} }
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -382,7 +382,6 @@ if ($resql)
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">'; print '<input type="hidden" name="type" value="'.$type.'">';
$nav = ''; $nav = '';
@ -443,7 +442,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
} }
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit); print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = ''; $moreforfilter = '';
@ -554,8 +553,7 @@ if ($resql)
$actionstatic->type_picto = $obj->type_picto; $actionstatic->type_picto = $obj->type_picto;
$actionstatic->label = $obj->label; $actionstatic->label = $obj->label;
$actionstatic->location = $obj->location; $actionstatic->location = $obj->location;
$actionstatic->note = dol_htmlentitiesbr($obj->note); // deprecated $actionstatic->note_private = dol_htmlentitiesbr($obj->note);
$actionstatic->note_public = dol_htmlentitiesbr($obj->note);
$actionstatic->fetchResources(); $actionstatic->fetchResources();
@ -614,8 +612,8 @@ if ($resql)
// Description // Description
if (!empty($arrayfields['a.note']['checked'])) { if (!empty($arrayfields['a.note']['checked'])) {
print '<td class="tdoverflowonsmartphone">'; print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note, 0)); $text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 0));
print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note); print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note_private);
print '</td>'; print '</td>';
} }

View File

@ -65,11 +65,12 @@ $result = restrictedArea($user, 'societe', $id, '&societe');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$mode = GETPOST("mode"); $mode = GETPOST("mode");
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -171,7 +171,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("ProposalsDraft").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="3">'.$langs->trans("ProposalsDraft").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=0"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num > 0) if ($num > 0)
{ {
@ -755,7 +755,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>'; print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=1"><span class="badge">'.$num.'</span></th></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)
@ -863,7 +863,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>'; print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=1"><span class="badge">'.$num.'</span></th></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)

View File

@ -345,6 +345,7 @@ if (empty($reshook))
if (!empty($conf->global->MAILING_DELAY)) if (!empty($conf->global->MAILING_DELAY))
{ {
dol_syslog("Wait a delay of MAILING_DELAY=".$conf->global->MAILING_DELAY);
sleep($conf->global->MAILING_DELAY); sleep($conf->global->MAILING_DELAY);
} }

View File

@ -34,6 +34,7 @@ $result = restrictedArea($user, 'mailing');
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$optioncss = GETPOST('optioncss', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page; $offset = $limit * $page;
@ -129,8 +130,6 @@ if ($filteremail)
if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')"; if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')";
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "m.rowid"; if (!$sortfield) $sortfield = "m.rowid";
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
} }
else else
{ {
@ -141,15 +140,30 @@ else
if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')"; if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')";
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "m.rowid"; if (!$sortfield) $sortfield = "m.rowid";
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
} }
//print $sql; $sql .= $db->order($sortfield, $sortorder);
$result = $db->query($sql);
if ($result) $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{ {
$num = $db->num_rows($result); $resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
$offset = 0;
}
}
$sql .= $db->plimit($limit + 1, $offset);
//print $sql;
dol_syslog("comm/mailing/list.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$title = $langs->trans("ListOfEMailings"); $title = $langs->trans("ListOfEMailings");
if ($filteremail) $title .= ' ('.$langs->trans("SentTo", $filteremail).')'; if ($filteremail) $title .= ' ('.$langs->trans("SentTo", $filteremail).')';
@ -163,17 +177,18 @@ if ($result)
$i = 0; $i = 0;
$param = "&search_all=".urlencode($search_all); $param = "&search_all=".urlencode($search_all);
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($filteremail) $param .= '&filteremail='.urlencode($filteremail); if ($filteremail) $param .= '&filteremail='.urlencode($filteremail);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, '', 'generic', 0, $newcardbutton); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = ''; $moreforfilter = '';
@ -214,12 +229,12 @@ if ($result)
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($resql);
$email->id = $obj->rowid; $email->id = $obj->rowid;
$email->ref = $obj->rowid; $email->ref = $obj->rowid;
print "<tr>"; print '<tr class="oddeven">';
print '<td>'; print '<td>';
print $email->getNomUrl(1); print $email->getNomUrl(1);
@ -280,7 +295,8 @@ if ($result)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
$db->free($result);
$db->free($resql);
} }
else else
{ {

View File

@ -112,8 +112,9 @@ $hookmanager->initHooks(array('propalcard', 'globalcard'));
$usercanread = $user->rights->propal->lire; $usercanread = $user->rights->propal->lire;
$usercancreate = $user->rights->propal->creer; $usercancreate = $user->rights->propal->creer;
$usercanclose = $user->rights->propal->cloturer;
$usercandelete = $user->rights->propal->supprimer; $usercandelete = $user->rights->propal->supprimer;
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->close)));
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate))); $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate)));
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send);
@ -510,7 +511,7 @@ if (empty($reshook))
} }
// Extrafields // Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals(); $lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options; $array_options = $lines[$i]->array_options;
} }
@ -1512,7 +1513,6 @@ if ($action == 'create')
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0); $projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
$ref_client = (!empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_client = (!empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (!empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
$soc = $objectsrc->thirdparty; $soc = $objectsrc->thirdparty;
@ -2498,12 +2498,14 @@ if ($action == 'create')
} }
// Send // Send
if (empty($user->socid)) {
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) {
if ($usercansend) { if ($usercansend) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
} else } else
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('SendMail').'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('SendMail').'</a>';
} }
}
// Create a sale order // Create a sale order
if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) {

View File

@ -258,7 +258,6 @@ class Propal extends CommonObject
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20),
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22), 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40),
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>45), // deprecated
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>23), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>23),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>24), 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>24),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
@ -1253,8 +1252,6 @@ class Propal extends CommonObject
// Actions on extra fields // Actions on extra fields
if (!$error) if (!$error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -1262,7 +1259,6 @@ class Propal extends CommonObject
$error++; $error++;
} }
} }
}
if (!$error && !$notrigger) if (!$error && !$notrigger)
{ {
@ -1684,7 +1680,7 @@ class Propal extends CommonObject
$error++; $this->errors[] = "Error ".$this->db->lasterror(); $error++; $this->errors[] = "Error ".$this->db->lasterror();
} }
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -3003,8 +2999,11 @@ class Propal extends CommonObject
if (!$error) if (!$error)
{ {
$main = MAIN_DB_PREFIX . 'propaldet';
$ef = $main . "_extrafields";
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = " . $this->id . ")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sqlef) && $this->db->query($sql))
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
@ -3053,8 +3052,6 @@ class Propal extends CommonObject
// Removed extrafields // Removed extrafields
if (!$error) if (!$error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
if ($result < 0) if ($result < 0)
@ -3064,7 +3061,6 @@ class Propal extends CommonObject
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
} }
} }
}
if (!$error) if (!$error)
{ {
@ -3404,8 +3400,8 @@ class Propal extends CommonObject
$response->warning_delay = $delay_warning / 60 / 60 / 24; $response->warning_delay = $delay_warning / 60 / 60 / 24;
$response->label = $label; $response->label = $label;
$response->labelShort = $labelShort; $response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals'; $response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc'; $response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->img = img_object('', "propal"); $response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.
@ -3659,7 +3655,7 @@ class Propal extends CommonObject
if ($user->rights->propal->lire) if ($user->rights->propal->lire)
{ {
$label = '<u>'.$langs->trans("ShowPropal").'</u>'; $label = '<u>'.$langs->trans("Proposal").'</u>';
if (!empty($this->ref)) if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client)) if (!empty($this->ref_client))
@ -3670,6 +3666,11 @@ class Propal extends CommonObject
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc)) if (!empty($this->total_ttc))
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
if ($option == '') { if ($option == '') {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params;
} }
@ -3697,7 +3698,7 @@ class Propal extends CommonObject
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowPropal"); $label = $langs->trans("Proposal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
@ -4148,7 +4149,7 @@ class PropaleLigne extends CommonObjectLine
{ {
$this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet'); $this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet');
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$this->id = $this->rowid; $this->id = $this->rowid;
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
@ -4200,7 +4201,7 @@ class PropaleLigne extends CommonObjectLine
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// Remove extrafields // Remove extrafields
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used if (!$error)
{ {
$this->id = $this->rowid; $this->id = $this->rowid;
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
@ -4330,7 +4331,7 @@ class PropaleLigne extends CommonObjectLine
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$this->id = $this->rowid; $this->id = $this->rowid;
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();

View File

@ -53,11 +53,12 @@ if (! empty($user->socid))
$result = restrictedArea($user, 'propal', $id); $result = restrictedArea($user, 'propal', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -195,7 +195,7 @@ if (!empty($conf->propal->enabled))
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
$langs->load("propal"); $langs->load("propal");
print '<td colspan="2">'.$langs->trans("DraftPropals").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="2">'.$langs->trans("DraftPropals").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=0"><span class="badge">'.$num.'</span></a></td></tr>';
$i = 0; $i = 0;
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
@ -345,7 +345,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>'; print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=1"><span class="badge">'.$num.'</span></a></td></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)
@ -434,7 +434,7 @@ if (! empty($conf->propal->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=1"><span class="badge">'.$num.'</span></a></td></tr>';
if ($num) if ($num)
{ {
@ -507,7 +507,7 @@ if (! empty($conf->propal->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=2"><span class="badge">'.$num.'</span></a></td></tr>';
if ($num) if ($num)
{ {

View File

@ -92,7 +92,7 @@ $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_btn = GETPOST('button_search', 'alpha'); $search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha');
$viewstatut = GETPOST('viewstatut', 'alpha'); $search_status = GETPOST('search_status', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
$object_statut = GETPOST('search_statut', 'alpha'); $object_statut = GETPOST('search_statut', 'alpha');
@ -143,6 +143,8 @@ $fieldstosearchall = array(
'pd.description'=>'Description', 'pd.description'=>'Description',
's.nom'=>"ThirdParty", 's.nom'=>"ThirdParty",
's.name_alias'=>"AliasNameShort", 's.name_alias'=>"AliasNameShort",
's.zip'=>"Zip",
's.town'=>"Town",
'p.note_public'=>'NotePublic', 'p.note_public'=>'NotePublic',
); );
if (empty($user->socid)) $fieldstosearchall["p.note_private"] = "NotePrivate"; if (empty($user->socid)) $fieldstosearchall["p.note_private"] = "NotePrivate";
@ -241,13 +243,13 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_datedelivery_start = ''; $search_datedelivery_start = '';
$search_datedelivery_end = ''; $search_datedelivery_end = '';
$search_availability = ''; $search_availability = '';
$viewstatut = ''; $search_status = '';
$object_statut = ''; $object_statut = '';
$toselect = ''; $toselect = '';
$search_array_options = array(); $search_array_options = array();
$search_categ_cus = 0; $search_categ_cus = 0;
} }
if ($object_statut != '') $viewstatut = $object_statut; if ($object_statut != '') $search_status = $object_statut;
if (empty($reshook)) if (empty($reshook))
{ {
@ -285,7 +287,7 @@ $sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " ava.rowid as availability,"; $sql .= " ava.rowid as availability,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,'; $sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql .= ' p.note_public, p.note_private,'; $sql .= ' p.note_public, p.note_private,';
@ -357,9 +359,9 @@ if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category); if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category);
if ($socid > 0) $sql .= ' AND s.rowid = '.$socid; if ($socid > 0) $sql .= ' AND s.rowid = '.$socid;
if ($viewstatut != '' && $viewstatut != '-1') if ($search_status != '' && $search_status != '-1')
{ {
$sql .= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; $sql .= ' AND p.fk_statut IN ('.$db->escape($search_status).')';
} }
if ($search_date_start) $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'"; if ($search_date_start) $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'";
if ($search_date_end) $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; if ($search_date_end) $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
@ -434,7 +436,7 @@ if ($resql)
llxHeader('', $langs->trans('Proposal'), $help_url); llxHeader('', $langs->trans('Proposal'), $help_url);
$param = '&viewstatut='.urlencode($viewstatut); $param = '&search_status='.urlencode($search_status);
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
@ -492,10 +494,9 @@ if ($resql)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendPropalRef"; $topicmail = "SendPropalRef";
$modelmail = "proposal_send"; $modelmail = "proposal_send";
@ -571,40 +572,40 @@ if ($resql)
if (!empty($arrayfields['p.ref']['checked'])) if (!empty($arrayfields['p.ref']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">'; print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['p.ref_client']['checked'])) if (!empty($arrayfields['p.ref_client']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).'">'; print '<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['pr.ref']['checked'])) if (!empty($arrayfields['pr.ref']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">'; print '<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['pr.title']['checked'])) if (!empty($arrayfields['pr.title']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).'">'; print '<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['s.nom']['checked'])) if (!empty($arrayfields['s.nom']['checked']))
{ {
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">'; print '<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>'; if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.'"></td>';
if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.$search_zip.'"></td>'; if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.'"></td>';
// State // State
if (!empty($arrayfields['state.nom']['checked'])) if (!empty($arrayfields['state.nom']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">'; print '<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>'; print '</td>';
} }
// Country // Country
@ -617,7 +618,7 @@ if ($resql)
// Company type // Company type
if (!empty($arrayfields['typent.code']['checked'])) if (!empty($arrayfields['typent.code']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidth100onsmartphone" align="center">';
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 $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 ajax_combobox('search_type_thirdparty'); print ajax_combobox('search_type_thirdparty');
print '</td>'; print '</td>';
@ -667,7 +668,7 @@ if ($resql)
// Availability // Availability
if (!empty($arrayfields['ava.rowid']['checked'])) if (!empty($arrayfields['ava.rowid']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidth100onsmartphone center">';
$form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1);
print ajax_combobox('search_availability'); print ajax_combobox('search_availability');
print '</td>'; print '</td>';
@ -792,7 +793,7 @@ if ($resql)
if (!empty($arrayfields['p.fk_statut']['checked'])) if (!empty($arrayfields['p.fk_statut']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone right">'; print '<td class="liste_titre maxwidthonsmartphone right">';
$formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut'); $formpropal->selectProposalStatus($search_status, 1, 0, 1, 'customer', 'search_statut');
print '</td>'; print '</td>';
} }
// Action column // Action column
@ -861,6 +862,8 @@ if ($resql)
$objectstatic->ref_client = $obj->ref_client; $objectstatic->ref_client = $obj->ref_client;
$objectstatic->note_public = $obj->note_public; $objectstatic->note_public = $obj->note_public;
$objectstatic->note_private = $obj->note_private; $objectstatic->note_private = $obj->note_private;
$objectstatic->statut = $obj->status;
$objectstatic->status = $obj->status;
$companystatic->id = $obj->socid; $companystatic->id = $obj->socid;
$companystatic->name = $obj->name; $companystatic->name = $obj->name;
@ -899,16 +902,16 @@ if ($resql)
if (!empty($arrayfields['p.ref']['checked'])) if (!empty($arrayfields['p.ref']['checked']))
{ {
print '<td class="nowrap">'; print '<td class="nowraponall">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowraponall">';
print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1)); print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
print '</td>'; print '</td>';
// Warning // Warning
$warnornote = ''; $warnornote = '';
if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late")); if ($obj->status == Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late"));
if ($warnornote) if ($warnornote)
{ {
print '<td style="min-width: 20px" class="nobordernopadding nowrap">'; print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
@ -1231,7 +1234,7 @@ if ($resql)
// Status // Status
if (!empty($arrayfields['p.fk_statut']['checked'])) if (!empty($arrayfields['p.fk_statut']['checked']))
{ {
print '<td class="nowrap right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>'; print '<td class="nowrap right">'.$objectstatic->getLibStatut(5).'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Action column // Action column

View File

@ -100,8 +100,9 @@ $hookmanager->initHooks(array('ordercard', 'globalcard'));
$usercanread = $user->rights->commande->lire; $usercanread = $user->rights->commande->lire;
$usercancreate = $user->rights->commande->creer; $usercancreate = $user->rights->commande->creer;
$usercanclose = $user->rights->commande->cloturer;
$usercandelete = $user->rights->commande->supprimer; $usercandelete = $user->rights->commande->supprimer;
// Advanced permissions
$usercanclose = ((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->close)));
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate))); $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler))); $usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
@ -112,7 +113,7 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1){ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse; if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
} }
@ -383,7 +384,7 @@ if (empty($reshook))
} }
// Extrafields // Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
{ {
$lines[$i]->fetch_optionals(); $lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options; $array_options = $lines[$i]->array_options;
@ -1505,6 +1506,7 @@ if ($action == 'create' && $usercancreate)
if (!empty($origin) && !empty($originid)) { if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
$element = $subelement = $origin; $element = $subelement = $origin;
$regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
$element = $regs[1]; $element = $regs[1];
$subelement = $regs[2]; $subelement = $regs[2];
@ -2555,12 +2557,14 @@ if ($action == 'create' && $usercancreate)
} }
// Send // Send
if (empty($user->socid)) {
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
if ($usercansend) { if ($usercansend) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
} else } else
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>'; print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
} }
}
// Valid // Valid
if ($object->statut == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || !empty($conf->global->ORDER_ENABLE_NEGATIVE)) && $numlines > 0 && $usercanvalidate) if ($object->statut == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || !empty($conf->global->ORDER_ENABLE_NEGATIVE)) && $numlines > 0 && $usercanvalidate)

View File

@ -752,8 +752,10 @@ class Commande extends CommonOrder
$error = 0; $error = 0;
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) $usercanclose = ((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))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
if ($usercanclose)
{ {
$this->db->begin(); $this->db->begin();
@ -3340,7 +3342,7 @@ class Commande extends CommonOrder
$error++; $this->errors[] = "Error ".$this->db->lasterror(); $error++; $this->errors[] = "Error ".$this->db->lasterror();
} }
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -3407,6 +3409,19 @@ class Commande extends CommonOrder
$error++; $error++;
} }
if (!$error)
{
// Delete extrafields of order details
$main = MAIN_DB_PREFIX . 'commandedet';
$ef = $main . "_extrafields";
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")";
if (!$this->db->query($sql))
{
$error++;
$this->errors[] = $this->db->lasterror();
}
}
if (!$error) if (!$error)
{ {
// Delete order details // Delete order details
@ -3435,8 +3450,6 @@ class Commande extends CommonOrder
if (!$error) if (!$error)
{ {
// Remove extrafields // Remove extrafields
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
{
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
if ($result < 0) if ($result < 0)
{ {
@ -3444,7 +3457,6 @@ class Commande extends CommonOrder
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
} }
} }
}
if (!$error) if (!$error)
{ {
@ -3538,7 +3550,7 @@ class Commande extends CommonOrder
$response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24; $response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24;
$response->label = $langs->trans("OrdersToProcess"); $response->label = $langs->trans("OrdersToProcess");
$response->labelShort = $langs->trans("Opened"); $response->labelShort = $langs->trans("Opened");
$response->url = DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders'; $response->url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&mainmenu=commercial&leftmenu=orders';
$response->img = img_object('', "order"); $response->img = img_object('', "order");
$generic_commande = new Commande($this->db); $generic_commande = new Commande($this->db);
@ -3695,7 +3707,7 @@ class Commande extends CommonOrder
$label = ''; $label = '';
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("ShowOrder").'</u>'; $label = '<u>'.$langs->trans("Order").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client); $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) { if (!empty($this->total_ht)) {
@ -3707,6 +3719,9 @@ class Commande extends CommonOrder
if (!empty($this->total_ttc)) { if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
} }
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
} }
$linkclose = ''; $linkclose = '';
@ -3714,7 +3729,7 @@ class Commande extends CommonOrder
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowOrder"); $label = $langs->trans("Order");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
@ -4250,7 +4265,7 @@ class OrderLine extends CommonOrderLine
if ($resql) if ($resql)
{ {
// Remove extrafields // Remove extrafields
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used if (!$error)
{ {
$this->id = $this->rowid; $this->id = $this->rowid;
$result = $this->deleteExtraFields(); $result = $this->deleteExtraFields();
@ -4396,7 +4411,7 @@ class OrderLine extends CommonOrderLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet'); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet');
$this->rowid = $this->id; $this->rowid = $this->id;
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -4529,7 +4544,7 @@ class OrderLine extends CommonOrderLine
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (!$error)
{ {
$this->id = $this->rowid; $this->id = $this->rowid;
$result = $this->insertExtraFields(); $result = $this->insertExtraFields();

View File

@ -52,11 +52,12 @@ if ($user->socid)
$result = restrictedArea($user, 'commande', $id, ''); $result = restrictedArea($user, 'commande', $id, '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -168,6 +168,7 @@ if ($resql)
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>'; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
print "</table></div><br>"; print "</table></div><br>";
@ -353,7 +354,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num) if ($num)
{ {
@ -439,7 +440,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num) if ($num)
{ {

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