Merge branch 'Dolibarr:develop' into dolibarr_fixbugs
This commit is contained in:
commit
ba88c71fc7
6
.github/workflows/stale-issues-safe.yml
vendored
6
.github/workflows/stale-issues-safe.yml
vendored
@ -6,9 +6,13 @@ on:
|
||||
- cron: "0 21 * * *"
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
permissions: {} # none
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
permissions:
|
||||
issues: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: Dolibarr/stale@staleunstale
|
||||
@ -21,4 +25,4 @@ jobs:
|
||||
days-before-close: 10
|
||||
operations-per-run: 100
|
||||
dry-run: false
|
||||
|
||||
|
||||
|
||||
@ -98,6 +98,12 @@ source_file = htdocs/langs/en_US/cron.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.datapolicy]
|
||||
file_filter = htdocs/langs/<lang>/datapolicy.lang
|
||||
source_file = htdocs/langs/en_US/datapolicy.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.deliveries]
|
||||
file_filter = htdocs/langs/<lang>/deliveries.lang
|
||||
source_file = htdocs/langs/en_US/deliveries.lang
|
||||
|
||||
@ -33,6 +33,7 @@ PEAR Mail_MIME 1.8.9 BSD Yes
|
||||
ParseDown 1.6 MIT License Yes Markdown parser
|
||||
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
|
||||
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
||||
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
||||
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
php-iban 4.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||
|
||||
95
ChangeLog
95
ChangeLog
@ -20,6 +20,7 @@ WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
|
||||
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
|
||||
|
||||
|
||||
***** ChangeLog for 16.0.0 compared to 15.0.0 *****
|
||||
@ -27,9 +28,9 @@ Following changes may create regressions for some external modules, but were nec
|
||||
For users:
|
||||
---------------
|
||||
|
||||
NEW: PHP 8.1 compatibility.
|
||||
Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending
|
||||
on the PHP setup). Removal of all PHP warnings on server side is planned for v17.
|
||||
NEW: PHP 8.1 compatibility:
|
||||
Warning!! Application works correctly with PHP8 and 8.1 but you will experience a lot of PHP warnings into the PHP server
|
||||
log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17.
|
||||
NEW: Support for recurring purchase invoices.
|
||||
NEW: #20292 Include German public holidays
|
||||
NEW: Can show ZATCA QR-Code on PDFs
|
||||
@ -41,6 +42,7 @@ NEW: Accept 'auto' for ref of object on import of purchase order/proposal
|
||||
NEW: Accountancy - Add more filters and info on page to bind accounting accounts
|
||||
NEW: Accountancy - Add subledger account when generate a transaction with a deposit invoice
|
||||
NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list)
|
||||
NEW: Accountancy - Add hidden feature for accounting reconciliation
|
||||
NEW: ACE Editor is restored at same cursor position after a save.
|
||||
NEW: Add "addMoreActionsButtons" hook to subscription form
|
||||
NEW: Add an option in GUI to show a Quick add button into top menu bar
|
||||
@ -49,97 +51,95 @@ NEW: Add column date of Signature on proposal list
|
||||
NEW: Add column template invoice in invoice list
|
||||
NEW: Add column "Total HT" to products array on document creation card
|
||||
NEW: Add configuration for text color of button action
|
||||
NEW: Add constant to hide categories in TakePos
|
||||
NEW: Add constant to show category description in TakePos
|
||||
NEW: Add constant to show only the products in stock in TakePos
|
||||
NEW: Add entity filter in exports
|
||||
NEW: Show the event block on recurring invoices #20870
|
||||
NEW: Add filter "opportunity status" on statistics of projects.
|
||||
NEW: Add firstname, lastname and max number of attendees for module "Event Organization"
|
||||
NEW: Add margin info in proposal and order list
|
||||
NEW: Add massaction "Edit Extrafield" for Product
|
||||
NEW: Add more fields to detect duplicate during import of thirdparties
|
||||
NEW: Add option to foce delivery on email for purchase order receipt to yes
|
||||
NEW: Add param boder table for md theme
|
||||
NEW: Add param color button action
|
||||
NEW: Add possibility to create contract from invoice
|
||||
NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name
|
||||
NEW: Add private and public notes on tax files.
|
||||
NEW: Add status "Obsolete" to KM articles
|
||||
NEW: Add substitutions "user numbers"
|
||||
NEW: allow a ticket to be automatically marked as read when created from backend.
|
||||
NEW: allow cut&paste as real numeric value to excel
|
||||
NEW: A public form to send a message and create a lead is available
|
||||
NEW: automatically set totally received status in reception
|
||||
NEW: Auto set invoice paid when adding credit not and remain to pay is 0
|
||||
NEW: Availibility dictionnary has a new column unit and number
|
||||
NEW: Can change value of AWP during the inventory
|
||||
NEW: Can enter price with tax for predefined products on purchase objects
|
||||
NEW: Can filter on a thirdparty on product statistics
|
||||
NEW: Can removed doc templates from setup page of thirdparty
|
||||
NEW: Can set the parent company during the creation of thirdparty (action=add of societe/card.php)
|
||||
NEW: Can use ! to make a search that exclude a string
|
||||
NEW: Change in theme colors does not need to use the refresh button
|
||||
NEW: clean values and amount in FEC import
|
||||
NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action
|
||||
NEW: Contact filter project list
|
||||
NEW: Create contract from invoice
|
||||
NEW: create third-party with contact if not found on public ticket
|
||||
NEW: Database: Can store the session into database (instead of beeing managed by PHP)
|
||||
NEW: Database: Some core tables are created only at module activation
|
||||
NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks)
|
||||
NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit.
|
||||
NEW: Dictionaries - add possibility to manage countries in EEC
|
||||
NEW: Dictionaries - Availibility dictionnary has a new column unit and number
|
||||
NEW: Display errors in a message box after generating documents
|
||||
NEW: Display physical and virtual stock of the products when creating OF from a BOM
|
||||
NEW: Display product ref in "Object link" product tab for BOM
|
||||
NEW: Enhance the import. Can use 'auto' for the ref (import of orders)
|
||||
NEW: Events on Proposal to Return to Draft
|
||||
NEW: Page to list expense report payments
|
||||
NEW: JS inventory autocalc input
|
||||
NEW: language support for more emailing target selectors
|
||||
NEW: leave requests: add field into type dictionary to block request if balance is negative
|
||||
NEW: MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys
|
||||
NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
|
||||
NEW: Mass action "Close shipments"
|
||||
NEW: Module BOM - Add tabs for nets Bom
|
||||
NEW: Module BOM - Add the possibility to add sub-BOMs to BOM
|
||||
NEW: Module Recruitment - Add a public page with all list of open job positions.
|
||||
NEW: Module BOM - add tabs for nets Bom
|
||||
NEW: Module BOM - add the possibility to add sub-BOMs to BOM
|
||||
NEW: Module Recruitment - Add a public page with list of all open job positions.
|
||||
NEW: Module Recruitment - Add a tab with list of application on the jobposition file.
|
||||
NEW: Module website now supports the multicompany module
|
||||
NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
|
||||
NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens)
|
||||
NEW: on redirect of page in website module, GET parameters are kept.
|
||||
NEW: optional display warning icons on ticket list
|
||||
NEW: option to default check "notify tier at creation" in ticket module
|
||||
NEW: option update prices on proposal cloning
|
||||
NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439)
|
||||
NEW: possibility to consume multiple batch
|
||||
NEW: Reverse movement product consumption
|
||||
NEW: Send email to the supplier order contact
|
||||
NEW: New permission to report time on timesheet.
|
||||
NEW: add permission to report time on timesheet
|
||||
NEW: Knowledge Management - add status "Obsolete" to KM articles
|
||||
NEW: MRP - split consumption line on MO
|
||||
NEW: MRP - display physical and virtual stock of the products when creating OF from a BOM
|
||||
NEW: MRP - display product ref in "Object link" product tab for BOM
|
||||
NEW: Projects - add filter "opportunity status" on statistics of projects.
|
||||
NEW: Proposals - option update prices on proposal cloning
|
||||
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
|
||||
NEW: Show number of votes into the label of tab "Results" of a survey
|
||||
NEW: Some core tables are created only at module activation
|
||||
NEW: split consumption line on MO
|
||||
NEW: stock filter in reassort lists
|
||||
NEW: stock limit in stock export CSV
|
||||
NEW: Stocks - stock filter in reassort lists
|
||||
NEW: Stocks - stock limit in stock export CSV
|
||||
NEW: Stocks - Inventory - can change value of AWP during the inventory
|
||||
NEW: Supplier order - Show ref supplier of reception in linked object block
|
||||
NEW: support user_modif in order
|
||||
NEW: Surveys - Show number of votes into the label of tab "Results" of a survey
|
||||
NEW: TakePOS - barcode rule to insert product in TakePOS
|
||||
NEW: TakePOS - pagination on search results
|
||||
NEW: TakePOS - show product reference
|
||||
NEW: TakePOS - add constant to hide categories
|
||||
NEW: TakePOS - add constant to show category description
|
||||
NEW: TakePOS - add constant to show only the products in stock
|
||||
NEW: Themes - add param color button action
|
||||
NEW: Themes - Change in theme colors does not need to use the refresh button
|
||||
NEW: Themes - more mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
|
||||
NEW: Themes - MD - add param border table for md theme
|
||||
NEW: Third-Parties - Add rules "customer accountancy code" is mandatory to validate invoice
|
||||
NEW: Third-Parties - Can set the parent company during the creation of thirdparty (action=add of societe/card.php)
|
||||
NEW: Tickets - create Third-party with contact if not found on public ticket
|
||||
NEW: Tickets - option to default check "notify tier at creation"
|
||||
NEW: Tickets - Trigger: allow to automatically send messages on new tickets
|
||||
NEW: Tickets - optional display warning icons on ticket list
|
||||
NEW: Websites Module - supports now the multicompany module
|
||||
NEW: Websites Module - on redirect of page in website module, GET parameters are kept.
|
||||
NEW: The backup tools has an "lowmemory" option for mysqldump on large database
|
||||
NEW: The 'reposition' class works on ajax constantonoff that make redirects
|
||||
NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice
|
||||
NEW: thumbnail field in product list
|
||||
NEW: total mark rate in list
|
||||
NEW: uncheck "send message" by default on a ticket when private messages has been checked
|
||||
NEW: VAT Report by month - Show detail by rate and also by code
|
||||
NEW: Ticket triggers: allow to automatically send messages on new tickets
|
||||
NEW: Accountancy - Add hidden feature for accounting reconciliation
|
||||
NEW: Can store the session into database (instead of beeing managed by PHP)
|
||||
NEW: Added MMK currency (Myanmar Kyat)
|
||||
NEW: On a form to send an email, we show all emails of contacts of object
|
||||
|
||||
Modules
|
||||
Modules state
|
||||
NEW: Module Partnership Management
|
||||
NEW: Module Event Organization Management
|
||||
|
||||
@ -159,20 +159,17 @@ NEW: Identification of tr is possible with by attribute data-id on some pages
|
||||
NEW: Import with select boxes V2
|
||||
NEW: Can use current entity filter on 'chkbxlst'
|
||||
NEW: Creation of the function select_bom() used to display bom select list
|
||||
NEW: add printFieldListWhere hook in product reassort card
|
||||
NEW: Add trigger and event on completely received status change
|
||||
NEW: Add utility function send backup by mail
|
||||
NEW: add WordPress OAuth to save a token (not SSO)
|
||||
NEW: A module can embed a sql script run at each Dolibarr upgrade
|
||||
NEW: Add option INVOICEREC_SET_AUTOFILL_DATE_START/END
|
||||
NEW: A module can embed a SQL script run at each Dolibarr upgrade
|
||||
NEW: Add param to keep the robot=index meta tag on public pages
|
||||
NEW: Add method hintindex() in database handlers.
|
||||
NEW: add modifications for new function "$db->prefix()"
|
||||
NEW: addMoreActionsButtonsList hook for button in list
|
||||
NEW: Standardize a lot of code.
|
||||
NEW: Add a protection into PHPunit to avoid to forget a var_dump
|
||||
NEW: Add hidden option on contract PDF line to hide qty and price
|
||||
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
|
||||
|
||||
|
||||
API:
|
||||
NEW: API Proposals - Add POST lines
|
||||
@ -189,9 +186,9 @@ Hooks:
|
||||
NEW: Hook getNomUrl available everywhere in tooltip of ref links
|
||||
NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook
|
||||
NEW: Add hook before the public ticket list
|
||||
NEW: Add hook doaction in takepos invoice
|
||||
NEW: Add hook for Notif
|
||||
NEW: Add hook for more buttons
|
||||
NEW: add hook printFieldListWhere in product ressort card
|
||||
NEW: Add hook printFieldListWhere in "show_contacts" function
|
||||
NEW: Add hook printFieldWhere in load_state_board function
|
||||
NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts
|
||||
@ -206,7 +203,15 @@ NEW: Add hook to getSellPrice function
|
||||
NEW: TakePos - add hooks complete product display
|
||||
NEW: TakePos - add hooks for cart display
|
||||
NEW: TakePos - add hooks to complete ajax return array
|
||||
NEW: TakePOS - add hook doaction in TakePOS invoice
|
||||
|
||||
Config Options:
|
||||
NEW: Add hidden option on contract PDF line to hide qty and price
|
||||
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
|
||||
NEW: Option MAIN_API_DEBUG to save API logs into a file
|
||||
NEW: Option MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys
|
||||
NEW: Option MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
|
||||
NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END
|
||||
|
||||
WARNING:
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ The build of .exe files need to have some windows executable files already insta
|
||||
|
||||
If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file).
|
||||
|
||||
|
||||
!!! See file ../makepack-howto.txt
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/* !!! DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!! */
|
||||
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
@ -139,7 +138,7 @@ $cfg['UseDbSearch'] = TRUE; // whether to enable the "database sea
|
||||
$cfg['IgnoreMultiSubmitErrors'] = FALSE; // if set to true, PMA continues computing multiple-statement queries
|
||||
// even if one of the queries failed
|
||||
$cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the affected rows of EACH statement on
|
||||
// multiple-statement queries. See the libraries/import.php file for
|
||||
// multiple-statement queries. See the libraries/import.php file for
|
||||
// hardcoded defaults on how many queries a statement may contain!
|
||||
$cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth
|
||||
|
||||
@ -195,7 +194,7 @@ $cfg['CharEditing'] = 'input';
|
||||
// textarea - allows newlines in fields
|
||||
$cfg['InsertRows'] = 2; // How many rows can be inserted at one time
|
||||
|
||||
$cfg['ForeignKeyDropdownOrder'] = // Sort order for items in a foreign-key dropdown box.
|
||||
$cfg['ForeignKeyDropdownOrder'] = // Sort order for items in a foreign-key dropdown box.
|
||||
array( 'content-id', 'id-content'); // 'content' is the referenced data, 'id' is the key value.
|
||||
$cfg['ForeignKeyMaxLimit'] = 100; // A dropdown will be used if fewer items are present
|
||||
|
||||
@ -488,7 +487,7 @@ $cfg['ShowBrowseComments'] = TRUE; // shows stored relation-comments in
|
||||
$cfg['ShowPropertyComments']= TRUE; // shows stored relation-comments in 'table property' mode.
|
||||
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
|
||||
|
||||
$cfg['EditInWindow'] = TRUE; // Set to TRUE if Edit link should open the query to edit in the query window (assuming Javascript is enabled), and to FALSE if we should edit in the right panel
|
||||
$cfg['EditInWindow'] = TRUE; // Set to TRUE if Edit link should open the query to edit in the query window (assuming Javascript is enabled), and to FALSE if we should edit in the right panel
|
||||
$cfg['QueryWindowWidth'] = 550; // Width of Query window
|
||||
$cfg['QueryWindowHeight'] = 310; // Height of Query window
|
||||
$cfg['QueryHistoryDB'] = FALSE; // Set to TRUE if you want DB-based query history.
|
||||
@ -561,7 +560,7 @@ $cfg['SQLQuery']['Refresh'] = TRUE; // Refresh the results page
|
||||
*/
|
||||
$cfg['UploadDir'] = ''; // Directory for uploaded files that can be executed by
|
||||
// phpMyAdmin. For example './upload'. Leave empty for
|
||||
// no upload directory support. Use %u for username
|
||||
// no upload directory support. Use %u for username
|
||||
// inclusion.
|
||||
$cfg['SaveDir'] = ''; // Directory where phpMyAdmin can save exported data on
|
||||
// server. For example './save'. Leave empty for no save
|
||||
@ -645,7 +644,7 @@ $cfg['ColumnTypes'] = array(
|
||||
);
|
||||
|
||||
// Attributes
|
||||
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
|
||||
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
|
||||
// for MySQL >= 4.1.2, in libraries/tbl_properties.inc.php
|
||||
|
||||
$cfg['AttributeTypes'] = array(
|
||||
|
||||
@ -56,7 +56,7 @@ if (empty($argv[1])) {
|
||||
|
||||
$i=0;
|
||||
while ($i < $argc) {
|
||||
if (! empty($argv[$i])) {
|
||||
if (!empty($argv[$i])) {
|
||||
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
|
||||
}
|
||||
if (preg_match('/includeconstant=/', $argv[$i])) {
|
||||
|
||||
@ -632,7 +632,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
||||
|
||||
@ -25,9 +25,9 @@ Prerequisites to build autoexe DoliWamp package:
|
||||
|
||||
***** Prerequisites For Windows *****
|
||||
|
||||
Install Perl
|
||||
Install Perl.
|
||||
Install WampServer-3.2.*-64.exe
|
||||
isetup-5.5.8.exe
|
||||
Install isetup-5.5.8.exe
|
||||
|
||||
|
||||
***** Actions to do a BETA *****
|
||||
|
||||
@ -152,7 +152,7 @@ $user->rights->propal->creer=1;
|
||||
$user->rights->propal->propal_advance->validate=1;
|
||||
|
||||
|
||||
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) {
|
||||
if (!empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) {
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ if ($date == 'all') {
|
||||
}
|
||||
|
||||
// Replace database handler
|
||||
if (! empty($argv[4])) {
|
||||
if (!empty($argv[4])) {
|
||||
$db->close();
|
||||
unset($db);
|
||||
$db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]);
|
||||
|
||||
@ -487,7 +487,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
|
||||
$pkey = $line;
|
||||
|
||||
$linenumber ++;
|
||||
if (! empty($lines[$linenumber])) {
|
||||
if (!empty($lines[$linenumber])) {
|
||||
$line = $lines[$linenumber];
|
||||
} else {
|
||||
$line = '';
|
||||
@ -517,7 +517,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
|
||||
if (substr($line, 0, 12) == "CREATE INDEX") {
|
||||
$matches = array();
|
||||
preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches);
|
||||
if (! empty($matches[3])) {
|
||||
if (!empty($matches[3])) {
|
||||
$indexname = $matches[1];
|
||||
$tablename = str_replace('public.', '', $matches[2]);
|
||||
$columns = $matches[3];
|
||||
@ -529,7 +529,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
|
||||
if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") {
|
||||
$matches = array();
|
||||
preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches);
|
||||
if (! empty($matches[3])) {
|
||||
if (!empty($matches[3])) {
|
||||
$indexname = $matches[1];
|
||||
$tablename = str_replace('public.', '', $matches[2]);
|
||||
$columns = str_replace('"', '', $matches[3]);
|
||||
|
||||
@ -24,6 +24,7 @@ fi
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \;
|
||||
find ./htdocs/install/ -type d -exec chmod ug+rw {} \;
|
||||
chmod a+x ./scripts/*/*.php
|
||||
chmod a+x ./scripts/*/*.sh
|
||||
chmod g-w ./scripts/*/*.php
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*spl_autoload_register(function ($class_name) {
|
||||
//var_dump('class='.$class_name);
|
||||
require $class_name;
|
||||
|
||||
@ -309,11 +309,11 @@ class autoTranslator
|
||||
{
|
||||
// We want to be sure that src_lang and dest_lang are using 2 chars only
|
||||
$tmp=explode('_', $src_lang);
|
||||
if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) {
|
||||
if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) {
|
||||
$src_lang=$tmp[0];
|
||||
}
|
||||
$tmp=explode('_', $dest_lang);
|
||||
if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) {
|
||||
if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) {
|
||||
$dest_lang=$tmp[0];
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ class autoTranslator
|
||||
// now, process the JSON string
|
||||
$json = json_decode($body, true);
|
||||
|
||||
if ((! empty($json['responseStatus']) && $json['responseStatus'] != 200)
|
||||
if ((!empty($json['responseStatus']) && $json['responseStatus'] != 200)
|
||||
|| count($json['data']['translations']) == 0) {
|
||||
print "Error: ".$json['responseStatus']." ".$url."\n";
|
||||
return false;
|
||||
|
||||
@ -221,7 +221,7 @@ foreach ($dups as $string => $pages) {
|
||||
// Loop on each line keword was found into file.
|
||||
$listoffilesforthisentry=array();
|
||||
foreach ($lines as $line => $translatedvalue) {
|
||||
if (! empty($listoffilesforthisentry[$file])) {
|
||||
if (!empty($listoffilesforthisentry[$file])) {
|
||||
$duplicateinsamefile=1;
|
||||
}
|
||||
$listoffilesforthisentry[$file]=1;
|
||||
@ -300,7 +300,7 @@ if ($web) {
|
||||
|
||||
// STEP 2 - Search key not used
|
||||
|
||||
if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) {
|
||||
if ((!empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) {
|
||||
print "***** Strings in en_US that are never used:\n";
|
||||
|
||||
$unused=array();
|
||||
|
||||
@ -303,8 +303,8 @@ foreach ($filesToProcess as $fileToProcess) {
|
||||
|
||||
// String exists in both files and value into alternative language differs from main language but also from english files
|
||||
// so we keep it.
|
||||
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
|
||||
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|
||||
if ((!empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
|
||||
&& !empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|
||||
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)
|
||||
) {
|
||||
//print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n";
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief List accounting account
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -59,7 +60,7 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -97,6 +98,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('accountancyadminaccount'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -109,8 +113,8 @@ if (!GETPOST('confirmmassaction', 'alpha')) {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been monowraponalldified by some hooks
|
||||
$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $accounting, $action); // Note that $action and $object may have been monowraponalldified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
@ -398,6 +402,11 @@ if ($resql) {
|
||||
print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button button-edit" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '<br>';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
* \brief Page to administer model of chart of accounts
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@ -78,7 +79,7 @@ $search_country_id = GETPOST('search_country_id', 'int');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief Card of accounting account
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
@ -48,7 +49,7 @@ $label = GETPOST('label', 'alpha');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page to assign mass categories to accounts
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
@ -44,7 +45,7 @@ if ($cat_id == 0) {
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -124,7 +125,8 @@ if (!empty($cat_id)) {
|
||||
|
||||
$arraykeyvalue = array();
|
||||
foreach ($accountingcategory->lines_cptbk as $key => $val) {
|
||||
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')';
|
||||
$doc_ref = !empty($val->doc_ref) ? $val->doc_ref : '';
|
||||
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : '');
|
||||
}
|
||||
|
||||
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page to administer data tables
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@ -42,7 +43,7 @@ $rowid = GETPOST('rowid', 'alpha');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -885,9 +886,11 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
|
||||
$fieldname = 'country';
|
||||
if ($context == 'add') {
|
||||
$fieldname = 'country_id';
|
||||
print $form->select_country(GETPOST('country_id', 'int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
$preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code;
|
||||
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
} else {
|
||||
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : $mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
$preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code);
|
||||
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
}
|
||||
print '</td>';
|
||||
} elseif ($fieldlist[$field] == 'country_id') {
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -31,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
$langs->loadLangs(array("compta", "admin", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Setup page to configure fiscal year
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page to show a fiscal year
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page to show info of a fiscal year
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -38,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ if (!defined('CSRFCHECK_WITH_TOKEN')) {
|
||||
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||
}
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@ -45,7 +46,7 @@ $rowid = GETPOST('rowid', 'alpha');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief List of accounting sub-account (auxiliary accounts)
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -47,7 +48,7 @@ $search_type = GETPOST('search_type', 'int');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Balance of book keeping
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
|
||||
@ -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-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2022 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>
|
||||
*
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Page to show book-entry
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
@ -332,7 +333,9 @@ if ($action == 'valid') {
|
||||
$html = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxHeader('', $langs->trans("CreateMvts"));
|
||||
$title = $langs->trans("CreateMvts");
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
// Confirmation to delete the command
|
||||
if ($action == 'delete') {
|
||||
@ -341,7 +344,7 @@ if ($action == 'delete') {
|
||||
}
|
||||
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("CreateMvts"));
|
||||
print load_fiche_titre($title);
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
$next_num_mvt = $object->getNextNumMvt('_tmp');
|
||||
@ -540,21 +543,24 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document export
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Don't show in tmp mode, inevitably empty
|
||||
if ($mode != "_tmp") {
|
||||
// Date document export
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
|
||||
print '<td>';
|
||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document validation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Date document validation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
|
||||
print '<td>';
|
||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Validate
|
||||
/*
|
||||
|
||||
@ -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-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2022 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>
|
||||
*
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief List operation of book keeping
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -479,8 +480,8 @@ if (empty($reshook)) {
|
||||
// Mass actions
|
||||
$objectclass = 'Bookkeeping';
|
||||
$objectlabel = 'Bookkeeping';
|
||||
$permissiontoread = $user->rights->societe->lire;
|
||||
$permissiontodelete = $user->rights->societe->supprimer;
|
||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||
$permissiontoadd = $user->rights->societe->creer;
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
@ -1136,6 +1137,9 @@ $totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$totalarray['val'] = array ();
|
||||
$totalarray['val']['totaldebit'] = 0;
|
||||
$totalarray['val']['totalcredit'] = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief List operation of ledger ordered by account number
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -394,8 +395,8 @@ if (empty($reshook)) {
|
||||
// Mass actions
|
||||
$objectclass = 'Bookkeeping';
|
||||
$objectlabel = 'Bookkeeping';
|
||||
$permissiontoread = $user->rights->societe->lire;
|
||||
$permissiontodelete = $user->rights->societe->supprimer;
|
||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||
$permissiontoadd = $user->rights->societe->creer;
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
@ -824,17 +825,22 @@ print $hookmanager->resPrint;
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
|
||||
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['val'] = array ();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
$totalarray['val']['totaldebit'] = 0;
|
||||
$totalarray['val']['totalcredit'] = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
$line = $object->lines[$i];
|
||||
|
||||
|
||||
@ -785,12 +785,13 @@ class AccountancyCategory // extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of custom groups that are active
|
||||
* Return list of custom groups.
|
||||
*
|
||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @param int $active 1= active, 0=not active
|
||||
* @return array|int Array of groups or -1 if error
|
||||
*/
|
||||
public function getCats($categorytype = -1)
|
||||
public function getCats($categorytype = -1, $active = 1)
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
|
||||
@ -801,7 +802,7 @@ class AccountancyCategory // extends CommonObject
|
||||
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
|
||||
$sql .= " WHERE c.active = 1";
|
||||
$sql .= " WHERE c.active = " . (int) $active;
|
||||
$sql .= " AND c.entity = ".$conf->entity;
|
||||
if ($categorytype >= 0) {
|
||||
$sql .= " AND c.category_type = 1";
|
||||
|
||||
@ -1347,7 +1347,7 @@ class AccountancyExport
|
||||
}
|
||||
print $nature_piece.$separator;
|
||||
// RACI
|
||||
// if (! empty($line->subledger_account)) {
|
||||
// if (!empty($line->subledger_account)) {
|
||||
// if ($line->doc_type == 'supplier_invoice') {
|
||||
// $racine_subledger_account = '40';
|
||||
// } elseif ($line->doc_type == 'customer_invoice') {
|
||||
@ -1610,7 +1610,7 @@ class AccountancyExport
|
||||
}
|
||||
print $nature_piece.$separator;
|
||||
// RACI
|
||||
// if (! empty($line->subledger_account)) {
|
||||
// if (!empty($line->subledger_account)) {
|
||||
// if ($line->doc_type == 'supplier_invoice') {
|
||||
// $racine_subledger_account = '40';
|
||||
// } elseif ($line->doc_type == 'customer_invoice') {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -1123,14 +1123,13 @@ class BookKeeping extends CommonObject
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param string $sortorder Sort Order
|
||||
* @param string $sortfield Sort field
|
||||
* @param int $limit offset limit
|
||||
* @param int $offset offset limit
|
||||
* @param array $filter filter array
|
||||
* @param string $filtermode filter mode (AND or OR)
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param string $sortorder Sort Order
|
||||
* @param string $sortfield Sort field
|
||||
* @param int $limit offset limit
|
||||
* @param int $offset offset limit
|
||||
* @param array $filter filter array
|
||||
* @param string $filtermode filter mode (AND or OR)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
{
|
||||
@ -1151,7 +1150,7 @@ class BookKeeping extends CommonObject
|
||||
foreach ($filter as $key => $value) {
|
||||
if ($key == 't.doc_date') {
|
||||
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
|
||||
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
||||
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=' || $key == 't.doc_date>' || $key == 't.doc_date<') {
|
||||
$sqlwhere[] = $key."'".$this->db->idate($value)."'";
|
||||
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
|
||||
$sqlwhere[] = $key."'".$this->db->escape($value)."'";
|
||||
@ -1667,7 +1666,9 @@ class BookKeeping extends CommonObject
|
||||
$this->doc_type = $obj->doc_type;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$this->date_export = $this->db->jdate($obj->date_export);
|
||||
if ($mode != "_tmp") {
|
||||
$this->date_export = $this->db->jdate($obj->date_export);
|
||||
}
|
||||
$this->date_validation = $this->db->jdate($obj->date_validation);
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
@ -1764,7 +1765,9 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_modification = $obj->date_modification;
|
||||
$line->date_export = $obj->date_export;
|
||||
if ($mode != "_tmp") {
|
||||
$line->date_export = $obj->date_export;
|
||||
}
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesmvt[] = $line;
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Home closure page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Home customer journalization page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Home expense report ventilation
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
* \brief Home accounting module
|
||||
*/
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -42,7 +44,7 @@ if ($user->socid > 0) {
|
||||
if (!isModEnabled('accounting')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
*/
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
* \brief Page with sells journal
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page of a journal
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -51,7 +52,7 @@ if ($result > 0) {
|
||||
} elseif ($result < 0) {
|
||||
dol_print_error('', $object->error, $object->errors);
|
||||
} elseif ($result == 0) {
|
||||
accessforbidden($langs->trans('ErrorRecordNotFound'));
|
||||
accessforbidden('ErrorRecordNotFound');
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('globaljournal', $object->nature.'journal'));
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Home supplier journalization page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $formatexportset ùust be defined
|
||||
// $formatexportset must be defined
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
@ -24,11 +24,11 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE;
|
||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||
$siren = $conf->global->MAIN_INFO_SIREN;
|
||||
$code = getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE');
|
||||
$prefix = getDolGlobalString('ACCOUNTING_EXPORT_PREFIX_SPEC');
|
||||
$format = getDolGlobalString('ACCOUNTING_EXPORT_FORMAT');
|
||||
$nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
|
||||
$siren = getDolGlobalString('MAIN_INFO_SIREN');
|
||||
|
||||
$date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
* \brief Page to setup the module Foundation
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
* \brief Page to setup the module Foundation
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Page to setup extra fields of members
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
* \brief Page to setup extra fields of members
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief File of main public page for member module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -58,6 +59,7 @@ if ($action == 'update') {
|
||||
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
|
||||
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
||||
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC');
|
||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
||||
@ -65,6 +67,7 @@ if ($action == 'update') {
|
||||
$res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
||||
if ($forcetype < 0) {
|
||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
||||
@ -167,10 +170,30 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print $enabledisablehtml;
|
||||
print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC) ? 0 : 1).'">';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print '<br>';
|
||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
$entity_qr = '?entity='.$conf->entity;
|
||||
} else {
|
||||
$entity_qr = '';
|
||||
}
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$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="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '</div>';
|
||||
print ajax_autoselect('publicurlmember');
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -216,6 +239,13 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// SHow counter of validated members publicly
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("MemberCountersArePublic");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Jump to an online payment page
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
@ -223,13 +253,13 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
$listofval = array();
|
||||
$listofval['-1'] = $langs->trans('No');
|
||||
$listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';
|
||||
if (!empty($conf->paybox->enabled)) {
|
||||
if (isModEnabled('paybox')) {
|
||||
$listofval['paybox'] = 'Paybox';
|
||||
}
|
||||
if (!empty($conf->paypal->enabled)) {
|
||||
if (isModEnabled('paypal')) {
|
||||
$listofval['paypal'] = 'PayPal';
|
||||
}
|
||||
if (!empty($conf->stripe->enabled)) {
|
||||
if (isModEnabled('stripe')) {
|
||||
$listofval['stripe'] = 'Stripe';
|
||||
}
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) ? $conf->global->MEMBER_NEWFORM_PAYONLINE : ''), 0);
|
||||
@ -248,29 +278,6 @@ print dol_get_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print '<br>';
|
||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
|
||||
if (!empty($conf->multicompany->enabled)) {
|
||||
$entity_qr = '?entity='.$conf->entity;
|
||||
} else {
|
||||
$entity_qr = '';
|
||||
}
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$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="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '</div>';
|
||||
print ajax_autoselect('publicurlmember');
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Page of members events
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -65,7 +65,7 @@ abstract class ActionsAdherentCardCommon
|
||||
|
||||
/*if (is_object($this->object) && method_exists($this->object,'fetch'))
|
||||
{
|
||||
if (! empty($id)) $this->object->fetch($id);
|
||||
if (!empty($id)) $this->object->fetch($id);
|
||||
}
|
||||
else
|
||||
{*/
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012-2022 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -124,7 +124,7 @@ if (!empty($this->control->tpl['action_delete'])) {
|
||||
if (empty($user->socid)) {
|
||||
echo '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
* \brief Page of a member
|
||||
*/
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -44,9 +46,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal"));
|
||||
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
@ -105,10 +110,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
// Security check
|
||||
@ -241,7 +246,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && !$cancel && $user->rights->adherent->creer) {
|
||||
if ($action == 'update' && !$cancel && $user->hasRight('adherent', 'creer')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$birthdate = '';
|
||||
@ -416,7 +421,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'add' && $user->rights->adherent->creer) {
|
||||
if ($action == 'add' && $user->hasRight('adherent', 'creer')) {
|
||||
if ($canvas) {
|
||||
$object->canvas = $canvas;
|
||||
}
|
||||
@ -624,7 +629,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes') {
|
||||
if ($user->hasRight('adherent', 'creer') && $action == 'confirm_valid' && $confirm == 'yes') {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
@ -849,7 +854,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') {
|
||||
if ($user->hasRight('adherent', 'creer') && $action == 'confirm_add_spip' && $confirm == 'yes') {
|
||||
if (!count($object->errors)) {
|
||||
if (!$mailmanspip->add_to_spip($object)) {
|
||||
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
|
||||
@ -862,7 +867,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->adherent->dir_output;
|
||||
$permissiontoadd = $user->rights->adherent->creer;
|
||||
$permissiontoadd = $user->hasRight('adherent', 'creer');
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
@ -1217,7 +1222,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print $adht->getNomUrl(1);
|
||||
@ -1815,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Third party Dolibarr
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr><td>';
|
||||
$editenable = $user->rights->adherent->creer;
|
||||
$editenable = $user->hasRight('adherent', 'creer');
|
||||
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($action == 'editthirdparty') {
|
||||
@ -1852,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
|
||||
$editenable = $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer;
|
||||
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($action == 'editlogin') {
|
||||
@ -1896,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Send card by email
|
||||
// TODO Remove this to replace with a template
|
||||
/*
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
if ($object->email) print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a>\n";
|
||||
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a>\n";
|
||||
@ -1908,7 +1913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}*/
|
||||
|
||||
// Modify
|
||||
if (!empty($user->rights->adherent->creer)) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||
@ -1916,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Validate
|
||||
if (Adherent::STATUS_DRAFT == $object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n";
|
||||
@ -1925,7 +1930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Reactivate
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\n";
|
||||
@ -2017,7 +2022,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed = $user->rights->adherent->lire;
|
||||
$delallowed = $user->rights->adherent->creer;
|
||||
$delallowed = $user->hasRight('adherent', 'creer');
|
||||
|
||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
@ -339,8 +339,8 @@ class Adherent extends CommonObject
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
|
||||
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150),
|
||||
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153),
|
||||
'note_private' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
||||
'note_public' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
|
||||
'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
||||
'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
|
||||
'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165),
|
||||
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175),
|
||||
@ -667,6 +667,8 @@ class Adherent extends CommonObject
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$nbrowsaffected = 0;
|
||||
$error = 0;
|
||||
|
||||
@ -1108,7 +1110,7 @@ class Adherent extends CommonObject
|
||||
// Mise a jour
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
|
||||
$sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."'";
|
||||
//if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||
//if (!empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||
if ($isencrypted) {
|
||||
$sql .= ", pass = null";
|
||||
} else {
|
||||
@ -2061,7 +2063,7 @@ class Adherent extends CommonObject
|
||||
$err = 0;
|
||||
|
||||
// mailman
|
||||
if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) {
|
||||
if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) {
|
||||
$result = $mailmanspip->add_to_mailman($this);
|
||||
|
||||
if ($result < 0) {
|
||||
@ -2081,7 +2083,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
// spip
|
||||
if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) {
|
||||
if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) {
|
||||
$result = $mailmanspip->add_to_spip($this);
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $mailmanspip->error;
|
||||
@ -2132,7 +2134,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) {
|
||||
if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) {
|
||||
$result = $mailmanspip->del_to_spip($this);
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $mailmanspip->error;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
|
||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2020 Thibault FOUCART<support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 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
|
||||
@ -286,7 +286,7 @@ class Members extends DolibarrApi
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
// Check mandatory fields
|
||||
@ -311,7 +311,7 @@ class Members extends DolibarrApi
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ class Subscriptions extends DolibarrApi
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \ingroup societe
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -87,10 +88,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
$permissiontoadd = $canaddmember;
|
||||
@ -186,8 +187,8 @@ if ($id > 0) {
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$modulepart = 'member';
|
||||
$permissiontoadd = $user->rights->adherent->creer;
|
||||
$permtoedit = $user->rights->adherent->creer;
|
||||
$permissiontoadd = $user->hasRight('adherent', 'creer');
|
||||
$permtoedit = $user->hasRight('adherent', 'creer');
|
||||
$param = '&id='.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
print "<br><br>";
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief Export page htpasswd of the membership file
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
|
||||
|
||||
@ -27,19 +27,24 @@
|
||||
* \brief Home page of membership module
|
||||
*/
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "members"));
|
||||
|
||||
|
||||
$hookmanager = new HookManager($db);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('membersindex'));
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "members"));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent');
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page fiche LDAP adherent
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
|
||||
@ -62,10 +63,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
// Security check
|
||||
|
||||
@ -27,14 +27,20 @@
|
||||
* \brief Page to list all members of foundation
|
||||
*/
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("members", "companies"));
|
||||
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
@ -42,6 +48,8 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
|
||||
|
||||
|
||||
// Search fields
|
||||
$search = GETPOST("search", 'alpha');
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_lastname = GETPOST("search_lastname", 'alpha');
|
||||
@ -224,7 +232,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Close
|
||||
if ($massaction == 'close' && $user->rights->adherent->creer) {
|
||||
if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) {
|
||||
$tmpmember = new Adherent($db);
|
||||
$error = 0;
|
||||
$nbclose = 0;
|
||||
@ -254,7 +262,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Create external user
|
||||
if ($massaction == 'createexternaluser' && $user->rights->adherent->creer && $user->rights->user->user->creer) {
|
||||
if ($massaction == 'createexternaluser' && $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
|
||||
$tmpmember = new Adherent($db);
|
||||
$error = 0;
|
||||
$nbcreated = 0;
|
||||
@ -294,7 +302,7 @@ if (empty($reshook)) {
|
||||
$objectlabel = 'Members';
|
||||
$permissiontoread = $user->rights->adherent->lire;
|
||||
$permissiontodelete = $user->rights->adherent->supprimer;
|
||||
$permissiontoadd = $user->rights->adherent->creer;
|
||||
$permissiontoadd = $user->hasRight('adherent', 'creer');
|
||||
$uploaddir = $conf->adherent->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
@ -342,7 +350,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
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) && $search_categ > 0) || !empty($catid)) {
|
||||
if ((!empty($search_categ) && ($search_categ > 0 || $search_categ == -2)) || !empty($catid)) {
|
||||
// We need this table joined to the select in order to filter by categ
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member";
|
||||
}
|
||||
@ -609,7 +617,7 @@ $arrayofmassactions = array(
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
|
||||
}
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
@ -618,7 +626,7 @@ if ($user->rights->adherent->supprimer) {
|
||||
if ($user->rights->societe->creer) {
|
||||
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||
}
|
||||
if ($user->rights->adherent->creer && $user->rights->user->user->creer) {
|
||||
if ($user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
|
||||
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
|
||||
@ -627,7 +635,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$newcardbutton = '';
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
|
||||
}
|
||||
|
||||
@ -1122,9 +1130,9 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Country
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||
print '<td class="center">';
|
||||
$tmparray = getCountry($obj->country, 'all');
|
||||
print $tmparray['label'];
|
||||
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($tmparray['label']).'">';
|
||||
print dol_escape_htmltag($tmparray['label']);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -23,26 +23,35 @@
|
||||
* \brief Tab for note of a member
|
||||
*/
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.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';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "members", "bills"));
|
||||
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alphanohtml');
|
||||
|
||||
|
||||
// Initialize objects
|
||||
$object = new Adherent($db);
|
||||
|
||||
$result = $object->fetch($id);
|
||||
if ($result > 0) {
|
||||
$adht = new AdherentType($db);
|
||||
$result = $adht->fetch($object->typeid);
|
||||
}
|
||||
|
||||
$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
$permissionnote = $user->hasRight('adherent', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Fetch object
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
@ -62,10 +71,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('membernote'));
|
||||
@ -120,7 +129,7 @@ if ($id) {
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.dol_escape_htmltag($object->login).'</td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
@ -134,10 +143,10 @@ if ($id) {
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
@ -146,7 +155,7 @@ if ($id) {
|
||||
|
||||
|
||||
$cssclass = 'titlefield';
|
||||
$permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
|
||||
$permission = $user->hasRight('adherent', 'creer'); // Used by the include of notes.tpl.php
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page with statistics on members
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page with geographical statistics on members
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief Page of subscription members statistics
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php';
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
* \brief tab for Adding, editing, deleting a member's memberships
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -112,10 +113,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
// Security check
|
||||
@ -594,7 +595,7 @@ if ($rowid > 0) {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||
print '</td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
|
||||
if ($action != 'editthirdparty' && $user->hasRight('adherent', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -636,7 +637,7 @@ if ($rowid > 0) {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrUser");
|
||||
print '</td>';
|
||||
if ($action != 'editlogin' && $user->rights->adherent->creer) {
|
||||
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
|
||||
print '<td class="right">';
|
||||
if ($user->rights->user->user->creer) {
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||
@ -1072,7 +1073,7 @@ if ($rowid > 0) {
|
||||
|
||||
// Payment mode
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200');
|
||||
print $form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200', 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Date of payment
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page to add/edit/remove a member subscription
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page with information of subscriptions of a member
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief list of subscription
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
* \brief Member's type setup
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
@ -178,6 +179,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->caneditamount = $caneditamount;
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note = trim($comment);
|
||||
@ -752,7 +754,7 @@ if ($rowid > 0) {
|
||||
|
||||
// Actions
|
||||
print '<td class="center">';
|
||||
if ($user->rights->adherent->creer) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
@ -828,6 +830,10 @@ if ($rowid > 0) {
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).'</td><td>';
|
||||
print $form->selectyesno("caneditamount", $object->caneditamount);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print $form->selectyesno("vote", $object->vote, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Page fiche LDAP members types
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Member translation page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Vcard tab of a member
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
@ -53,10 +54,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Define variables to determine what the current user can do on the members
|
||||
$canaddmember = $user->rights->adherent->creer;
|
||||
$canaddmember = $user->hasRight('adherent', 'creer');
|
||||
// Define variables to determine what the current user can do on the properties of a member
|
||||
if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
$caneditfieldmember = $user->hasRight('adherent', 'creer');
|
||||
}
|
||||
|
||||
// Security check
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Setup page to configure accountant / auditor
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Setup page to configure accounting module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2022 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
|
||||
@ -24,6 +25,7 @@
|
||||
* \brief Autocreate actions for agenda module setup page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
@ -184,7 +186,7 @@ if (!empty($triggers)) {
|
||||
}
|
||||
|
||||
//print 'module='.$module.' code='.$trigger['code'].'<br>';
|
||||
if (isModEnabled('module')) {
|
||||
if (isModEnabled($module)) {
|
||||
// Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED
|
||||
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
|
||||
continue;
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Page to setup extra fields of agenda
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Page to setup external calendars for agenda module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Autocreate actions for agenda module setup page
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page to setup agenda reminder options
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Page to setup miscellaneous options of agenda module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Page to setup extra fields of bank
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
118
htdocs/admin/bankline_extrafields.php
Normal file
118
htdocs/admin/bankline_extrafields.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2022 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file admin/bankline_extrafields.php
|
||||
* \ingroup bank
|
||||
* \brief Page to setup extra fields of bankline
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "companies", "bills", "other", "banks"));
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = [];
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'bank'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$help_url = '';
|
||||
$page_name = "BankSetupModule";
|
||||
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
|
||||
$head = bank_admin_prepare_head(null);
|
||||
|
||||
print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/*
|
||||
* Edition of an optional field
|
||||
*/
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Page to setup barcode module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Setup page of module BOM
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* \brief Page to setup extra fields of BOM
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief Page to setup boxes
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Page to setup the bank module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* \brief Page to setup module ClickToDial
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
@ -35,8 +36,8 @@ if (!$user->admin) {
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
if (!in_array('clicktodial', $conf->modules)) {
|
||||
accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
|
||||
if (!isModEnabled('clicktodial')) {
|
||||
accessforbidden($langs->transnoentitiesnoconv("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +108,7 @@ print '* https://myphoneserver/phoneurl?login=__LOGIN__&password=__PASS__&caller
|
||||
print '* sip:__PHONETO__@my.sip.server';
|
||||
print '</span>';
|
||||
|
||||
//if (! empty($user->clicktodial_url))
|
||||
//if (!empty($user->clicktodial_url))
|
||||
//{
|
||||
print '<br>';
|
||||
print info_admin($langs->trans("ValueOverwrittenByUserSetup"));
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
* \brief Setup page of module Order
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
@ -644,7 +645,7 @@ if ($conf->banque->enabled) {
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax)) {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
|
||||
} else {
|
||||
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) {
|
||||
@ -664,7 +665,7 @@ if ($conf->banque->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax)) {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
|
||||
} else {
|
||||
if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
* \brief Page to setup extra fields of reception
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
* \brief Setup page to configure company/foundation
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
* \brief Setup page to configure company social networks
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
* \brief Page to setup accountancy module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
@ -146,7 +147,7 @@ print "</tr>\n";
|
||||
print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
|
||||
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
|
||||
// Write info on way to count VAT
|
||||
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
|
||||
//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE))
|
||||
//{
|
||||
// // print "<br>\n";
|
||||
// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
* \brief Page to setup sending module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
* \brief Admin page to define miscellaneous constants
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
* \brief Setup page of module Contracts
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
* \brief Page to setup DAV server
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
|
||||
@ -76,14 +77,14 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
$head = dav_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'webdav', '', -1, 'action');
|
||||
print dol_get_fiche_head($head, 'webdav', '', -1, '');
|
||||
|
||||
if ($action == 'edit') {
|
||||
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 '<table class="noborder centpercent">';
|
||||
print '<table class="noborder centpercent nomarginbottom">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
@ -96,7 +97,7 @@ if ($action == 'edit') {
|
||||
$label = $langs->trans($key);
|
||||
if ($key == 'DAV_RESTICT_ON_IP') {
|
||||
$label = $langs->trans("RESTRICT_ON_IP");
|
||||
$label .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
|
||||
$tooltiphelp .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
|
||||
}
|
||||
print $form->textwithpicto($label, $tooltiphelp);
|
||||
print '</td><td>';
|
||||
@ -119,19 +120,19 @@ if ($action == 'edit') {
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<table class="noborder centpercent nomarginbottom">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
print '<tr class="oddeven"><td class="titlefieldmiddle">';
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
$label = $langs->trans($key);
|
||||
if ($key == 'DAV_RESTICT_ON_IP') {
|
||||
$label = $langs->trans("RESTRICT_ON_IP");
|
||||
$label .= ' <span class="opacitymedium">'.$langs->trans("Example").': '.$langs->trans("IPListExample").'</span>';
|
||||
$tooltiphelp .= ' <span class="opacitymedium">'.$langs->trans("Example").': '.$langs->trans("IPListExample").'</span>';
|
||||
}
|
||||
print $form->textwithpicto($label, $tooltiphelp);
|
||||
print '</td><td>';
|
||||
print '</td><td class="minwidth200">';
|
||||
if ($key == 'DAV_ALLOW_PRIVATE_DIR') {
|
||||
print $langs->trans("AlwaysActive");
|
||||
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user