Merge pull request #29 from Dolibarr/develop

Update fork
This commit is contained in:
Damien BENOIT 2021-06-14 15:03:23 +02:00 committed by GitHub
commit 7c98ece1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
670 changed files with 8865 additions and 5761 deletions

127
ChangeLog
View File

@ -15,8 +15,7 @@ NEW: Add a performance center page with all information and advices related to t
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
NEW: All main menu entries are using the picto of the module
NEW: Add a copy to clipboard button on some fields
NEW: Add an example of scheduled job to send email reminder for unpayed invoices
NEW: Can make massive stock transfers from a CSV file.
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
@ -32,58 +31,39 @@ NEW: Add the column "Office phone" and "User mobile" in user list
NEW: Add the column "Price level"in thirdparty list
NEW: Add some company information in the dropdown login menu
NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: Add contact tag and bulk email status on the thirparty+contact create form
NEW: Add db fields note_public and note_private for ECM module
NEW: Manage deposit on supplier invoice (& somes ajustments)
NEW: Add contact tag and bulk email status on the thirdparty + contact create form
NEW: Support down payment on supplier invoice (& somes ajustments)
NEW: Add edit/delete action icons on categories list pages
NEW: Add hidden option to auto load input line extrafield into new lines
NEW: Add import profile to import BOM
NEW: Add last date of modification for website pages in the list of pages
NEW: Add link picto to the stock movement on the detail of production
NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members
NEW: Add bulk action Validate and Set to billed on order list.
NEW: add bulk action to set a commercial proposal to status "Refused"
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD and SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared.
NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: Add a new permission "Export website"
NEW: Add possibility to exports userGroups fields on user exports
NEW: Add price min and price min including tax into product export
NEW: Can search on lots or serials into the quick search bar
NEW: Add support for Friday as a non working day
NEW: Add a total in page of margin by user
NEW: Add the total of margin in invoice list
NEW: Can set a Warehouse on a Thirparty
NEW: auto notification with module Notification can use templated emails
NEW: Bank Entries : display user linked to a salary or a taxes
NEW: Can set a warehouse in a proposal
NEW: Can clone a cron job.
NEW: Can clone a cron job
NEW: Can create a lot from the list view (Look and feel standardization).
NEW: Can filter files in GED on status Shared/Not shared
NEW: Can filter on extrafields date on lists
NEW: Can filter on rowid in list of blocked logs.
NEW: Can hide columns "time consumed" on timesheet per week.
NEW: Can filter on rowid in list of blocked logs
NEW: Can hide columns "time consumed" on timesheet per week
NEW: Can set an employee on each social contribution
NEW: Can set a percentage when creating an invoice from another object
NEW: Can set if a ticket group is visible on public interface or not.
NEW: Can set order of execution of hooks
NEW: Can show the leave dates/holidays on the agenda view.
NEW: Can show the project ref into PDF documents
NEW: Can show the leave dates/holidays on the agenda view
NEW: Can toggle FCKeditor on public/private notes
NEW: Can use captcha on public page to create a ticket
NEW: Check update availability for externals modules using a button on module page
NEW: Choose lines to use while creating intervention card from origin
NEW: Column shippement method, payment mode, payment term in proposal and order list
NEW: Conf for default actiomm status
NEW: Columns shipment method, payment mode, payment term in proposal and order list
NEW: Conf for default actioncomm status
NEW: customer ref for product customer prices
NEW: date and user signature on proposal (Issue 16062)
NEW: date and user signature on proposal (Issue 16062) #16980
NEW: Dictionary for availability - Add a column position
NEW: TAKEPOS delayed payment in TakePOS
NEW: TAKEPOS display date range if exist in TakePOS
NEW: TAKEPOS display resiliate status in TakePOS for member
NEW: TAKEPOS Edit sales lines rights in TakePOS
NEW: TAKEPOS Option for Takepos to show the total price without tax
NEW: TAKEPOS More permission in TakePOS (Can edit added line, can modify once order sent to kitchen)
NEW: Can set a user related to a social contribution
NEW: ICS Direct debit can be set with a different value for each bank account
NEW: LDAP: usergroup search can be filtered
@ -94,37 +74,83 @@ NEW: Add bulk actions for Bank Transfer
NEW: Enhance the multicurrency rate editor
NEW: Multiselect ledger account code filter on book keeping list
NEW: Normalyse Type company field with ajax combobox
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
NEW: option to select membership type on the online payment page for membership subscription or renewal
NEW: preload product description on selection for customer propal/order/invoice
NEW: Add a ref in product customer price
NEW: Save old page with .old extension on disk when editing a website page
NEW: Search usergroups & resources
NEW: Set status of all variants when changing status of parent
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
NEW: Show picto of module into the list of dictionaries
NEW: Show the total of payment on the payment confirmation page
NEW: Stock movement list - Add more complete date field
NEW: Support color for types of event
NEW: The global setup for Mandatory fields can now be done on combo list too.
NEW: translate in "en_US" to complete PR 16980
NEW: Update the list of taxes available by default for France
NEW: Add captcha on public page to create a ticket
NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording
NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording
NEW: VAT report - Optimisation & collapse by rate
NEW: When we add contacts/users to a project, ask to also affect them on tasks.
NEW: When a doc file is shared, link is visible from the main page of doc.
NEW: Add option in Workflow module to set a shipment as closed.
NEW: Option to automatically create a login/user when a new subscription of a member is done online
NEW: #16378 More E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page
NEW: #17113 Can upload a favicon in website module
ECM/GED
NEW: Add db fields note_public and note_private for ECM module
NEW: Can filter files in GED on status Shared/Not shared
Members
NEW: #17292 default subscription amount by adherent type
NEW: Option to automatically create a login/user when a new subscription of a member is done online
NEW: option to select membership type on the online payment page for membership subscription or renewal
Projects/Tasks
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
NEW: can show the project ref into PDF documents
NEW: when we add contacts/users to a project, ask to also affect them on tasks
Proposals
NEW: add bulk action to set a commercial proposal to status "Refused"
NEW: can set a warehouse in a proposal
Shipment
NEW: add option in Workflow module to set a shipment as closed
TakePOS
NEW: delayed payment in TakePOS #14456?
NEW: display date range if exist in TakePOS
NEW: display resiliate status in TakePOS for member
NEW: edit sales lines rights in TakePOS
NEW: option for TakePOS to show the total price without tax
NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen)
Third-Parties
NEW: Can set a Warehouse on a Thirdparty
Tickets
NEW: can use captcha on public page to create a ticket #16347
NEW: can set if a ticket group is visible on public interface or not
Warehouse
NEW: Can make massive stock transfers from a CSV file
NEW: Stock movement list - Add more complete date field
NEW: Can set a Warehouse on a Thirdparty
NEW: can set a warehouse in a proposal
Website Module
NEW: #17113 Can upload a favicon in website module
NEW: add a new permission "Export website"
NEW: add last date of modification for website pages in the list of pages
NEW: Save old page with .old extension on disk when editing a website page
new Modules
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
NEW: start new experimental module Workstations management
NEW: start new experimental module Workstations Management
new Options
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: Add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field
For developers:
@ -146,8 +172,6 @@ NEW: Support sepa_debit in stripe paymentmethods list
NEW: Update doleditor.class.php for easily activate SCAYT
NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
NEW: Add triggers OBJECT_LINK_INSERT, OBJECT_LINK_UPDATE et OBJECT_LINK_DELETE in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
NEW: API Add option $includeifobjectisused to get a product
NEW: API Get the list of product ids only
NEW: Can set a target image in dolcropresize function.
NEW: Can set a label as placeholder for combo lists.
NEW: Add pagination on Get Products response API
@ -156,19 +180,24 @@ NEW: Extrafields of documents lines are inside the lines, not any more on separa
NEW: unit selection on object edit line
NEW: #13739 #17390 Product API route added to get product stock and product with or without variants
APIs
NEW: API Add option $includeifobjectisused to get a product
NEW: API Get the list of product ids only
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS.
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" for table lx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySql or MariaDB, you need at least version 5.1
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
@ -193,7 +222,7 @@ FIX: create sociales : keep values error form
FIX: dol_print_date for %a and %b with some timezone
FIX: email is not case sensitive
FIX: error for duplicate thirdparty found correctly returned by ws
FIX: Espadon PDF shippment model with long public note now wroking
FIX: Espadon PDF shippment model with long public note now working
FIX: esupplier order: error 500 when using packaging with product where it is not defined
FIX: Filter on debit/credit
FIX: Filter on supplier payment list

View File

@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENCE
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
## INSTALLER DOLIBARR
### Configuration simple
@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg
- Suivez les instructions de l'installateur
## METTRE A JOUR DOLIBARR
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
## CE QUI EST NOUVEAU
Voir fichier ChangeLog.
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
## CE QUE DOLIBARR PEUT FAIRE
@ -82,15 +87,17 @@ Voir fichier ChangeLog.
- Calendrier/Agenda partagé (avec export ical, vcal)
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
- Gestion de contrats de services
- Gestion de stock
- Gestion de stock et inventaires
- Gestion des expéditions
- Gestion des demandes de congès
- Gestion des notes de frais
- Gestion de recrutement
- GED (Gestion Electronique de Documents)
- EMailings de masse
- Réalisation de sondages
- Gestion d'adhérents
- Point de vente/Caisse enregistreuse
- …
- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions)
### Autres modules
@ -135,31 +142,36 @@ Voir fichier ChangeLog.
Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com).
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
- Dolibarr ne contient pas de module de Gestion de la paie.
- Dolibarr ne contient pas de module de génération de feuille de paie.
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
- Dolibarr n'embarque pas de Webmail intégré nativement.
- Dolibarr ne fait pas le café (pas encore).
## DOCUMENTATION
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
## CONTRIBUER
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
## CREDITS
Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs.
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
## ACTUALITES ET RESEAUX SOCIAUX
Suivez le projet Dolibarr project sur les réseaux francophones

View File

@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence.
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
@ -97,48 +97,80 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Main application/modules (all optional)
- Customers, Prospects (Leads) and/or Suppliers directory + Contacts
- Members/Membership management
- Products and/or Services catalog
- Commercial proposals management
- Customer & Supplier Orders management
- Invoices and payment management
- Shipping management
- Warehouse/Stock management
- Manufacturing Orders
- Bank accounts management
- Direct debit orders management (European SEPA)
- Accounting management
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
- Opportunities or Leads management
- Projects & Tasks management
- Ticket System
- Contracts management
- Interventions management
- Employee's leave requests management
- Expense reports
- Timesheets
- Electronic Document Management (EDM)
- Foundations members management
- Point of Sale (POS)
- …
- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
- Members/Membership/Foundation management
Product Management
- Products and/or Services catalog
- Stock / Warehouse management + Inventory
- Barcodes
- Batches / Lots / Serials
- Product Variants
- Bill of Materials (BOM)
- Manufacturing Orders
Customer/Sales Management
- Customers/Prospects + Contacts management
- Opportunities or Leads management
- Commercial proposals management
- Customer Orders management
- Contracts/Subscription management
- Interventions management
- Ticket System
- Shipping management
- Customer Invoices/Credit notes and payment management
- Point of Sale (POS)
Supplier/Purchase Management
- Suppliers/Vendors + Contacts
- Supplier (price) requests
- Purchase Orders management
- Delivery/Receiption
- Supplier Invoices/credit notes and payment management
- INCOTERMS
Finance / Accounting
- Invoices / Payments
- Bank accounts management
- Direct debit orders management (European SEPA)
- Accounting management
- Donations management
- Loan management
- Margins
- Reports
Collaboration
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
- Projects & Tasks management
- Ticket System
- Surveys
HR
- Employee's leave requests management
- Expense reports
- Recruitment management
- Timesheets
### Other application/modules
- Electronic Document Management (EDM)
- Bookmarks management
- Donations management
- Reporting
- Surveys
- Data export/import
- Barcodes support
- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- …
- Email-Collector
(around 100 modules available by default, 1000+ on the addon market place)
### Other general features

View File

@ -0,0 +1,74 @@
/*jshint esversion: 6 */
// create a particular contact by name
const createContact = async (z, bundle) => {
const apiurl = bundle.authData.url + '/api/index.php/contacts';
const response = await z.request({
method: 'POST',
url: apiurl,
body: {
name: bundle.inputData.name,
name_alias: bundle.inputData.name_alias,
ref_ext: bundle.inputData.ref_ext,
ref_int: bundle.inputData.ref_int,
address: bundle.inputData.address,
zip: bundle.inputData.zip,
town: bundle.inputData.town,
country_code: bundle.inputData.country_code,
country_id: bundle.inputData.country_id,
country: bundle.inputData.country,
phone: bundle.inputData.phone,
email: bundle.inputData.email,
sens: 'fromzapier'
}
});
const result = z.JSON.parse(response.content);
// api returns an integer when ok, a json when ko
return result.response || {id: response};
};
module.exports = {
key: 'contact',
noun: 'Contact',
display: {
label: 'Create Contact',
description: 'Creates a contact.'
},
operation: {
inputFields: [
{key: 'name', required: true},
{key: 'name_alias', required: false},
{key: 'address', required: false},
{key: 'zip', required: false},
{key: 'town', required: false},
{key: 'email', required: false}
],
perform: createContact,
sample: {
id: 1,
name: 'DUPOND',
name_alias: 'DUPOND Ltd',
address: 'Rue des Canaries',
zip: '34090',
town: 'MONTPELLIER',
phone: '0123456789',
fax: '2345678901',
email: 'robot@domain.com'
},
outputFields: [
{key: 'id', type: "integer", label: 'ID'},
{key: 'name', label: 'Name'},
{key: 'name_alias', label: 'Name alias'},
{key: 'address', label: 'Address'},
{key: 'zip', label: 'Zip'},
{key: 'town', label: 'Town'},
{key: 'phone', label: 'Phone'},
{key: 'fax', label: 'Fax'},
{key: 'email', label: 'Email'}
]
}
};

View File

@ -0,0 +1,74 @@
/*jshint esversion: 6 */
// create a particular member by name
const createMember = async (z, bundle) => {
const apiurl = bundle.authData.url + '/api/index.php/members';
const response = await z.request({
method: 'POST',
url: apiurl,
body: {
name: bundle.inputData.name,
name_alias: bundle.inputData.name_alias,
ref_ext: bundle.inputData.ref_ext,
ref_int: bundle.inputData.ref_int,
address: bundle.inputData.address,
zip: bundle.inputData.zip,
town: bundle.inputData.town,
country_code: bundle.inputData.country_code,
country_id: bundle.inputData.country_id,
country: bundle.inputData.country,
phone: bundle.inputData.phone,
email: bundle.inputData.email,
sens: 'fromzapier'
}
});
const result = z.JSON.parse(response.content);
// api returns an integer when ok, a json when ko
return result.response || {id: response};
};
module.exports = {
key: 'member',
noun: 'Member',
display: {
label: 'Create Member',
description: 'Creates a member.'
},
operation: {
inputFields: [
{key: 'name', required: true},
{key: 'name_alias', required: false},
{key: 'address', required: false},
{key: 'zip', required: false},
{key: 'town', required: false},
{key: 'email', required: false}
],
perform: createMember,
sample: {
id: 1,
name: 'DUPOND',
name_alias: 'DUPOND Ltd',
address: 'Rue des Canaries',
zip: '34090',
town: 'MONTPELLIER',
phone: '0123456789',
fax: '2345678901',
email: 'robot@domain.com'
},
outputFields: [
{key: 'id', type: "integer", label: 'ID'},
{key: 'name', label: 'Name'},
{key: 'name_alias', label: 'Name alias'},
{key: 'address', label: 'Address'},
{key: 'zip', label: 'Zip'},
{key: 'town', label: 'Town'},
{key: 'phone', label: 'Phone'},
{key: 'fax', label: 'Fax'},
{key: 'email', label: 'Email'}
]
}
};

View File

@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => {
const response = await z.request({
method: 'POST',
url: apiurl,
body: JSON.stringify({
body: {
name: bundle.inputData.name,
name_alias: bundle.inputData.name_alias,
ref_ext: bundle.inputData.ref_ext,
@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => {
code_client: bundle.inputData.code_client,
code_fournisseur: bundle.inputData.code_fournisseur,
sens: 'fromzapier'
})
}
});
const result = z.JSON.parse(response.content);
// api returns an integer when ok, a json when ko

View File

@ -2,12 +2,18 @@
const triggerAction = require('./triggers/action');
const triggerOrder = require('./triggers/order');
const triggerThirdparty = require('./triggers/thirdparty');
const triggerContact = require('./triggers/contact');
const triggerTicket = require('./triggers/ticket');
const triggerUser = require('./triggers/user');
const triggerMember = require('./triggers/member');
const searchThirdparty = require('./searches/thirdparty');
const searchContact = require('./searches/contact');
const searchMember = require('./searches/member');
const createThirdparty = require('./creates/thirdparty');
const createContact = require('./creates/contact');
const createMember = require('./creates/member');
const {
config: authentication,
@ -62,18 +68,24 @@ const App = {
[triggerAction.key]: triggerAction,
[triggerOrder.key]: triggerOrder,
[triggerThirdparty.key]: triggerThirdparty,
[triggerContact.key]: triggerContact,
[triggerTicket.key]: triggerTicket,
[triggerUser.key]: triggerUser,
[triggerMember.key]: triggerMember,
},
// If you want your searches to show up, you better include it here!
searches: {
[searchThirdparty.key]: searchThirdparty,
[searchContact.key]: searchContact,
[searchMember.key]: searchMember,
},
// If you want your creates to show up, you better include it here!
creates: {
[createThirdparty.key]: createThirdparty,
[createContact.key]: createContact,
[createMember.key]: createMember,
}
};

View File

@ -1,6 +1,6 @@
{
"name": "dolibarr",
"version": "1.13.0",
"version": "1.14.0",
"description": "An app for connecting Dolibarr to the Zapier platform.",
"repository": "Dolibarr/dolibarr",
"homepage": "https://www.dolibarr.org/",
@ -11,11 +11,11 @@
"test": "mocha --recursive"
},
"engines": {
"node": "8.10.0",
"node": "14.0.0",
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "11.0.0"
"zapier-platform-core": "11.0.1"
},
"devDependencies": {
"mocha": "^5.2.0",

View File

@ -0,0 +1,95 @@
module.exports = {
key: 'contact',
// You'll want to provide some helpful display labels and descriptions
// for users. Zapier will put them into the UX.
noun: 'Contact',
display: {
label: 'Find a Contact',
description: 'Search for contact.'
},
// `operation` is where we make the call to your API to do the search
operation: {
// This search only has one search field. Your searches might have just one, or many
// search fields.
inputFields: [
{
key: 'lastname',
type: 'string',
label: 'Lastname',
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
},
{
key: 'email',
type: 'string',
label: 'Email',
helpText: 'Email to limit to the search to.'
}
],
perform: async (z, bundle) => {
const url = bundle.authData.url + '/api/index.php/contacts/';
// Put the search value in a query param. The details of how to build
// a search URL will depend on how your API works.
let filter = '';
if (bundle.inputData.lastname) {
filter = "t.lastname like \'%"+bundle.inputData.name+"%\'";
}
if (bundle.inputData.email) {
if (bundle.inputData.lastname) {
filter += " and ";
}
filter += "t.email like \'"+bundle.inputData.email+"\'";
}
const response = await z.request({
url: url,
// this parameter avoid throwing errors and let us manage them
skipThrowForStatus: true,
params: {
sqlfilters: filter
}
});
//z.console.log(response);
if (response.status != 200) {
return [];
}
return response.json;
},
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
// returned records, and have obviously dummy values that we can show to any user.
sample: {
id: 1,
createdAt: 1472069465,
name: 'DOE',
firstname: 'John',
authorId: 1,
directions: '1. Boil Noodles\n2.Serve with sauce',
style: 'italian'
},
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
// field definitions. The result will be used to augment the sample.
// outputFields: () => { return []; }
// Alternatively, a static field definition should be provided, to specify labels for the fields
outputFields: [
{
key: 'id',
type: "integer",
label: 'ID'
},
{key: 'createdAt', type: "integer", label: 'Created At'},
{key: 'name', label: 'Name'},
{key: 'firstname', label: 'Firstname'},
{key: 'directions', label: 'Directions'},
{key: 'authorId', type: "integer", label: 'Author ID'},
{
key: 'style',
label: 'Style'
}
]
}
};

View File

@ -0,0 +1,88 @@
module.exports = {
key: 'member',
// You'll want to provide some helpful display labels and descriptions
// for users. Zapier will put them into the UX.
noun: 'Member',
display: {
label: 'Find a Member',
description: 'Search for member.'
},
// `operation` is where we make the call to your API to do the search
operation: {
// This search only has one search field. Your searches might have just one, or many
// search fields.
inputFields: [
{
key: 'lastname',
type: 'string',
label: 'Lastname',
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
},
{
key: 'email',
type: 'string',
label: 'Email',
helpText: 'Email to limit to the search to.'
}
],
perform: async (z, bundle) => {
const url = bundle.authData.url + '/api/index.php/members/';
// Put the search value in a query param. The details of how to build
// a search URL will depend on how your API works.
let filter = '';
if (bundle.inputData.lastname) {
filter = "t.lastname like \'%" + bundle.inputData.name + "%\'";
}
if (bundle.inputData.email) {
if (bundle.inputData.lastname) {
filter += " and ";
}
filter += "t.email like \'" + bundle.inputData.email + "\'";
}
const response = await z.request({
url: url,
// this parameter avoid throwing errors and let us manage them
skipThrowForStatus: true,
params: {
sqlfilters: filter
}
});
//z.console.log(response);
if (response.status != 200) {
return [];
}
return response.json;
},
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
// returned records, and have obviously dummy values that we can show to any user.
sample: {
id: 1,
createdAt: 1472069465,
name: 'DOE',
firstname: 'John',
authorId: 1,
},
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
// field definitions. The result will be used to augment the sample.
// outputFields: () => { return []; }
// Alternatively, a static field definition should be provided, to specify labels for the fields
outputFields: [
{
key: 'id',
type: "integer",
label: 'ID'
},
{ key: 'createdAt', type: "integer", label: 'Created At' },
{ key: 'name', label: 'Name' },
{ key: 'firstname', label: 'Firstname' },
{ key: 'authorId', type: "integer", label: 'Author ID' },
]
}
};

View File

@ -19,21 +19,43 @@ module.exports = {
type: 'string',
label: 'Name',
helpText: 'Name to limit to the search to (i.e. The company or %company%).'
},
{
key: 'email',
type: 'string',
label: 'Email',
helpText: 'Email to limit to the search to.'
}
],
perform: (z, bundle) => {
perform: async (z, bundle) => {
const url = bundle.authData.url + '/api/index.php/thirdparties/';
// Put the search value in a query param. The details of how to build
// a search URL will depend on how your API works.
const options = {
params: {
sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'"
let filter = '';
if (bundle.inputData.name) {
filter = "t.nom like \'%"+bundle.inputData.name+"%\'";
}
if (bundle.inputData.email) {
if (bundle.inputData.name) {
filter += " and ";
}
};
return z.request(url, options).then(response => JSON.parse(response.content));
filter += "t.email like \'"+bundle.inputData.email+"\'";
}
const response = await z.request({
url: url,
// this parameter avoid throwing errors and let us manage them
skipThrowForStatus: true,
params: {
sqlfilters: filter
}
});
//z.console.log(response);
if (response.status != 200) {
return [];
}
return response.json;
},
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example

View File

@ -0,0 +1,171 @@
const subscribeHook = (z, bundle) => {
// `z.console.log()` is similar to `console.log()`.
z.console.log('suscribing hook!');
// bundle.targetUrl has the Hook URL this app should call when an action is created.
const data = {
url: bundle.targetUrl,
event: bundle.event,
module: 'contact',
action: bundle.inputData.action
};
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
// You can build requests and our client will helpfully inject all the variables
// you need to complete. You can also register middleware to control this.
const options = {
url: url,
method: 'POST',
body: data,
};
// You may return a promise or a normal data structure from any perform method.
return z.request(options).then((response) => JSON.parse(response.content));
};
const unsubscribeHook = (z, bundle) => {
// bundle.subscribeData contains the parsed response JSON from the subscribe
// request made initially.
z.console.log('unsuscribing hook!');
// You can build requests and our client will helpfully inject all the variables
// you need to complete. You can also register middleware to control this.
const options = {
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
method: 'DELETE',
};
// You may return a promise or a normal data structure from any perform method.
return z.request(options).then((response) => JSON.parse(response.content));
};
const getContact = (z, bundle) => {
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
// test poll) and also a .querystring property with the URL's query string.
const contact = {
id: bundle.cleanedRequest.id,
name: bundle.cleanedRequest.name,
name_alias: bundle.cleanedRequest.name_alias,
firstname: bundle.cleanedRequest.firstname,
address: bundle.cleanedRequest.address,
zip: bundle.cleanedRequest.zip,
town: bundle.cleanedRequest.town,
email: bundle.cleanedRequest.email,
phone_pro: bundle.cleanedRequest.phone_pro,
phone_perso: bundle.cleanedRequest.phone_perso,
phone_mobile: bundle.cleanedRequest.phone_mobile,
authorId: bundle.cleanedRequest.authorId,
createdAt: bundle.cleanedRequest.createdAt,
action: bundle.cleanedRequest.action
};
return [contact];
};
const getFallbackRealContact = (z, bundle) => {
// For the test poll, you should get some real data, to aid the setup process.
const module = bundle.inputData.module;
const options = {
url: bundle.authData.url + '/api/index.php/contacts/0',
};
return z.request(options).then((response) => [JSON.parse(response.content)]);
};
// const getModulesChoices = (z/*, bundle*/) => {
// // For the test poll, you should get some real data, to aid the setup process.
// const options = {
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
// };
// return z.request(options).then((response) => JSON.parse(response.content));
// };
// const getModulesChoices = () => {
// return {
// orders: "Order",
// invoices: "Invoice",
// contacts: "Contact",
// contacts: "Contacts"
// };
// };
// const getActionsChoices = (z, bundle) => {
// // For the test poll, you should get some real data, to aid the setup process.
// const module = bundle.inputData.module;
// const options = {
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
// };
// return z.request(options).then((response) => JSON.parse(response.content));
// };
// We recommend writing your triggers separate like this and rolling them
// into the App definition at the end.
module.exports = {
key: 'contact',
// You'll want to provide some helpful display labels and descriptions
// for users. Zapier will put them into the UX.
noun: 'Contact',
display: {
label: 'New Contact',
description: 'Triggers when a new contact action is done in Dolibarr.'
},
// `operation` is where the business logic goes.
operation: {
// `inputFields` can define the fields a user could provide,
// we'll pass them in as `bundle.inputData` later.
inputFields: [
{
key: 'action',
required: true,
type: 'string',
helpText: 'Which action of contact this should trigger on.',
choices: {
create: "Create",
modify: "Modify",
validate: "Validate",
}
}
],
type: 'hook',
performSubscribe: subscribeHook,
performUnsubscribe: unsubscribeHook,
perform: getContact,
performList: getFallbackRealContact,
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
// returned records, and have obviously dummy values that we can show to any user.
sample: {
id: 1,
createdAt: 1472069465,
lastname: 'DOE',
firstname: 'John',
authorId: 1,
action: 'create'
},
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
// field definitions. The result will be used to augment the sample.
// outputFields: () => { return []; }
// Alternatively, a static field definition should be provided, to specify labels for the fields
outputFields: [
{key: 'id', type: "integer", label: 'ID'},
{key: 'createdAt', label: 'Created At'},
{key: 'lastname', label: 'Lastname'},
{key: 'firstname', label: 'Firstname'},
{key: 'phone', label: 'Phone pro'},
{key: 'phone_perso', label: 'Phone perso'},
{key: 'phone_mobile', label: 'Phone mobile'},
{key: 'authorId', type: "integer", label: 'Author ID'},
{key: 'action', label: 'Action'}
]
}
};

View File

@ -0,0 +1,171 @@
const subscribeHook = (z, bundle) => {
// `z.console.log()` is similar to `console.log()`.
z.console.log('suscribing hook!');
// bundle.targetUrl has the Hook URL this app should call when an action is created.
const data = {
url: bundle.targetUrl,
event: bundle.event,
module: 'member',
action: bundle.inputData.action
};
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
// You can build requests and our client will helpfully inject all the variables
// you need to complete. You can also register middleware to control this.
const options = {
url: url,
method: 'POST',
body: data,
};
// You may return a promise or a normal data structure from any perform method.
return z.request(options).then((response) => JSON.parse(response.content));
};
const unsubscribeHook = (z, bundle) => {
// bundle.subscribeData contains the parsed response JSON from the subscribe
// request made initially.
z.console.log('unsuscribing hook!');
// You can build requests and our client will helpfully inject all the variables
// you need to complete. You can also register middleware to control this.
const options = {
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
method: 'DELETE',
};
// You may return a promise or a normal data structure from any perform method.
return z.request(options).then((response) => JSON.parse(response.content));
};
const getMember = (z, bundle) => {
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
// test poll) and also a .querystring property with the URL's query string.
const member = {
id: bundle.cleanedRequest.id,
name: bundle.cleanedRequest.name,
name_alias: bundle.cleanedRequest.name_alias,
firstname: bundle.cleanedRequest.firstname,
address: bundle.cleanedRequest.address,
zip: bundle.cleanedRequest.zip,
town: bundle.cleanedRequest.town,
email: bundle.cleanedRequest.email,
phone_pro: bundle.cleanedRequest.phone_pro,
phone_perso: bundle.cleanedRequest.phone_perso,
phone_mobile: bundle.cleanedRequest.phone_mobile,
authorId: bundle.cleanedRequest.authorId,
createdAt: bundle.cleanedRequest.createdAt,
action: bundle.cleanedRequest.action
};
return [member];
};
const getFallbackRealMember = (z, bundle) => {
// For the test poll, you should get some real data, to aid the setup process.
const module = bundle.inputData.module;
const options = {
url: bundle.authData.url + '/api/index.php/members/0',
};
return z.request(options).then((response) => [JSON.parse(response.content)]);
};
// const getModulesChoices = (z/*, bundle*/) => {
// // For the test poll, you should get some real data, to aid the setup process.
// const options = {
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
// };
// return z.request(options).then((response) => JSON.parse(response.content));
// };
// const getModulesChoices = () => {
// return {
// orders: "Order",
// invoices: "Invoice",
// members: "Member",
// members: "Members"
// };
// };
// const getActionsChoices = (z, bundle) => {
// // For the test poll, you should get some real data, to aid the setup process.
// const module = bundle.inputData.module;
// const options = {
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
// };
// return z.request(options).then((response) => JSON.parse(response.content));
// };
// We recommend writing your triggers separate like this and rolling them
// into the App definition at the end.
module.exports = {
key: 'member',
// You'll want to provide some helpful display labels and descriptions
// for users. Zapier will put them into the UX.
noun: 'Member',
display: {
label: 'New Member',
description: 'Triggers when a new member action is done in Dolibarr.'
},
// `operation` is where the business logic goes.
operation: {
// `inputFields` can define the fields a user could provide,
// we'll pass them in as `bundle.inputData` later.
inputFields: [
{
key: 'action',
required: true,
type: 'string',
helpText: 'Which action of member this should trigger on.',
choices: {
create: "Create",
modify: "Modify",
validate: "Validate",
}
}
],
type: 'hook',
performSubscribe: subscribeHook,
performUnsubscribe: unsubscribeHook,
perform: getMember,
performList: getFallbackRealMember,
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
// returned records, and have obviously dummy values that we can show to any user.
sample: {
id: 1,
createdAt: 1472069465,
lastname: 'DOE',
firstname: 'John',
authorId: 1,
action: 'create'
},
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
// field definitions. The result will be used to augment the sample.
// outputFields: () => { return []; }
// Alternatively, a static field definition should be provided, to specify labels for the fields
outputFields: [
{key: 'id', type: "integer", label: 'ID'},
{key: 'createdAt', label: 'Created At'},
{key: 'lastname', label: 'Lastname'},
{key: 'firstname', label: 'Firstname'},
{key: 'phone', label: 'Phone pro'},
{key: 'phone_perso', label: 'Phone perso'},
{key: 'phone_mobile', label: 'Phone mobile'},
{key: 'authorId', type: "integer", label: 'Author ID'},
{key: 'action', label: 'Action'}
]
}
};

View File

@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => {
fournisseur: bundle.cleanedRequest.fournisseur,
code_client: bundle.cleanedRequest.code_client,
code_fournisseur: bundle.cleanedRequest.code_fournisseur,
idprof1: bundle.cleanedRequest.idprof1,
idprof2: bundle.cleanedRequest.idprof2,
idprof3: bundle.cleanedRequest.idprof3,
idprof4: bundle.cleanedRequest.idprof4,
idprof5: bundle.cleanedRequest.idprof5,
idprof6: bundle.cleanedRequest.idprof6,
authorId: bundle.cleanedRequest.authorId,
createdAt: bundle.cleanedRequest.createdAt,
action: bundle.cleanedRequest.action
@ -112,7 +118,7 @@ module.exports = {
noun: 'Thirdparty',
display: {
label: 'New Thirdparty',
description: 'Triggers when a new thirdpaty action is done in Dolibarr.'
description: 'Triggers when a new thirdparty action is done in Dolibarr.'
},
// `operation` is where the business logic goes.
@ -170,7 +176,13 @@ module.exports = {
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
{key: 'fournisseur', label: 'Supplier 0/1'},
{key: 'code_client', label: 'Customer code'},
{key: 'code_fournisseur', label: 'Supplier code'}
{key: 'code_fournisseur', label: 'Supplier code'},
{key: 'idprof1', label: 'Id Prof 1'},
{key: 'idprof2', label: 'Id Prof 2'},
{key: 'idprof3', label: 'Id Prof 3'},
{key: 'idprof4', label: 'Id Prof 4'},
{key: 'idprof5', label: 'Id Prof 5'},
{key: 'idprof6', label: 'Id Prof 6'}
]
}
};

View File

@ -5503,7 +5503,7 @@ CREATE TABLE `llx_product` (
LOCK TABLES `llx_product` WRITE;
/*!40000 ALTER TABLE `llx_product` DISABLE KEYS */;
INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PIDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0);
INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0);
/*!40000 ALTER TABLE `llx_product` ENABLE KEYS */;
UNLOCK TABLES;

View File

@ -609,10 +609,12 @@ if ($id) {
print '</tr>';
if ($num) {
$i = 0;
// Lines with values
while ($i < $num) {
$obj = $db->fetch_object($resql);
//print_r($obj);
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
@ -708,6 +710,7 @@ if ($id) {
print "</tr>\n";
}
$i++;
}
}

View File

@ -444,7 +444,7 @@ if ($search_country_id > 0) {
} else {
$sql .= " WHERE ";
}
$sql .= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)";
$sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)";
}
// If sort order is "country", we use country_code instead

View File

@ -68,7 +68,9 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = '';
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array('balancelist')); // Note that conf->hooks_modules contains array
$formaccounting = new FormAccounting($db);
$formother = new FormOther($db);
@ -155,16 +157,23 @@ if (empty($user->rights->accounting->mouvements->lire)) {
* Action
*/
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$show_subgroup = '';
$search_date_start = '';
$search_date_end = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_ledger_code = array();
$filter = array();
$parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$show_subgroup = '';
$search_date_start = '';
$search_date_end = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_ledger_code = array();
$filter = array();
}
}
/*
* View
@ -183,11 +192,11 @@ if ($action == 'export_csv') {
}
foreach ($object->lines as $line) {
print length_accountg($line->numero_compte).$sep;
print $object->get_compte_desc($line->numero_compte).$sep;
print price($line->debit).$sep;
print price($line->credit).$sep;
print price($line->debit - $line->credit).$sep;
print '"'.length_accountg($line->numero_compte).'"'.$sep;
print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
print '"'.price($line->debit).'"'.$sep;
print '"'.price($line->credit).'"'.$sep;
print '"'.price($line->debit - $line->credit).'"'.$sep;
print "\n";
}
@ -226,22 +235,28 @@ if ($action != 'export_csv') {
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#exportcsvbutton").click(function() {
event.preventDefault();
console.log("Set action to export_csv");
jQuery("#action").val("export_csv");
jQuery("#searchFormList").submit();
jQuery("#action").val("list");
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#exportcsvbutton").click(function() {
event.preventDefault();
console.log("Set action to export_csv");
jQuery("#action").val("export_csv");
jQuery("#searchFormList").submit();
jQuery("#action").val("list");
});
});
});
</script>';
</script>';
}
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
$selectedfields = '';
$moreforfilter = '';
$moreforfilter .= '<div class="divsearchfield">';
@ -283,12 +298,18 @@ if ($action != 'export_csv') {
print ' ';
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, '', 'accounts');
print '</td>';
print '<td class="liste_titre center">';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
print '</tr>'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
@ -298,8 +319,14 @@ if ($action != 'export_csv') {
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder);
print "</tr>\n";
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'."\n";
$total_debit = 0;
$total_credit = 0;
@ -374,14 +401,14 @@ if ($action != 'export_csv') {
print '<tr class="liste_total">';
print '<td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
} else {
print '<td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
}
print "<td></td>\n";
print '</tr>';
@ -416,14 +443,14 @@ if ($action != 'export_csv') {
}
}
// Debit
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
// Credit
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
} else {
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
}
print '<td class="center">';
print $link;
@ -441,12 +468,12 @@ if ($action != 'export_csv') {
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
} else {
print '<td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
}
print "<td></td>\n";
print '</tr>';
@ -456,8 +483,8 @@ if ($action != 'export_csv') {
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($total_debit).'</td>';
print '<td class="nowrap right">'.price($total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else {

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
@ -537,6 +537,22 @@ if ($action == 'create') {
print '</td>';
print '</tr>';
// Date document creation
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
print '<td>';
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Date document creation
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
print '<td>';
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Validate
/*
print '<tr>';
@ -619,7 +635,9 @@ if ($action == 'create') {
print_liste_field_titre("LabelOperation");
print_liste_field_titre("Debit", "", "", "", "", 'class="right"');
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
}
print "</tr>\n";
@ -662,21 +680,25 @@ if ($action == 'create') {
}
print '</td>';
print '<td>'.$line->label_operation.'</td>';
print '<td class="nowrap right">'.price($line->debit).'</td>';
print '<td class="nowrap right">'.price($line->credit).'</td>';
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
print '<td class="center">';
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
$actiontodelete = 'delete';
if ($mode == '_tmp' || $action != 'delmouv') {
$actiontodelete = 'confirm_delete';
if (empty($line->date_export) || empty($line->date_validation)) {
print '<td class="center">';
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
}
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
print img_delete();
if (empty($line->date_validation)) {
$actiontodelete = 'delete';
if ($mode == '_tmp' || $action != 'delmouv') {
$actiontodelete = 'confirm_delete';
}
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_delete();
}
print '</a>';
print '</td>';
@ -691,32 +713,33 @@ if ($action == 'create') {
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
}
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';
print '<td>';
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
// Also, it is not possible to use a value that is not in the list.
// Also, the label is not automatically filled when a value is selected.
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
} else {
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
if (empty($object->date_export) || empty($object->date_validation)) {
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';
print '<td>';
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
// Also, it is not possible to use a value that is not in the list.
// Also, the label is not automatically filled when a value is selected.
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
} else {
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
}
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
print '</tr>';
}
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
print '<td><input type="submit" class="button" name="save" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</table>';
}
print '</table>';
if ($mode == '_tmp' && $action == '') {
print '<br>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
*
@ -44,15 +44,47 @@ $action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int');
$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int');
$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int');
$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int');
$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int');
$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int');
$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int');
$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int');
$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int');
$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int');
$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int');
$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int');
$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear);
$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear);
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
$search_date_export_startday = GETPOST('search_date_export_startday', 'int');
$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
//var_dump($search_date_start);exit;
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
@ -157,6 +189,7 @@ $arrayfields = array(
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
@ -216,14 +249,46 @@ if (empty($reshook)) {
$search_mvt_label = '';
$search_direction = '';
$search_ledger_code = array();
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_date_start = '';
$search_date_end = '';
$search_date_creation_startyear = '';
$search_date_creation_startmonth = '';
$search_date_creation_startday = '';
$search_date_creation_endyear = '';
$search_date_creation_endmonth = '';
$search_date_creation_endday = '';
$search_date_creation_start = '';
$search_date_creation_end = '';
$search_date_modification_startyear = '';
$search_date_modification_startmonth = '';
$search_date_modification_startday = '';
$search_date_modification_endyear = '';
$search_date_modification_endmonth = '';
$search_date_modification_endday = '';
$search_date_modification_start = '';
$search_date_modification_end = '';
$search_date_export_startyear = '';
$search_date_export_startmonth = '';
$search_date_export_startday = '';
$search_date_export_endyear = '';
$search_date_export_endmonth = '';
$search_date_export_endday = '';
$search_date_export_start = '';
$search_date_export_end = '';
$search_date_validation_startyear = '';
$search_date_validation_startmonth = '';
$search_date_validation_startday = '';
$search_date_validation_endyear = '';
$search_date_validation_endmonth = '';
$search_date_validation_endday = '';
$search_date_validation_start = '';
$search_date_validation_end = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
@ -328,6 +393,16 @@ if (empty($reshook)) {
$tmp = dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$tmp = dol_getdate($search_date_validation_start);
$param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$tmp = dol_getdate($search_date_validation_end);
$param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit='.urlencode($search_debit);
@ -447,7 +522,8 @@ $sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t';
// Manage filter
$sqlwhere = array();
@ -471,6 +547,8 @@ if (count($filter) > 0) {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.reconciled_option') {
@ -508,10 +586,13 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$accountancyexport = new AccountancyExport($db);
$accountancyexport->export($object->lines, $formatexportset);
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
if (!empty($accountancyexport->errors)) {
setEventMessages('', $accountancyexport->errors, 'errors');
} else {
// Specify as export : update field date_export
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
// Specify as export : update field date_export or date_validated
$error = 0;
$db->begin();
@ -520,8 +601,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$now = dol_now();
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
$sql .= " SET date_export = '".$db->idate($now)."'";
$sql .= " , date_validated = '".$db->idate($now)."'";
$sql .= " SET";
if (!$notifiedexportdate && !$notifiedvalidationdate) {
$sql .= " date_export = '".$db->idate($now)."'";
$sql .= ", date_validated = '".$db->idate($now)."'";
} elseif (!$notifiedexportdate) {
$sql .= " date_export = '".$db->idate($now)."'";
} elseif (!$notifiedvalidationdate) {
$sql .= " date_validated = '".$db->idate($now)."'";
}
$sql .= " WHERE rowid = ".((int) $movement->id);
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
@ -535,11 +623,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
if (!$error) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
} else {
$error++;
$db->rollback();
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
}
}
exit;
@ -587,6 +675,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
llxHeader('', $title_page);
$formconfirm = '';
if ($action == 'export_file') {
$form_question = array();
@ -598,17 +688,15 @@ if ($action == 'export_file') {
);
$form_question['notifiedvalidationdate'] = array(
'name' => 'notifiedvalidationdate',
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
'type' => 'checkbox',
'label' => $langs->trans('NotifiedValidationDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
print $formconfirm;
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
}
if ($action == 'delmouv') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
print $formconfirm;
}
if ($action == 'delbookkeepingyear') {
$form_question = array();
@ -648,9 +736,11 @@ if ($action == 'delbookkeepingyear') {
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
print $formconfirm;
}
// Print form confirm
print $formconfirm;
//$param=''; param started before
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
@ -669,6 +759,8 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
$massactionbutton = '';
if (count($filter)) {
$buttonLabel = $langs->trans("ExportFilteredList");
} else {
@ -701,7 +793,7 @@ if (empty($reshook)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
}
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
@ -841,6 +933,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
print '</div>';
print '</td>';
}
// Date validation
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
// Action column
print '<td class="liste_titre center">';
$searchpicto = $form->showFilterButtons();
@ -892,6 +995,9 @@ if (!empty($arrayfields['t.tms']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($arrayfields['t.date_validated']['checked'])) {
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";
@ -934,6 +1040,7 @@ while ($i < min($num, $limit)) {
$line->date_creation = $db->jdate($obj->date_creation);
$line->date_modification = $db->jdate($obj->date_modification);
$line->date_export = $db->jdate($obj->date_export);
$line->date_validation = $db->jdate($obj->date_validation);
$total_debit += $line->debit;
$total_credit += $line->credit;
@ -1067,7 +1174,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1079,7 +1186,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1126,12 +1233,22 @@ while ($i < min($num, $limit)) {
}
}
// Validated operation date
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) || empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda paddingleft marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}

View File

@ -55,7 +55,7 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_accountancy_code = GETPOST("search_accountancy_code");
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
@ -807,7 +807,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -819,7 +819,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -682,7 +682,7 @@ while ($i < min($num, $limit)) {
print "<tr>";
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 10).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account);
print $line->subledger_label.' : '.length_accounta($line->subledger_account);
} else {
// Should not happen: subledger account must be null or a non empty value
print '<span class="error">'.$langs->trans("Unknown");
@ -821,7 +821,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -833,7 +833,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -296,15 +296,15 @@ if ($resql) {
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
print '<td colspan="4"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
print '<td colspan="6"></td>';
print "</tr>\n";

View File

@ -293,15 +293,15 @@ if ($resql) {
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
print '<td colspan="6"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
print '<td colspan="4"></td>';
print "</tr>\n";

View File

@ -201,7 +201,7 @@ class AccountancyCategory // extends CommonObject
$sql .= "entity";
$sql .= ") VALUES (";
if ($this->rowid > 0) {
$sql .= " ".$this->rowid.",";
$sql .= " ".((int) $this->rowid).",";
}
$sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").",";
$sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").",";
@ -209,9 +209,9 @@ class AccountancyCategory // extends CommonObject
$sql .= " ".(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").",";
$sql .= " ".(!isset($this->category_type) ? 'NULL' : "'".$this->db->escape($this->category_type)."'").",";
$sql .= " ".(!isset($this->formula) ? 'NULL' : "'".$this->db->escape($this->formula)."'").",";
$sql .= " ".(!isset($this->position) ? 'NULL' : $this->db->escape($this->position)).",";
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : $this->db->escape($this->fk_country)).",";
$sql .= " ".(!isset($this->active) ? 'NULL' : $this->db->escape($this->active));
$sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).",";
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).",";
$sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active));
$sql .= ", ".$conf->entity;
$sql .= ")";
@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject
if ($id) {
$sql .= " WHERE t.rowid = ".((int) $id);
} else {
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid
if ($code) {
$sql .= " AND t.code = '".$this->db->escape($code)."'";
} elseif ($label) {
@ -675,7 +675,7 @@ class AccountancyCategory // extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
$sql .= " WHERE c.active = 1";
$sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
$sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)";
$sql .= " AND cat.rowid = t.fk_accounting_category";
$sql .= " AND t.entity = ".$conf->entity;
$sql .= " ORDER BY cat.position ASC";
@ -806,7 +806,7 @@ class AccountancyCategory // extends CommonObject
if ($categorytype >= 0) {
$sql .= " AND c.category_type = 1";
}
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
$sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)";
$sql .= " ORDER BY c.position ASC";
$resql = $this->db->query($sql);

View File

@ -561,9 +561,9 @@ class AccountancyExport
$Tab['contrepartie'] = str_repeat(' ', 8);
// Force date format : %d%m%y
if (!empty($data->date_echeance)) {
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // Format must be ddmmyy
if (!empty($data->date_lim_reglement)) {
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy
} else {
$Tab['date_echeance'] = '000000';
}
@ -660,9 +660,9 @@ class AccountancyExport
$Tab['code_stat'] = str_repeat(' ', 4);
if (!empty($data->date_echeance)) {
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
if (!empty($data->date_lim_reglement)) {
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y');
} else {
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
}

View File

@ -602,7 +602,7 @@ class AccountingAccount extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
$sql .= "SET ".$fieldtouse." = '0'";
$sql .= " WHERE rowid = ".$this->db->escape($id);
$sql .= " WHERE rowid = ".((int) $id);
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);
@ -640,7 +640,7 @@ class AccountingAccount extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account";
$sql .= " SET ".$fieldtouse." = '1'";
$sql .= " WHERE rowid = ".$this->db->escape($id);
$sql .= " WHERE rowid = ".((int) $id);
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);

View File

@ -294,7 +294,7 @@ class BookKeeping extends CommonObject
$sql = "SELECT count(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'";
$sql .= " AND fk_doc = ".$this->fk_doc;
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
$sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines
@ -312,7 +312,7 @@ class BookKeeping extends CommonObject
$sqlnum = "SELECT piece_num";
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank'
$sqlnum .= " AND fk_doc = ".$this->fk_doc;
$sqlnum .= " AND fk_doc = ".((int) $this->fk_doc);
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
// fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ...
$sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet);
@ -728,7 +728,9 @@ class BookKeeping extends CommonObject
$sql .= " t.code_journal,";
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation";
$sql .= " t.date_creation,";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
$sql .= ' WHERE 1 = 1';
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -769,6 +771,9 @@ class BookKeeping extends CommonObject
$this->journal_label = $obj->journal_label;
$this->piece_num = $obj->piece_num;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_export = $this->db->jdate($obj->date_export);
$this->date_validation = $this->db->jdate($obj->date_validated);
$this->date_validation = $this->db->jdate($obj->date_validation);
}
$this->db->free($resql);
@ -834,7 +839,8 @@ class BookKeeping extends CommonObject
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
// Manage filter
$sqlwhere = array();
if (count($filter) > 0) {
@ -853,6 +859,8 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.reconciled_option') {
@ -926,6 +934,8 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num;
$line->date_creation = $this->db->jdate($obj->date_creation);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@ -987,7 +997,8 @@ class BookKeeping extends CommonObject
$sql .= " t.date_creation,";
$sql .= " t.date_lim_reglement,";
$sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
// Manage filter
$sqlwhere = array();
@ -1009,6 +1020,8 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} else {
@ -1068,6 +1081,8 @@ class BookKeeping extends CommonObject
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
$line->date_modification = $this->db->jdate($obj->date_modification);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@ -1454,6 +1469,8 @@ class BookKeeping extends CommonObject
$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
}
$sql .= " AND entity IN (".getEntity('accountancy').")";
// Exclusion of validated entries at the time of deletion
$sql .= " AND date_validated IS NULL";
// TODO: In a future we must forbid deletion if record is inside a closed fiscal period.
@ -1603,7 +1620,8 @@ class BookKeeping extends CommonObject
{
global $conf;
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -1620,6 +1638,10 @@ class BookKeeping extends CommonObject
$this->doc_ref = $obj->doc_ref;
$this->doc_type = $obj->doc_type;
$this->date_creation = $obj->date_creation;
$this->date_modification = $obj->date_modification;
$this->date_export = $obj->date_export;
$this->date_validation = $obj->date_validated;
$this->date_validation = $obj->date_validation;
} else {
$this->error = "Error ".$this->db->lasterror();
dol_syslog(__METHOD__.$this->error, LOG_ERR);
@ -1675,7 +1697,8 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, doc_date, doc_type,";
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -1708,6 +1731,10 @@ class BookKeeping extends CommonObject
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num;
$line->date_creation = $obj->date_creation;
$line->date_modification = $obj->date_modification;
$line->date_export = $obj->date_export;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesmvt[] = $line;
}
@ -1735,7 +1762,8 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, doc_date, doc_type,";
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
$sql .= " date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
@ -1770,6 +1798,8 @@ class BookKeeping extends CommonObject
$line->sens = $obj->sens;
$line->code_journal = $obj->code_journal;
$line->piece_num = $obj->piece_num;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesexport[] = $line;
}
@ -2103,4 +2133,9 @@ class BookKeepingLine
* @var integer|string $date_export;
*/
public $date_export;
/**
* @var integer|string $date_validation;
*/
public $date_validation;
}

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$socid = GETPOST('socid', 'int');

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
// Security check
if (empty($conf->accounting->enabled)) {
@ -319,10 +319,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -405,10 +405,10 @@ if ($resql) {
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -472,9 +472,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -533,9 +533,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price(price2num($row[$i])).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($row[$i])).'</td>';
}
print '<td class="nowrap right"><b>'.price(price2num($row[13])).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price(price2num($row[13])).'</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -492,7 +492,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -687,7 +687,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->total_ht);
print '</td>';

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) {
@ -210,10 +210,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -290,10 +290,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -352,9 +352,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}

View File

@ -388,7 +388,7 @@ if ($result) {
print '</td>';
// Amount without taxes
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
// Vat rate
print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -434,7 +434,7 @@ if ($result) {
print '</td>';
// Amount without taxes
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->price);
print '</td>';

View File

@ -61,7 +61,7 @@ if (empty($user->rights->compta->resultat->lire) && empty($user->rights->account
if (GETPOST('addbox')) {
// Add box (when submit is done from a form when ajax disabled)
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
$zone = GETPOST('areacode', 'aZ09');
$zone = GETPOST('areacode', 'int');
$userid = GETPOST('userid', 'int');
$boxorder = GETPOST('boxorder', 'aZ09');
$boxorder .= GETPOST('boxcombo', 'aZ09');

View File

@ -1108,8 +1108,8 @@ if (empty($action) || $action == 'view') {
print $reflabel;
print "</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -1222,8 +1222,8 @@ if (empty($action) || $action == 'view') {
print "</td>";
print "<td>".$reflabel."</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}
@ -1259,8 +1259,8 @@ if (empty($action) || $action == 'view') {
print "</td>";
print "<td>".$reflabel."</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}
@ -1320,7 +1320,7 @@ function getSourceDocRef($val, $typerecord)
if ($typerecord == 'payment') {
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]);
$ref = $langs->transnoentitiesnoconv("Invoice");
} elseif ($typerecord == 'payment_supplier') {
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';

View File

@ -610,8 +610,8 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -644,8 +644,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -680,8 +680,8 @@ if (empty($action) || $action == 'view') {
print '</td>';
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -911,8 +911,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -940,8 +940,8 @@ if (empty($action) || $action == 'view') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@ -977,8 +977,8 @@ if (empty($action) || $action == 'view') {
print "<td>";
print $companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -1005,8 +1005,8 @@ if (empty($action) || $action == 'view') {
print "<td>";
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT")." NPR (counterpart)</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -851,8 +851,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@ -880,8 +880,8 @@ if (empty($action) || $action == 'view') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -916,8 +916,8 @@ if (empty($action) || $action == 'view') {
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
// Security check
if (empty($conf->accounting->enabled)) {
@ -314,10 +314,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -393,10 +393,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -456,9 +456,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -497,7 +497,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -671,7 +671,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->total_ht);
print '</td>';

View File

@ -197,6 +197,8 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateall">';
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
@ -268,6 +270,7 @@ if ($conf->facture->enabled) {
}
print '</table>';
print '</div>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
@ -338,6 +341,7 @@ if ($resql) {
print load_fiche_titre($langs->trans("MembersDocModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -446,6 +450,8 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
print "<br>";
print dol_get_fiche_end();

View File

@ -172,6 +172,7 @@ print '<br>';
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -234,6 +235,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print "</td></tr>\n";
print '</table>';
print '</div>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
@ -262,7 +264,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercent" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');

View File

@ -68,7 +68,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
<tr>
<td><?php echo $langs->trans("Morphy"); ?></td>
<td colspan="3"><input name="morphy" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
<td colspan="3"><input name="morphy" type="text" class="minwidth200" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
</tr>
<tr>
@ -105,7 +105,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
<tr>
<td><?php echo $langs->trans("Email"); ?></td>
<td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
<td colspan="3"><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
</tr>
<tr>

View File

@ -77,7 +77,7 @@ echo $this->control->tpl['ajax_selectcountry'];
<tr>
<td><?php echo $langs->trans("Morphy"); ?></td>
<td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
<td colspan="3"><input name="poste" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
</tr>
<tr>
@ -114,7 +114,7 @@ echo $this->control->tpl['ajax_selectcountry'];
<tr>
<td><?php echo $langs->trans("Email"); ?></td>
<td><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
<td><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
</tr>
<tr>

View File

@ -6,7 +6,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2020 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1088,7 +1088,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$value['active']) {
break;
}
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="member_'.$key.'" size="40" value="'.(GETPOSTISSET('member_'.$key) ? GETPOST('member_'.$key, 'alpha') : $object->socialnetworks[$key]).'"></td></tr>';
$val = (GETPOSTISSET('member_'.$key) ? GETPOST('member_'.$key, 'alpha') : (empty($object->socialnetworks[$key]) ? '' : $object->socialnetworks[$key]));
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="member_'.$key.'" size="40" value="'.$val.'"></td></tr>';
}
}
@ -1907,7 +1908,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Reactivate
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) {
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
if ($user->rights->adherent->creer) {
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
} else {

View File

@ -260,9 +260,9 @@ class Adherent extends CommonObject
public $datefin;
// From member table
// Fields loaded by fetch_subscriptions()
// Fields loaded by fetch_subscriptions() from member table
public $first_subscription_date;
public $first_subscription_amount;
@ -277,6 +277,12 @@ class Adherent extends CommonObject
public $subscriptions = array();
// Fields loaded by fetchPartnerships() from partnership table
public $partnerships = array();
/**
* @var Adherent To contains a clone of this when we need to save old properties of object
*/
@ -296,15 +302,15 @@ class Adherent extends CommonObject
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30),
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35),
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30, 'showoncombobox'=>1),
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox'=>1),
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => -1, 'position' => 40),
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 250),
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55),
'morphy' => array('type' => 'varchar(3)', 'label' => 'MorPhy', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60),
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65),
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'showoncombobox'=>2),
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'position' => 70),
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
@ -592,8 +598,8 @@ class Adherent extends CommonObject
if ($this->user_id) {
// Add link to user
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
$sql .= " fk_member = ".$this->id;
$sql .= " WHERE rowid = ".$this->user_id;
$sql .= " fk_member = ".((int) $this->id);
$sql .= " WHERE rowid = ".((int) $this->user_id);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
@ -722,7 +728,7 @@ class Adherent extends CommonObject
if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) {
$sql2 = "SELECT libelle as label";
$sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql2 .= " WHERE rowid = ".$this->typeid;
$sql2 .= " WHERE rowid = ".((int) $this->typeid);
$resql2 = $this->db->query($sql2);
if ($resql2) {
while ($obj = $this->db->fetch_object($resql2)) {
@ -1439,11 +1445,12 @@ class Adherent extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to get member subscriptions data
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
* Function to get member subscriptions data:
* subscriptions,
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
*
* @return int <0 si KO, >0 si OK
* @return int <0 if KO, >0 if OK
*/
public function fetch_subscriptions()
{
@ -1475,7 +1482,7 @@ class Adherent extends CommonObject
$this->first_subscription_amount = $obj->subscription;
}
$this->last_subscription_date = $this->db->jdate($obj->datec);
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
$this->last_subscription_amount = $obj->subscription;
@ -1503,6 +1510,25 @@ class Adherent extends CommonObject
}
/**
* Function to get partnerships array
*
* @param string $mode 'member' or 'thirdparty'
* @return int <0 if KO, >0 if OK
*/
public function fetchPartnerships($mode)
{
global $langs;
require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php';
$this->partnerships[] = array();
return 1;
}
/**
* Insert subscription into database and eventually add links to banks, mailman, etc...
*
@ -1712,7 +1738,8 @@ class Adherent extends CommonObject
}
}
$invoice->socid = $this->fk_soc;
$invoice->date = $datesubscription;
//$invoice->date = $datesubscription;
$invoice->date = dol_now();
// Possibility to add external linked objects with hooks
$invoice->linked_objects['subscription'] = $subscriptionid;

View File

@ -362,7 +362,7 @@ class AdherentType extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
$sql .= "SET ";
$sql .= "statut = ".$this->status.",";
$sql .= "statut = ".((int) $this->status).",";
$sql .= "libelle = '".$this->db->escape($this->label)."',";
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";

View File

@ -228,12 +228,12 @@ class Members extends DolibarrApi
}
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
if (!empty($typeid)) {
$sql .= ' AND t.fk_adherent_type='.$typeid;
$sql .= ' AND t.fk_adherent_type='.((int) $typeid);
}
// Select members of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$this->db->escape($category);
$sql .= " AND c.fk_member = t.rowid ";
$sql .= " AND c.fk_categorie = ".((int) $category);
$sql .= " AND c.fk_member = t.rowid";
}
// Add sql filters
if ($sqlfilters) {

View File

@ -168,7 +168,7 @@ class Subscription extends CommonObject
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->dateh)."',";
$sql .= " '".$this->db->idate($this->datef)."',";
$sql .= " ".$this->amount.",";
$sql .= " ".((float) $this->amount).",";
$sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."')";
$resql = $this->db->query($sql);
@ -267,14 +267,14 @@ class Subscription extends CommonObject
}
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
$sql .= " fk_type = ".$this->fk_type.",";
$sql .= " fk_adherent = ".$this->fk_adherent.",";
$sql .= " fk_type = ".((int) $this->fk_type).",";
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
$sql .= " subscription = ".price2num($this->amount).",";
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
$sql .= " datef='".$this->db->idate($this->datef)."',";
$sql .= " datec='".$this->db->idate($this->datec)."',";
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
@ -341,7 +341,7 @@ class Subscription extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {

View File

@ -182,7 +182,7 @@ if ($id > 0) {
print dol_get_fiche_end();
$modulepart = 'member';
$permission = $user->rights->adherent->creer;
$permissiontoadd = $user->rights->adherent->creer;
$permtoedit = $user->rights->adherent->creer;
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';

View File

@ -52,7 +52,7 @@ $result = restrictedArea($user, 'adherent');
if (GETPOST('addbox')) {
// Add box (when submit is done from a form when ajax disabled)
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
$zone = GETPOST('areacode', 'aZ09');
$zone = GETPOST('areacode', 'int');
$userid = GETPOST('userid', 'int');
$boxorder = GETPOST('boxorder', 'aZ09');
$boxorder .= GETPOST('boxcombo', 'aZ09');

View File

@ -5,6 +5,7 @@
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -305,7 +306,12 @@ $memberstatic = new Adherent($db);
$now = dol_now();
$sql = "SELECT d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
if (!empty($search_categ) || !empty($catid)) {
$sql = "SELECT DISTINCT";
} else {
$sql = "SELECT";
}
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
@ -325,7 +331,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
$sql = preg_replace('/,\s*$/', '', $sql);
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
}
if (!empty($search_categ) || !empty($catid)) {
@ -336,7 +342,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)";
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE d.fk_adherent_type = t.rowid ";
$sql .= " WHERE d.fk_adherent_type = t.rowid";
if ($catid > 0) {
$sql .= " AND cm.fk_categorie = ".((int) $catid);
}
@ -467,28 +473,28 @@ llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacu
$titre = $langs->trans("MembersList");
if (GETPOSTISSET("search_status")) {
if ($search_status == '-1,1') {
if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED
$titre = $langs->trans("MembersListQualified");
}
if ($search_status == '-1') {
if ($search_status == Adherent::STATUS_DRAFT) {
$titre = $langs->trans("MembersListToValid");
}
if ($search_status == '1' && $filter == '') {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
$titre = $langs->trans("MembersValidated");
}
if ($search_status == '1' && $filter == 'withoutsubscription') {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
$titre = $langs->trans("MembersWithSubscriptionToReceive");
}
if ($search_status == '1' && $filter == 'uptodate') {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') {
$titre = $langs->trans("MembersListUpToDate");
}
if ($search_status == '1' && $filter == 'outofdate') {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
}
if ($search_status == '0') {
if ($search_status == Adherent::STATUS_RESILIATED) {
$titre = $langs->trans("MembersListResiliated");
}
if ($search_status == '-2') {
if ($search_status == Adherent::STATUS_EXCLUDED) {
$titre = $langs->trans("MembersListExcluded");
}
} elseif ($action == 'search') {
@ -565,7 +571,7 @@ if ($search_phone_mobile != '') {
if ($search_filter && $search_filter != '-1') {
$param .= "&search_filter=".urlencode($search_filter);
}
if ($search_status != "" && $search_status != '-1') {
if ($search_status != "" && $search_status != Adherent::STATUS_DRAFT) {
$param .= "&search_status=".urlencode($search_status);
}
if ($search_type > 0) {
@ -708,7 +714,7 @@ if (!empty($arrayfields['d.morphy']['checked'])) {
if (!empty($arrayfields['t.libelle']['checked'])) {
print '<td class="liste_titre">';
$listetype = $membertypestatic->liste_array();
print $form->selectarray("search_type", $listetype, $type, 1, 0, 0, '', 0, 32);
print $form->selectarray("search_type", $listetype, $search_type, 1, 0, 0, '', 0, 32);
print '</td>';
}
@ -790,10 +796,10 @@ if (!empty($arrayfields['d.tms']['checked'])) {
if (!empty($arrayfields['d.statut']['checked'])) {
print '<td class="liste_titre right maxwidthonsmartphone">';
$liststatus = array(
'-1'=>$langs->trans("Draft"),
'1'=>$langs->trans("Validated"),
'0'=>$langs->trans("Resiliated"),
'-2'=>$langs->trans("Excluded")
Adherent::STATUS_DRAFT => $langs->trans("Draft"),
Adherent::STATUS_VALIDATED => $langs->trans("Validated"),
Adherent::STATUS_RESILIATED => $langs->trans("MemberStatusResiliatedShort"),
Adherent::STATUS_EXCLUDED =>$langs->trans("MemberStatusExcludedShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -3);
print '</td>';
@ -891,6 +897,7 @@ print "</tr>\n";
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@ -947,7 +954,7 @@ while ($i < min($num, $limit)) {
}
// Firstname
if (!empty($arrayfields['d.firstname']['checked'])) {
print "<td>";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
print $obj->firstname;
print "</td>\n";
if (!$i) {
@ -956,7 +963,7 @@ while ($i < min($num, $limit)) {
}
// Lastname
if (!empty($arrayfields['d.lastname']['checked'])) {
print "<td>";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
print $obj->lastname;
print "</td>\n";
if (!$i) {
@ -976,13 +983,13 @@ while ($i < min($num, $limit)) {
}
// Company
if (!empty($arrayfields['d.company']['checked'])) {
print "<td>";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
print $companyname;
print "</td>\n";
}
// Login
if (!empty($arrayfields['d.login']['checked'])) {
print "<td>".$obj->login."</td>\n";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->login).'">'.$obj->login."</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1007,7 +1014,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['t.libelle']['checked'])) {
$membertypestatic->id = $obj->type_id;
$membertypestatic->label = $obj->type;
print '<td class="nowrap">';
print '<td class="nowraponall">';
print $membertypestatic->getNomUrl(1, 32);
print '</td>';
if (!$i) {
@ -1016,7 +1023,7 @@ while ($i < min($num, $limit)) {
}
// Address
if (!empty($arrayfields['d.address']['checked'])) {
print '<td class="nocellnopadd">';
print '<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).'">';
print $obj->address;
print '</td>';
if (!$i) {
@ -1096,7 +1103,7 @@ while ($i < min($num, $limit)) {
print '<td class="nowrap center">';
print dol_print_date($datefin, 'day');
if ($memberstatic->hasDelay()) {
$textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
$textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
}
print '</td>';

View File

@ -44,50 +44,20 @@
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
}
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--; $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
}
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
}
// Try main.inc.php using relative path
if (!$res && file_exists("../main.inc.php")) {
$res = @include "../main.inc.php";
}
if (!$res && file_exists("../../main.inc.php")) {
$res = @include "../../main.inc.php";
}
if (!$res && file_exists("../../../main.inc.php")) {
$res = @include "../../../main.inc.php";
}
if (!$res) {
die("Include of main fails");
}
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
dol_include_once('/partnership/class/partnership.class.php');
dol_include_once('/partnership/lib/partnership.lib.php');
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies","members","partnership", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$memberid = GETPOST('rowid', 'int');
$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
@ -97,9 +67,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
//$lineid = GETPOST('lineid', 'int');
$member = new Adherent($db);
if ($memberid > 0) {
$member->fetch($memberid);
$object = new Adherent($db);
if ($id > 0) {
$object->fetch($id);
}
// Initialize technical objects
@ -141,15 +111,15 @@ if (empty($conf->partnership->enabled)) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
if ($action == 'edit' && empty($permissiontoadd)) accessforbidden();
$partnershipid = $object->fetch(0, "", $memberid);
if (empty($action) && empty($partnershipid)) {
$action = 'create';
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) {
accessforbidden();
}
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) accessforbidden();
if (empty($memberid) && $object) {
$memberid = $object->fk_member;
}
// Security check
$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0);
/*
* Actions
*/
@ -166,102 +136,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
if (empty($reshook)) {
$error = 0;
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($memberid > 0 ? $memberid : '__ID__');
$triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record
if ($action == 'add' && $permissiontoread) {
$error = 0;
$db->begin();
$now = dol_now();
if (!$error) {
$old_start_date = $object->date_partnership_start;
$object->fk_member = $memberid;
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->date_creation = $now;
$object->fk_user_creat = $user->id;
$object->entity = $conf->entity;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) {
$error++;
}
}
if (!$error) {
$result = $object->create($user);
if ($result < 0) {
$error++;
if ($result == -4) {
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if ($error) {
$db->rollback();
$action = 'create';
} else {
$db->commit();
}
} elseif ($action == 'update' && $permissiontoread) {
$error = 0;
$db->begin();
$now = dol_now();
if (!$error) {
$object->oldcopy = clone $object;
$old_start_date = $object->date_partnership_start;
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->fk_user_creat = $user->id;
$object->fk_user_modif = $user->id;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) {
$error++;
}
}
if (!$error) {
$result = $object->update($user);
if ($result < 0) {
$error++;
if ($result == -4) {
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if ($error) {
$db->rollback();
$action = 'edit';
} else {
$db->commit();
}
} elseif ($action == 'confirm_close' || $action == 'update_extras') {
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
header("Location: ".$_SERVER['PHP_SELF']."?rowid=".$memberid);
exit;
}
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($id > 0 ? $id : '__ID__');
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
@ -271,10 +146,9 @@ $object->fields['fk_member']['visible'] = 0;
if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1;
$object->fields['note_public']['visible'] = 1;
/*
* View
*
* Put here all code to build page
*/
$form = new Form($db);
@ -285,11 +159,11 @@ llxHeader('', $title);
$form = new Form($db);
if ($memberid) {
if ($id > 0) {
$langs->load("members");
$member = new Adherent($db);
$result = $member->fetch($memberid);
$object = new Adherent($db);
$result = $object->fetch($id);
if (!empty($conf->notification->enabled)) {
$langs->load("mails");
@ -297,13 +171,13 @@ if ($memberid) {
$adht->fetch($object->typeid);
$head = member_prepare_head($member);
$head = member_prepare_head($object);
print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user');
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($member, 'rowid', $linkback);
dol_banner_tab($object, 'rowid', $linkback);
print '<div class="fichecenter">';
@ -312,21 +186,21 @@ if ($memberid) {
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$member->login.'&nbsp;</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
}
// Type
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$member->getmorphylib().'</td>';
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$member->company.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().'&nbsp;</td>';
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
print '</tr>';
print '</table>';
@ -334,194 +208,13 @@ if ($memberid) {
print '</div>';
print dol_get_fiche_end();
$params = '';
print '<br>';
} else {
dol_print_error('', 'Parameter rowid not defined');
}
// Part to create
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', '');
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="rowid" value="'.$memberid.'">';
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
}
if ($backtopageforcancel) {
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
}
print dol_get_fiche_head(array(), '');
print '<table class="border centpercent tableforfieldcreate">'."\n";
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
print '</table>'."\n";
print dol_get_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Validate")).'">';
print '&nbsp; ';
// print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
print '</div>';
print '</form>';
}
// Part to edit record
if (($partnershipid || $ref) && $action == 'edit') {
print load_fiche_titre($langs->trans("Partnership"), '', '');
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$memberid.'">';
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
}
if ($backtopageforcancel) {
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
}
print dol_get_fiche_head();
print '<table class="border centpercent tableforfieldedit">'."\n";
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
print '</table>';
print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
}
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), '', '');
$res = $object->fetch_optionals();
// $head = partnershipPrepareHead($object);
// print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto);
$linkback = '';
dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref');
$formconfirm = '';
// Close confirmation
if ($action == 'close') {
// Create an array for form
$formquestion = array();
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1);
}
// Reopon confirmation
if ($action == 'reopen') {
// Create an array for form
$formquestion = array();
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1);
}
// Refuse confirmatio
if ($action == 'refuse') {
//Form to close proposal (signed or not)
$formquestion = array(
array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace)
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250);
}
// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
} elseif ($reshook > 0) {
$formconfirm = $hookmanager->resPrint;
}
// Print form confirm
print $formconfirm;
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/partnership/partnership_list.php', 1).'?restore_lastsearch_values=1'.(!empty($memberid) ? '&rowid='.$memberid : '').'">'.$langs->trans("BackToList").'</a>';
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_member']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// End of subscription date
$fadherent = new Adherent($db);
$fadherent->fetch($object->fk_member);
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
if ($fadherent->datefin) {
print dol_print_date($fadherent->datefin, 'day');
if ($fadherent->hasDelay()) {
print " ".img_warning($langs->trans("Late"));
}
} else {
if (!$adht->subscription) {
print $langs->trans("SubscriptionNotRecorded");
if ($fadherent->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
} else {
print $langs->trans("SubscriptionNotReceived");
if ($fadherent->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
}
}
print '</td></tr>';
// Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';
print '<div class="clearboth"></div>';
print dol_get_fiche_end();
// Buttons for actions
if ($action != 'presend') {
@ -533,24 +226,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
if (empty($reshook)) {
if ($object->status == $object::STATUS_DRAFT) {
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit', '', $permissiontoadd);
}
// Show
if ($permissiontoadd) {
print dolGetButtonAction($langs->trans('ShowPartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd);
}
// Cancel
if ($permissiontoadd) {
if ($object->status == $object::STATUS_ACCEPTED) {
print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
}
print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_member='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/adherents/partnership.php?id='.$object->id), '', $permissiontoadd);
}
}
print '</div>'."\n";
}
//$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
$morehtmlright = '';
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
$memberid = $object->id;
// TODO Replace this card with the list of all partnerships.
$object = new Partnership($db);
$partnershipid = $object->fetch(0, "", $memberid);
if ($partnershipid > 0) {
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_member']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// End of subscription date
$fadherent = new Adherent($db);
$fadherent->fetch($object->fk_member);
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
if ($fadherent->datefin) {
print dol_print_date($fadherent->datefin, 'day');
if ($fadherent->hasDelay()) {
print " ".img_warning($langs->trans("Late"));
}
} else {
if (!$adht->subscription) {
print $langs->trans("SubscriptionNotRecorded");
if ($fadherent->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
} else {
print $langs->trans("SubscriptionNotReceived");
if ($fadherent->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
}
}
print '</td></tr>';
print '</table>';
print '</div>';
}
}
// End of page

View File

@ -29,7 +29,7 @@ $graphwidth = 700;
$mapratio = 0.5;
$graphheight = round($graphwidth * $mapratio);
$mode = GETPOST('mode') ?GETPOST('mode') : '';
$mode = GETPOST('mode') ? GETPOST('mode') : '';
// Security check
@ -40,7 +40,7 @@ if ($user->socid > 0) {
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$startyear = $year - 2;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;
// Load translation files required by the page
@ -69,7 +69,7 @@ $sql .= " d.morphy as code";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut != -1"; // Not draft
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY d.morphy";
$foundphy = $foundmor = 0;
@ -104,7 +104,7 @@ $sql .= " d.morphy as code";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut >= 1"; // Active (not draft=-1, not resiliated=0)
$sql .= " AND d.statut >= 1"; // Active (not excluded=-2, not draft=-1, not resiliated=0)
$sql .= " GROUP BY d.morphy";
$foundphy = $foundmor = 0;

View File

@ -42,7 +42,7 @@ if ($user->socid > 0) {
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$startyear = $year - 2;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;
// Load translation files required by the page
@ -92,7 +92,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut != -1";
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY c.label, c.code";
//print $sql;
}
@ -110,7 +110,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut != -1";
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY co.label, co.code, c.nom";
//print $sql;
}
@ -127,7 +127,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut != -1";
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY co.label, co.code, r.nom"; //+
//print $sql;
}
@ -142,7 +142,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
$sql .= " AND d.statut != -1";
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY c.label, c.code, d.town";
//print $sql;
}

View File

@ -47,7 +47,7 @@ if ($user->socid > 0) {
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$startyear = $year - 2;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;
// Load translation files required by the page
@ -151,12 +151,14 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table class="border centpercent">';
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
print '<tr><td>'.$langs->trans("Member").'</td><td>';
print img_picto('', 'company', 'class="pictofixedwidth"');
print $form->select_company($id,'memberid','',1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("User").'</td><td>';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
print '</td></tr>';
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button small" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
@ -187,8 +189,8 @@ foreach ($data as $val) {
//print '</a>';
print '</td>';
print '<td class="right">0</td>';
print '<td class="right">0</td>';
print '<td class="right">0</td>';
print '<td class="right amount nowraponall">0</td>';
print '<td class="right amount nowraponall">0</td>';
print '</tr>';
}
print '<tr class="oddeven" height="24">';
@ -198,8 +200,8 @@ foreach ($data as $val) {
//print '</a>';
print '</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
print '</tr>';
$oldyear = $year;
}

View File

@ -477,6 +477,7 @@ print "</tr>\n";
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($result);
@ -527,7 +528,7 @@ while ($i < min($num, $limit)) {
// Lastname
if (!empty($arrayfields['d.lastname']['checked'])) {
print '<td>'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
print '<td class="tdoverflowmax150">'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -550,7 +551,7 @@ while ($i < min($num, $limit)) {
// Label
if (!empty($arrayfields['t.libelle']['checked'])) {
print '<td class="tdoverflowmax500" title="'.dol_escape_htmltag($obj->note).'">';
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note).'">';
print $obj->note;
print '</td>';
if (!$i) {

View File

@ -179,6 +179,7 @@ print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom');
print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -272,7 +273,9 @@ foreach ($dirmodels as $reldir) {
}
}
}
print "</table><br>\n";
print "</table>";
print "</div>";
print "<br>\n";
/*
@ -301,6 +304,7 @@ if ($resql) {
}
print '<div class="div-table-responsive-no-min">';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>'.$langs->trans("Name").'</td>';
@ -414,6 +418,7 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
print "<br>";
/*
@ -421,6 +426,8 @@ print "<br>";
*/
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -469,6 +476,7 @@ print "</td></tr>\n";
print '</form>';
print '</table>';
print '</div>';
print '<br>';

View File

@ -115,7 +115,7 @@ if ($action == 'add') {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
$sql .= "box_id, position, box_order, fk_user, entity";
$sql .= ") VALUES (";
$sql .= $boxid['value'].", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
$sql .= ((int) $boxid['value']).", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".((int) $fk_user).", ".$conf->entity;
$sql .= ")";
dol_syslog("boxes.php activate box", LOG_DEBUG);
@ -149,11 +149,6 @@ if ($action == 'delete') {
if (!empty($obj->box_id)) {
$db->begin();
// Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes)
// $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param";
// $sql.= " WHERE param LIKE 'MAIN_BOXES_%'";
// $resql = $db->query($sql);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes";
$sql .= " WHERE entity = ".$conf->entity;
$sql .= " AND box_id=".((int) $obj->box_id);
@ -184,6 +179,7 @@ if ($action == 'switch') {
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
}
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
dol_syslog($sql);
$resultupdatefrom = $db->query($sql);
@ -427,11 +423,11 @@ foreach ($boxactivated as $key => $box) {
$hasprevious = ($key != 0);
print '<td class="center">'.($key + 1).'</td>';
print '<td class="center">';
print ($hasnext ? '<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key + 1]->rowid.'">'.img_down().'</a>&nbsp;' : '');
print ($hasprevious ? '<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key - 1]->rowid.'">'.img_up().'</a>' : '');
print ($hasnext ? '<a class="reposition" href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key + 1]->rowid.'">'.img_down().'</a>&nbsp;' : '');
print ($hasprevious ? '<a class="reposition" href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key - 1]->rowid.'">'.img_up().'</a>' : '');
print '</td>';
print '<td class="center">';
print '<a href="boxes.php?rowid='.$box->rowid.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
print '<a class="reposition" href="boxes.php?rowid='.$box->rowid.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
print '</td>';
print '</tr>'."\n";

View File

@ -367,8 +367,8 @@ if ($resql) {
print '<div class="div-table-responsive-no-min">';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
@ -498,6 +498,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder")
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -584,6 +585,8 @@ if (empty($conf->facture->enabled)) {
}
print "</td></tr>";
print "</table>";
print '</div>';
print "</form>";
@ -594,6 +597,8 @@ print '<br>';
*/
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -704,6 +709,8 @@ if ($conf->stock->enabled) {
*/
print '</table>';
print '</div>';
print '<br>';
@ -712,6 +719,8 @@ print '<br>';
*/
print load_fiche_titre($langs->trans("Notifications"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -725,6 +734,7 @@ print '</td><td class="right">';
print "</td></tr>\n";
print '</table>';
print '</div>';
// End of page
llxFooter();

View File

@ -456,7 +456,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input size="50" class="flat" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
print '<tr class="oddeven">';

View File

@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionaries properties
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0, 43, 0);
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 43, 0, 25, 0);
// Name of SQL tables of dictionaries
$tabname = array();
@ -608,7 +608,7 @@ $tabcomplete = array(
'c_prospectcontactlevel'=>array('picto'=>'company'),
'c_stcommcontact'=>array('picto'=>'company'),
'c_product_nature'=>array('picto'=>'product'),
'c_productbatch_qcstatus'=>array('picto'=>'batch'),
'c_productbatch_qcstatus'=>array('picto'=>'lot'),
);
@ -970,7 +970,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
}
if (in_array('entity', $listfieldmodify)) {
$sql .= " AND entity = '".getEntity($tabname[$id])."'";
$sql .= " AND entity = ".((int) getEntity($tabname[$id], 0));
}
dol_syslog("actionmodify", LOG_DEBUG);
@ -2391,10 +2391,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
$transkey = '';
if (in_array($fieldlist[$field], array('label', 'libelle'))) { // For label
// Special case for labels
if ($tabname == MAIN_DB_PREFIX.'c_civility') {
if ($tabname == MAIN_DB_PREFIX.'c_civility' && !empty($obj->code)) {
$transkey = "Civility".strtoupper($obj->code);
}
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
if ($tabname == MAIN_DB_PREFIX.'c_payment_term' && !empty($obj->code)) {
$langs->load("bills");
$transkey = "PaymentConditionShort".strtoupper($obj->code);
}

View File

@ -99,7 +99,7 @@ foreach ($object->fields as $key => $val) {
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
if ($val['searchall']) {
if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
@ -549,6 +549,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
}
if (!isset($totalarray['val'])) {
$totalarray['val'] = array();
}
if (!isset($totalarray['val']['t.'.$key])) {
$totalarray['val']['t.'.$key] = 0;
}
$totalarray['val']['t.'.$key] += $object->$key;
}
}

View File

@ -449,7 +449,7 @@ print "</td></tr>\n";
print '<tr><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '<input size="50" class="flat" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
print "</td></tr>\n";
print '</table>';

View File

@ -455,7 +455,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '<input size="50" class="flat" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
print '</table>';

View File

@ -249,6 +249,7 @@ print dol_get_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoi
print load_fiche_titre($langs->trans("BillsNumberingModule"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -411,6 +412,7 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
/*
@ -439,6 +441,7 @@ if ($resql) {
dol_print_error($db);
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -558,6 +561,7 @@ foreach ($dirmodels as $reldir) {
}
}
print '</table>';
print '</div>';
if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
/*
@ -565,9 +569,12 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
*/
print '<br>';
print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'#default-pdf-modules-by-type-table" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
print '<div class="div-table-responsive-no-min">';
print '<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Type").'</td>';
@ -595,6 +602,8 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
}
print '</table>';
print '</div>';
print "</form>";
}
@ -607,6 +616,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -681,12 +691,15 @@ if ($resql) {
print "</select>";
print "</td></tr>";
print "</table>";
print '</div>';
print "</form>";
print "<br>";
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -740,14 +753,14 @@ print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td>';
print '<td><input size="50" class="flat" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n";
print '</form>';
print '</table>';
print '</div>';
/*
* Repertoire

View File

@ -236,6 +236,7 @@ print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1
print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>';
@ -328,7 +329,10 @@ foreach ($dirmodels as $reldir) {
}
}
print '</table><br>';
print '</table>';
print '</div>';
print '<br>';
/*
@ -358,6 +362,7 @@ if ($resql) {
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -468,6 +473,7 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
print "<br>";
/*
@ -475,6 +481,8 @@ print "<br>";
*/
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -515,7 +523,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERM
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
@ -585,6 +593,7 @@ print '</tr>';
print '</form>';
print '</table>';
print '</div>';
print '<br>';

View File

@ -132,7 +132,7 @@ print '<td colspan="2">';
if ($conf->global->GEOIP_VERSION == 'php') {
print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' or /pathtodatafile/GeoLite2-Country.mmdb<br>';
}
print '<input size="50" type="text" name="GEOIPMAXMIND_COUNTRY_DATAFILE" value="'.dol_escape_htmltag($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE).'">';
print '<input type="text" class="minwidth200" name="GEOIPMAXMIND_COUNTRY_DATAFILE" value="'.dol_escape_htmltag($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE).'">';
print '</td></tr>';
print '</table>';

View File

@ -472,7 +472,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
print '</table>';

View File

@ -23,32 +23,8 @@
*/
// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
}
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--; $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
}
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
}
// Try main.inc.php using relative path
if (!$res && file_exists("../main.inc.php")) {
$res = @include "../main.inc.php";
}
if (!$res && file_exists("../../main.inc.php")) {
$res = @include "../../main.inc.php";
}
if (!$res) {
die("Include of main fails");
}
require '../main.inc.php';
global $langs, $user;
// Libraries

View File

@ -27,32 +27,7 @@
*/
// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
}
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--; $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
}
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
}
// Try main.inc.php using relative path
if (!$res && file_exists("../main.inc.php")) {
$res = @include "../main.inc.php";
}
if (!$res && file_exists("../../main.inc.php")) {
$res = @include "../../main.inc.php";
}
if (!$res) {
die("Include of main fails");
}
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement.lib.php';

View File

@ -302,7 +302,7 @@ if ($action == 'edit') {
// Disable
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>';
print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', $conf->global->MAIN_DISABLE_ALL_MAILS, 1);
print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', getDolGlobalString('MAIN_DISABLE_ALL_MAILS'), 1);
print '</td></tr>';
// Force e-mail recipient
@ -514,7 +514,7 @@ if ($action == 'edit') {
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0);
print '</td></tr>';
// From
@ -529,7 +529,7 @@ if ($action == 'edit') {
// Add user to select destinaries list
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>';
print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', $conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT, 1);
print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', getDolGlobalString('MAIN_MAIL_ENABLED_USER_DEST_SELECT'), 1);
print '</td></tr>';
print '</table>';

View File

@ -609,6 +609,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
}
if (!isset($totalarray['val'])) {
$totalarray['val'] = array();
}
if (!isset($totalarray['val']['t.'.$key])) {
$totalarray['val']['t.'.$key] = 0;
}
$totalarray['val']['t.'.$key] += $object->$key;
}
}

View File

@ -8,6 +8,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -246,6 +247,7 @@ if ($action == 'install') {
if ($action == 'set' && $user->admin) {
$resarray = activateModule($value);
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
if (!empty($resarray['errors'])) {
setEventMessages('', $resarray['errors'], 'errors');
} else {
@ -269,6 +271,7 @@ if ($action == 'set' && $user->admin) {
exit;
} elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') {
$result = unActivateModule($value);
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
if ($result) {
setEventMessages($result, null, 'errors');
}
@ -532,7 +535,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
$moreforfilter .= '<div class="divsearchfield paddingtop">';
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh hideonsmartphone"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield paddingtop">';
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
@ -823,8 +826,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} else {
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15');
}
} else // Module not yet activated
{
} else { // Module not yet activated
// Set $codeenabledisable
if (!empty($objMod->always_enabled)) {
// Should never happened
@ -881,11 +883,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} else {
print '<tr class="oddeven">'."\n";
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) {
print '<td width="20px">'.$linenum.'</td>';
print '<td class="width50">'.$linenum.'</td>';
}
// Picto + Name of module
print ' <td width="200px">';
print ' <td class="tdoverflowmax300" title="'.dol_escape_htmltag($objMod->getName()).'">';
$alttext = '';
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
@ -1012,7 +1014,7 @@ if ($mode == 'marketplace') {
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield">
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
</div>
<div class="divsearchfield">
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">

View File

@ -91,7 +91,9 @@ print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
} else {

View File

@ -313,7 +313,7 @@ if ($mode == 'config' && $user->admin) {
if ($action != 'editprinter') {
print '<tr>';
print '<td><input size="50" type="text" name="printername"></td>';
print '<td><input class="minwidth200" type="text" name="printername"></td>';
$ret = $printer->selectTypePrinter();
print '<td>'.$printer->resprint.'</td>';
$ret = $printer->selectProfilePrinter();
@ -334,7 +334,7 @@ if ($mode == 'config' && $user->admin) {
print '<tr class="oddeven">';
if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
print '<td>'.$printer->resprint.'</td>';
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin) {
print '<tr class="oddeven">';
if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td><input type="text" class="minwidth200" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td>';
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
print '</td>';
@ -456,7 +456,7 @@ if ($mode == 'template' && $user->admin) {
if ($action != 'edittemplate') {
print '<tr>';
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td><input type="text" class="minwidth200" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td>';
print '<textarea name="template" wrap="soft" cols="120" rows="12">';
print '</textarea>';

View File

@ -178,6 +178,7 @@ print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'r
print load_fiche_titre($langs->trans("ReceptionsNumberingModules"));
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>';
@ -272,8 +273,10 @@ foreach ($dirmodels as $reldir) {
}
}
print '</table><br>';
print '</table>';
print '</div>';
print '<br>';
/*
* Documents models for Receptions Receipt
@ -302,6 +305,7 @@ if ($resql) {
dol_print_error($db);
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="140">'.$langs->trans("Name").'</td>';
@ -417,6 +421,8 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
print '<br>';
@ -459,7 +465,7 @@ print "</td></tr>\n";
print '<tr><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'<br>';
print '<input size="50" class="flat" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">';
print "</td></tr>\n";
*/
print '</table>';

View File

@ -74,6 +74,7 @@ print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateoptions">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
@ -132,6 +133,7 @@ print '<td></td>';
print '</tr>';
print '</table>';
print '</div>';
print '</form>';

View File

@ -743,6 +743,23 @@ if ($conf->use_javascript_ajax) {
}
print "</td>\n";
print "</tr>\n";
/* Disabled. Would be better to be managed with a user cookie
if (!empty($conf->productbatch->enabled)) {
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
print '<td class="right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_SHOW_ALL_BATCH_BY_DEFAULT');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_SHOW_ALL_BATCH_BY_DEFAULT", $arrval, $conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT);
}
print "</td>\n";
print "</tr>\n";
}
*/
print '</table>';
print '</form>';

View File

@ -490,7 +490,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAF
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input size="50" class="flat" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
print '</td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";

View File

@ -122,7 +122,7 @@ if (dol_is_file($xmlfile)) {
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
if ($enableremotecheck) {
print '<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> <label for="checkboxremote">'.$langs->trans("RemoteSignature").'</label> = ';
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
print '<input name="xmlremote" class="flat minwidth500" value="'.dol_escape_htmltag($xmlremote).'"><br>';
} else {
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.dol_escape_htmltag($xmlremote);
if (!GETPOST('xmlremote')) {

View File

@ -65,6 +65,7 @@ $arrayfields = array(
);
$arrayfields = dol_sort_array($arrayfields, 'position');
$param = '';
/*

View File

@ -75,7 +75,7 @@ print '<br>';
print '<strong>'.$langs->trans("Syslog").'</strong>: ';
$test = empty($conf->syslog->enabled);
if ($test) {
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog"));
@ -91,7 +91,7 @@ print '<br>';
print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
$test = empty($conf->debugbar->enabled);
if ($test) {
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
@ -111,7 +111,7 @@ if ($test) {
print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
}
} else {
print img_picto('', 'warning').' '.$langs->trans("MemcachedNotAvailable");
print $langs->trans("MemcachedNotAvailable");
}
print '</br>';
@ -464,11 +464,99 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
print '<br>';
}
// Product search
print '<br>';
print '<strong>'.$langs->trans("ComboListOptim").'</strong>: ';
print '<br>';
// Product combo list
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$resql = $db->query($sql);
if ($resql) {
$limitforoptim = 5000;
$num = $db->num_rows($resql);
$obj = $db->fetch_object($resql);
$nb = $obj->nb;
if ($nb > $limitforoptim) {
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT');
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
}
print '<br>';
$db->free($resql);
}
// Thirdparty combo list
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$resql = $db->query($sql);
if ($resql) {
$limitforoptim = 5000;
$num = $db->num_rows($resql);
$obj = $db->fetch_object($resql);
$nb = $obj->nb;
if ($nb > $limitforoptim) {
if (empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT');
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
}
print '<br>';
$db->free($resql);
}
// Contact combo list
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s";
$resql = $db->query($sql);
if ($resql) {
$limitforoptim = 5000;
$num = $db->num_rows($resql);
$obj = $db->fetch_object($resql);
$nb = $obj->nb;
if ($nb > $limitforoptim) {
if (empty($conf->global->CONTACT_USE_SEARCH_TO_SELECT)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT');
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts"));
}
print '<br>';
$db->free($resql);
}
// Contact combo list
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as s";
$resql = $db->query($sql);
if ($resql) {
$limitforoptim = 5000;
$num = $db->num_rows($resql);
$obj = $db->fetch_object($resql);
$nb = $obj->nb;
if ($nb > $limitforoptim) {
if (empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT');
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects"));
}
print '<br>';
$db->free($resql);
}
print '<br>';
print '<strong>'.$langs->trans("SearchOptim").'</strong>: ';
print '<br>';
$tab = array();
// Product search
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$resql = $db->query($sql);
@ -480,8 +568,9 @@ if ($resql) {
if ($nb > $limitforoptim) {
if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', $conf->global->PRODUCT_DONOTSEARCH_ANYWHERE);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
@ -491,20 +580,20 @@ if ($resql) {
}
// Thirdparty search
$tab = array();
$sql = "SELECT COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$resql = $db->query($sql);
if ($resql) {
$limitforoptim = 10000;
$limitforoptim = 100000;
$num = $db->num_rows($resql);
$obj = $db->fetch_object($resql);
$nb = $obj->nb;
if ($nb > $limitforoptim) {
if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
} else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', $conf->global->COMPANY_DONOTSEARCH_ANYWHERE);
}
} else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));

View File

@ -65,12 +65,31 @@ if (function_exists('php_ini_loaded_file')) {
}
print "<br>\n";
// Get versionof web server
print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
// Get version of web server
print "<br><strong>Web server - ".$langs->trans("Version")."</strong>: ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
print '<strong>'.$langs->trans("DataRootServer")."</strong>: ".DOL_DATA_ROOT."<br>\n";
// Web user group by default
$labeluser = dol_getwebuser('user');
$labelgroup = dol_getwebuser('group');
if ($labeluser && $labelgroup) {
print '<strong>'.$langs->trans("WebUserGroup")." (env vars)</strong> : ".$labeluser.':'.$labelgroup;
if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
$arrayofinfoofuser = posix_getpwuid(posix_geteuid());
print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span><br>'."\n";
}
}
// Web user group real (detected by 'id' external command)
if (function_exists('exec')) {
$arrayout = array(); $varout = 0;
exec('id', $arrayout, $varout);
if (empty($varout)) { // Test command is ok. Work only on Linux OS.
print '<strong>'.$langs->trans("WebUserGroup")." (real, 'id' command)</strong> : ".join(',', $arrayout)."<br>\n";
}
}
print '<br>';
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' &nbsp; <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath")).')</span>')."<br>\n";
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
print "<strong>PHP disable_functions</strong> = ";
@ -156,7 +175,7 @@ $arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/cus
$fileswithwritepermission = array();
foreach ($arrayoffilesinroot as $fileinroot) {
// Test if there is at least one write permission file. If yes, add the entry into array $fileswithwritepermission
if ($fileinroot['perm'] & 0222) {
if (isset($fileinroot['perm']) && ($fileinroot['perm'] & 0222)) {
$fileswithwritepermission[] = $fileinroot['relativename'];
}
}
@ -209,7 +228,7 @@ print '<br>';
print '<br>';
print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', '', 'folder');
print '<strong>$dolibarr_main_prod</strong>: '.$dolibarr_main_prod;
print '<strong>$dolibarr_main_prod</strong>: '.($dolibarr_main_prod ? $dolibarr_main_prod : '0');
if (empty($dolibarr_main_prod)) {
print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
}
@ -217,7 +236,7 @@ print '<br>';
print '<strong>$dolibarr_nocsrfcheck</strong>: '.$dolibarr_nocsrfcheck;
if (!empty($dolibarr_nocsrfcheck)) {
print img_picto('', 'warning').' &nbsp; '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
}
print '<br>';
@ -226,24 +245,40 @@ if (empty($dolibarr_main_restrict_ip)) {
print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
}
print '<br>';
if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) {
print '<strong>$dolibarr_main_db_pass</strong>: ';
if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommanded").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
} else {
print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated");
}
print '<br>';
}
// Menu security
print '<br>';
print '<br>';
print '<br>';
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup").' + '.$langs->trans("OtherSetup"), '', 'folder');
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_HASH_ALGO)." &nbsp; ";
if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
print '<span class="opacitymedium"> &nbsp; &nbsp; If unset: \'md5\'</span>';
}
print '<br>';
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
print '<br><strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
} else {
print '<span class="opacitymedium">('.$langs->trans("Recommanded").': password_hash)</span>';
print '<br>';
}
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
print '<div class="info">The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.<br>';
@ -256,21 +291,23 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
print '<br>';
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Example").': static-ips-of-server - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
print '<br>';
print '<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0 &nbsp; <span class="opacitymedium">('.$langs->trans("Recommanded").': 0)</span>' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."<br>";
print '<br>';
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; ';
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
} else {
print $conf->global->MAIN_EXEC_USE_POPEN.' &nbsp; ';
print $conf->global->MAIN_EXEC_USE_POPEN;
}
if ($execmethod == 1) {
print ' --> "exec" PHP method will be used for shell commands.';
print ' &nbsp; <span class="opacitymedium">("exec" PHP method will be used for shell commands)</span>';
}
if ($execmethod == 2) {
print ' --> "popen" PHP method will be used for shell commands.';
print ' &nbsp; <span class="opacitymedium">("popen" PHP method will be used for shell commands)</span>';
}
print "<br>";
print '<br>';
@ -278,7 +315,7 @@ print '<br>';
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
print ' &nbsp; - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
if (defined('MAIN_ANTIVIRUS_COMMAND')) {

View File

@ -68,6 +68,7 @@ $search_user = GETPOST("search_user", "alpha");
$search_desc = GETPOST("search_desc", "alpha");
$search_ua = GETPOST("search_ua", "restricthtml");
$search_prefix_session = GETPOST("search_prefix_session", "restricthtml");
$optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' except when 'print')
$now = dol_now();
$nowarray = dol_getdate($now);

View File

@ -188,7 +188,7 @@ if ($action == 'delete') {
$form = new Form($db);
$formadmin = new FormAdmin($db);
$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración';
$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
llxHeader('', $langs->trans("Setup"), $wikihelp);
$param = '&mode='.urlencode($mode);
@ -563,6 +563,21 @@ if ($mode == 'searchkey') {
print ' &nbsp; <a href="'.$transifexurl.'" target="transifex">'.img_picto($langs->trans('FixOnTransifex'), 'globe').'</a>';
}
} else {
// retrieve rowid
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
$sql .= " WHERE entity IN (".getEntity('overwrite_trans').")";
$sql .= " AND transkey = '".$db->escape($key)."'";
dol_syslog("translation::select from table", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$obj = $db->fetch_object($result);
}
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
print ' ';
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
print '&nbsp;&nbsp;';
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
print $form->textwithpicto('', $htmltext, 1, 'warning');
}

View File

@ -126,6 +126,7 @@ $head = user_admin_prepare_head();
print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
@ -171,6 +172,7 @@ if ($conf->use_javascript_ajax) {
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
@ -197,6 +199,7 @@ if ($resql) {
print load_fiche_titre($langs->trans("UsersDocModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -306,7 +309,9 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print "<br>";
print '</div>';
print '<br>';
print dol_get_fiche_end();

View File

@ -200,7 +200,7 @@ class Setup extends DolibarrApi
$sql = "SELECT id, code, type, libelle as label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_paiement as t";
$sql .= " WHERE t.entity IN (".getEntity('c_paiement').")";
$sql .= " AND t.active = ".$active;
$sql .= " AND t.active = ".((int) $active);
// Add sql filters
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
@ -1055,7 +1055,7 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid AS id, zip, town, fk_county, fk_pays AS fk_country";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ziptown as t";
$sql .= " AND t.active = ".$active;
$sql .= " AND t.active = ".((int) $active);
if ($zipcode) {
$sql .= " AND t.zip LIKE '%".$this->db->escape($zipcode)."%'";
}
@ -1125,7 +1125,7 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid as id, code, sortorder, libelle as label, libelle_facture as descr, type_cdr, nbjour, decalage, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_payment_term as t";
$sql .= " WHERE t.entity IN (".getEntity('c_payment_term').")";
$sql .= " AND t.active = ".$active;
$sql .= " AND t.active = ".((int) $active);
// Add sql filters
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
@ -1183,7 +1183,7 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid as id, code, libelle as label, description, tracking, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
$sql .= " WHERE t.entity IN (".getEntity('c_shipment_mode').")";
$sql .= " AND t.active = ".$active;
$sql .= " AND t.active = ".((int) $active);
// Add sql filters
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
@ -1307,7 +1307,7 @@ class Setup extends DolibarrApi
$sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t";
$sql .= " WHERE t.entity IN (".getEntity('c_socialnetworks').")";
$sql .= " AND t.active = ".$active;
$sql .= " AND t.active = ".((int) $active);
// Add sql filters
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {

View File

@ -332,7 +332,7 @@ class AssetType extends CommonObject
/**
* Return array of Asset objects for asset type this->id (or all if this->id not defined)
*
* @param string $excludefilter Filter to exclude. This parameter must not be provided by input of users
* @param string $excludefilter Filter string to exclude. This parameter must not be provided by input of users
* @param int $mode 0=Return array of asset instance
* 1=Return array of asset instance without extra data
* 2=Return array of asset id only
@ -347,7 +347,7 @@ class AssetType extends CommonObject
$sql = "SELECT a.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."asset as a";
$sql .= " WHERE a.entity IN (".getEntity('asset').")";
$sql .= " AND a.fk_asset_type = ".$this->id;
$sql .= " AND a.fk_asset_type = ".((int) $this->id);
if (!empty($excludefilter)) {
$sql .= ' AND ('.$excludefilter.')';
}

View File

@ -128,7 +128,7 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
$modulepart = 'asset';
$permission = $user->rights->asset->write;
$permissiontoadd = $user->rights->asset->write;
$permtoedit = $user->rights->asset->write;
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';

View File

@ -103,7 +103,7 @@ foreach ($object->fields as $key => $val) {
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
if ($val['searchall']) {
if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
@ -542,6 +542,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
}
if (!isset($totalarray['val'])) {
$totalarray['val'] = array();
}
if (!isset($totalarray['val']['t.'.$key])) {
$totalarray['val']['t.'.$key] = 0;
}
$totalarray['val']['t.'.$key] += $object->$key;
}
}

View File

@ -71,7 +71,7 @@ class BlockedLogAuthority
$this->blockchain = '';
if (is_array($bocks)) {
if (is_array($blocks)) {
foreach ($blocks as &$b) {
$this->blockchain .= $b->signature;
}
@ -299,16 +299,18 @@ class BlockedLogAuthority
$signature = $block_static->getSignature();
foreach ($blocks as &$block) {
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature;
if (is_array($blocks)) {
foreach ($blocks as &$block) {
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature;
$res = file_get_contents($url);
echo $block->signature.' '.$url.' '.$res.'<br>';
if ($res === 'blockalreadyadded' || $res === 'blockadded') {
$block->setCertified();
} else {
$this->error = $langs->trans('ImpossibleToContactAuthority ', $url);
return -1;
$res = getURLContent($url);
echo $block->signature.' '.$url.' '.$res.'<br>';
if ($res === 'blockalreadyadded' || $res === 'blockadded') {
$block->setCertified();
} else {
$this->error = $langs->trans('ImpossibleToContactAuthority ', $url);
return -1;
}
}
}

View File

@ -126,7 +126,7 @@ $form = new Form($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) {

View File

@ -76,7 +76,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object);
$upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/".get_exdir(0, 0, 0, 1, $object);
}
// Security check - Protection if external user
@ -147,12 +147,12 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'bom';
$permission = $user->rights->bom->write;
$permissiontoadd = $user->rights->bom->write;
$permtoedit = $user->rights->bom->write;
$param = '&id='.$object->id;
//$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/';
$relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/';
$relativepathwithnofile = dol_sanitizeFileName($object->ref).'/';
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {

View File

@ -88,7 +88,7 @@ foreach ($object->fields as $key => $val) {
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
if ($val['searchall']) {
if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
@ -623,6 +623,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
}
if (!isset($totalarray['val'])) {
$totalarray['val'] = array();
}
if (!isset($totalarray['val']['t.'.$key])) {
$totalarray['val']['t.'.$key] = 0;
}
$totalarray['val']['t.'.$key] += $object->$key;
}
}

View File

@ -97,45 +97,7 @@ if ($id > 0 || !empty($ref)) {
$linkback = '<a href="'.dol_buildpath('/bom/bom_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
/*
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->bom->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}*/
$morehtmlref .= '</div>';

View File

@ -96,7 +96,7 @@ class BOM extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
@ -614,8 +614,8 @@ class BOM extends CommonObject
$sql .= " SET ref = '".$this->db->escape($num)."',";
$sql .= " status = ".self::STATUS_VALIDATED.",";
$sql .= " date_valid='".$this->db->idate($now)."',";
$sql .= " fk_user_valid = ".$user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " fk_user_valid = ".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
$resql = $this->db->query($sql);

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