Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_develop_sub_BOM
This commit is contained in:
commit
b5b7281094
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@ -116,13 +116,13 @@ a process to follow to optimize the chance to have PRs merged efficiently...
|
|||||||
|
|
||||||
Also, some code changes need a prior approbation:
|
Also, some code changes need a prior approbation:
|
||||||
|
|
||||||
* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-yoda in your issue) to see if such a library can be accepted.
|
* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted.
|
||||||
|
|
||||||
* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-yoda) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest.
|
* if you add a new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted.
|
||||||
|
|
||||||
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
|
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
|
||||||
|
|
||||||
If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion).
|
If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of the PR (but it can be analyzed for discussion).
|
||||||
|
|
||||||
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
|
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
|
||||||
|
|
||||||
|
|||||||
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,18 +1,18 @@
|
|||||||
# Instructions
|
# Instructions
|
||||||
*This is a template to help you make good pull requests. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*
|
*This is a template to help you make good pull requests. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*
|
||||||
*Please:*
|
*Please:*
|
||||||
- *only keep the "Fix", "Close" or "New" section*
|
- *only keep the "FIX", "CLOSE" or "NEW" section* (use uppercase to have the PR appears into the ChangeLog, lowercase will not appears)
|
||||||
- *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)*
|
- *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)*
|
||||||
- *replace the bracket enclosed texts with meaningful information*
|
- *replace the bracket enclosed texts with meaningful information*
|
||||||
|
|
||||||
|
|
||||||
# Fix #[*issue_number Short description*]
|
# FIX|Fix #[*issue_number Short description*]
|
||||||
[*Long description*]
|
[*Long description*]
|
||||||
|
|
||||||
|
|
||||||
# Close #[*issue_number Short description*]
|
# CLOSE|Close #[*issue_number Short description*]
|
||||||
[*Long description*]
|
[*Long description*]
|
||||||
|
|
||||||
|
|
||||||
# New [*Short description*]
|
# NEW|New [*Short description*]
|
||||||
[*Long description*]
|
[*Long description*]
|
||||||
|
|||||||
70
ChangeLog
70
ChangeLog
@ -2,6 +2,63 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||||
|
|
||||||
|
For developers:
|
||||||
|
---------------
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
||||||
|
* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale.
|
||||||
|
* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param).
|
||||||
|
* The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
|
||||||
|
|
||||||
|
FIX: #18698 Supplier invoice list - "alert" checkbox not working
|
||||||
|
FIX: #18735
|
||||||
|
FIX: #18767 : Member delete
|
||||||
|
FIX: #18854
|
||||||
|
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
|
||||||
|
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
|
||||||
|
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
|
||||||
|
FIX: Accountancy - Option of export popup are inverted
|
||||||
|
FIX: Accountancy - Some correction on export name
|
||||||
|
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
|
||||||
|
FIX: add warehouse in projects' overview count
|
||||||
|
FIX: autocalculation of the supplier price in main currency.
|
||||||
|
FIX: avoid warning if $categories is an id
|
||||||
|
FIX: Bad use of a forced contact of another company on PDF/ODT documents
|
||||||
|
FIX: Button text on proposal card to create a invoice
|
||||||
|
FIX: calculateCosts of BOM must not be included into fetch
|
||||||
|
FIX: check if greater 0
|
||||||
|
FIX: default language defined for IN country
|
||||||
|
FIX: fetch of product with modulebuilder load too much data
|
||||||
|
FIX: Filter on categories
|
||||||
|
FIX: indentation
|
||||||
|
FIX: init hookmanager after loading $conf values
|
||||||
|
FIX: legal issue on expense report pdf (must also show price without tax)
|
||||||
|
FIX: missing filter status=1 on rss feeds
|
||||||
|
FIX: move fetch_optionnal into $ac_static->fetch()
|
||||||
|
FIX: payment using wrong type in takepos when too many payment mode
|
||||||
|
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
|
||||||
|
FIX: products/services card: hidden extrafields were overridden
|
||||||
|
FIX: Propal list - Problem of pagination on date
|
||||||
|
FIX: selected lines on supplier invoice create
|
||||||
|
FIX: Selection of type "people" for membership must hide the company
|
||||||
|
FIX: select list of orders not complete when field type of company is on
|
||||||
|
FIX: support of localtax on expense report
|
||||||
|
FIX: task time: can't filter by user with pgsql + show error message
|
||||||
|
FIX: task time: keep on using natural_search
|
||||||
|
FIX: Test when date of invoie is in future (pb with TZ and offset)
|
||||||
|
FIX: translation into email for member at membership validation.
|
||||||
|
FIX: unprivileged user can see task associated with a not allowed project
|
||||||
|
FIX: user without permission can set ticket subject
|
||||||
|
|
||||||
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
||||||
|
|
||||||
FIX: #18353 Invoice list translation issue
|
FIX: #18353 Invoice list translation issue
|
||||||
@ -86,19 +143,6 @@ FIX: using Tulip, deposit mask was not saved
|
|||||||
FIX: #yogosha6907
|
FIX: #yogosha6907
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
|
||||||
|
|
||||||
For developers:
|
|
||||||
---------------
|
|
||||||
|
|
||||||
WARNING:
|
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
|
||||||
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
|
||||||
* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
|
|||||||
@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Multi-Users and groups with finely grained rights
|
- Multi-Users and groups with finely grained rights
|
||||||
- Multi-Currency
|
- Multi-Currency
|
||||||
- Multi-Company (by adding of an external module)
|
- Multi-Company (by adding of an external module)
|
||||||
|
|
||||||
- Very user friendly and easy to use
|
- Very user friendly and easy to use
|
||||||
- customizable Dashboard
|
- customizable Dashboard
|
||||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||||
|
|
||||||
- APIs (REST, SOAP)
|
- APIs (REST, SOAP)
|
||||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||||
|
|
||||||
- Support a lot of country specific features:
|
- Support a lot of country specific features:
|
||||||
- Spanish Tax RE and ISPF
|
- Spanish Tax RE and ISPF
|
||||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||||
@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Compatible with European GDPR rules
|
- Compatible with European GDPR rules
|
||||||
- ...
|
- ...
|
||||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||||
- …
|
- ...
|
||||||
|
|
||||||
|
|
||||||
### System Environment / Requirements
|
### System Environment / Requirements
|
||||||
|
|||||||
@ -54,12 +54,12 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us
|
|||||||
* $dolibarr_main_prod must be set to 1 into conf.php
|
* $dolibarr_main_prod must be set to 1 into conf.php
|
||||||
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
||||||
* $dolibarr_main_force_https must be set to something else than 0.
|
* $dolibarr_main_force_https must be set to something else than 0.
|
||||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default)
|
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3 into backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default)
|
||||||
* The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools)
|
* The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools)
|
||||||
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
||||||
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
||||||
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
||||||
* CSRF attacks are accepted when using a POST URL, but when using GET URL, they are validated only for creating, updating or deleting data resctricted from pages restricted to admin users.
|
* CSRF attacks are accepted but double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3.
|
||||||
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
|
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
|
||||||
|
|
||||||
Scope is the web application (back office) and the APIs.
|
Scope is the web application (back office) and the APIs.
|
||||||
|
|||||||
@ -57,7 +57,6 @@ RUN echo "host mail" >> /etc/msmtprc
|
|||||||
RUN echo "from local@localdomain.com" >> /etc/msmtprc
|
RUN echo "from local@localdomain.com" >> /etc/msmtprc
|
||||||
RUN echo "domain localhost.localdomain" >> /etc/msmtprc
|
RUN echo "domain localhost.localdomain" >> /etc/msmtprc
|
||||||
RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
|
RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
|
||||||
RUN echo "localhost localhost.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal-pod
|
- internal-pod
|
||||||
- external-pod
|
- external-pod
|
||||||
|
extra_hosts:
|
||||||
|
- "localhost.localdomain:127.0.0.1"
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
image: maildev/maildev
|
image: maildev/maildev
|
||||||
|
|||||||
@ -188,7 +188,10 @@ with:
|
|||||||
with
|
with
|
||||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||||
|
|
||||||
|
* Fix php fatal error on php 8.0 on tcpdi.php
|
||||||
|
while (list($k, $v) = each($value[1])) {
|
||||||
|
with
|
||||||
|
foreach ($value[1] as $k => $v) {
|
||||||
|
|
||||||
JSGANTT:
|
JSGANTT:
|
||||||
--------
|
--------
|
||||||
|
|||||||
@ -171,7 +171,10 @@ if [ $res -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s "$mydir/initdemopostsql.sql" ]; then
|
if [ -s "$mydir/initdemopostsql.sql" ]; then
|
||||||
|
echo A file initdemopostsql.sql was found, we execute it.
|
||||||
mysql -P$port $base < "$mydir/initdemopostsql.sql"
|
mysql -P$port $base < "$mydir/initdemopostsql.sql"
|
||||||
|
else
|
||||||
|
echo No file initdemopostsql.sql found, we extra sql action done.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` (
|
|||||||
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||||
`affect` int(11) NOT NULL,
|
`affect` int(11) NOT NULL,
|
||||||
`delay` int(11) NOT NULL,
|
`delay` int(11) NOT NULL,
|
||||||
`newByMonth` double(8,5) NOT NULL DEFAULT 0.00000,
|
`newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
|
||||||
`fk_country` int(11) DEFAULT NULL,
|
`fk_country` int(11) DEFAULT NULL,
|
||||||
`active` int(11) DEFAULT 1,
|
`active` int(11) DEFAULT 1,
|
||||||
PRIMARY KEY (`rowid`),
|
PRIMARY KEY (`rowid`),
|
||||||
|
|||||||
@ -195,7 +195,7 @@ if (empty($reshook)) {
|
|||||||
} elseif ($action == 'enable' && $permissiontoadd) {
|
} elseif ($action == 'enable' && $permissiontoadd) {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$mode = GETPOST('mode', 'int');
|
$mode = GETPOST('mode', 'int');
|
||||||
$result = $accounting->account_activate($id, $mode);
|
$result = $accounting->accountActivate($id, $mode);
|
||||||
}
|
}
|
||||||
$action = 'update';
|
$action = 'update';
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) {
|
|||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
} else {
|
} else {
|
||||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
$sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||||
|
|
||||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -138,7 +138,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) {
|
|||||||
} else {
|
} else {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS);
|
||||||
|
|
||||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||||
$result2 = $db->query($sql);
|
$result2 = $db->query($sql);
|
||||||
@ -260,7 +260,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
// autosuggest from existing account types if found
|
// autosuggest from existing account types if found
|
||||||
print '<datalist id="pcg_type_datalist">';
|
print '<datalist id="pcg_type_datalist">';
|
||||||
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
$sql = "SELECT DISTINCT pcg_type FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||||
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
||||||
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
||||||
$sql .= ' LIMIT 50000'; // just as a sanity check
|
$sql .= ' LIMIT 50000'; // just as a sanity check
|
||||||
|
|||||||
@ -811,7 +811,7 @@ if ($resql) {
|
|||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
if ($canbemodified) {
|
if ($canbemodified) {
|
||||||
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,12 +186,28 @@ if ($action == 'update') {
|
|||||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||||
$ko++;
|
$ko++;
|
||||||
} else {
|
} else {
|
||||||
$db->begin();
|
$sql = '';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
|
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
|
||||||
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
|
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
|
||||||
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
$resql_exists = $db->query($sql_exists);
|
||||||
|
if (!$resql_exists) {
|
||||||
|
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
|
||||||
|
$ko++;
|
||||||
|
} else {
|
||||||
|
$nb_exists = $db->num_rows($resql_exists);
|
||||||
|
if ($nb_exists <= 0) {
|
||||||
|
// insert
|
||||||
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
|
||||||
|
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
||||||
|
} else {
|
||||||
|
$obj_exists = $db->fetch_object($resql_exists);
|
||||||
|
// update
|
||||||
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
|
||||||
|
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
|
||||||
|
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
|
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
|
||||||
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||||
@ -199,6 +215,9 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$ok++;
|
$ok++;
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|||||||
@ -439,13 +439,13 @@ if ($resql) {
|
|||||||
$e = '';
|
$e = '';
|
||||||
// Customer
|
// Customer
|
||||||
if ($obj->type == 1) {
|
if ($obj->type == 1) {
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
} elseif ($obj->type == 2) {
|
} elseif ($obj->type == 2) {
|
||||||
// Supplier
|
// Supplier
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
} elseif ($obj->type == 3) {
|
} elseif ($obj->type == 3) {
|
||||||
// User
|
// User
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
}
|
}
|
||||||
print $e;
|
print $e;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|||||||
@ -430,7 +430,7 @@ if ($action != 'export_csv') {
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$accounting_account.'</td>';
|
print '<td>'.$accounting_account.'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($opening_balance, 'MT')).'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$urlzoom = '';
|
$urlzoom = '';
|
||||||
@ -444,9 +444,9 @@ if ($action != 'export_csv') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Debit
|
// Debit
|
||||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->debit, 'MT')).'</a></td>';
|
||||||
// Credit
|
// Credit
|
||||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->credit, 'MT')).'</a></td>';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||||
@ -467,10 +467,10 @@ if ($action != 'export_csv') {
|
|||||||
if (!empty($show_subgroup)) {
|
if (!empty($show_subgroup)) {
|
||||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
|
||||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||||
} else {
|
} else {
|
||||||
@ -482,10 +482,10 @@ if ($action != 'export_csv') {
|
|||||||
|
|
||||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
|
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
|
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
|
||||||
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
|
print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||||
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -433,7 +433,7 @@ if ($action == 'create') {
|
|||||||
print $langs->trans('Docdate');
|
print $langs->trans('Docdate');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdate') {
|
if ($action != 'editdate') {
|
||||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
@ -460,7 +460,7 @@ if ($action == 'create') {
|
|||||||
print $langs->trans('Codejournal');
|
print $langs->trans('Codejournal');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editjournal') {
|
if ($action != 'editjournal') {
|
||||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
@ -487,7 +487,7 @@ if ($action == 'create') {
|
|||||||
print $langs->trans('Piece');
|
print $langs->trans('Piece');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdocref') {
|
if ($action != 'editdocref') {
|
||||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
|
|||||||
@ -591,7 +591,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
|
|
||||||
if (!empty($accountancyexport->errors)) {
|
if (!empty($accountancyexport->errors)) {
|
||||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||||
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||||
// Specify as export : update field date_export or date_validated
|
// Specify as export : update field date_export or date_validated
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -602,17 +602,18 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
|
|
||||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||||
$sql .= " SET";
|
$sql .= " SET";
|
||||||
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
|
||||||
$sql .= " date_export = '".$db->idate($now)."'";
|
$sql .= " date_export = '".$db->idate($now)."'";
|
||||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||||
} elseif (!$notifiedexportdate) {
|
} elseif (!empty($notifiedexportdate)) {
|
||||||
$sql .= " date_export = '".$db->idate($now)."'";
|
$sql .= " date_export = '".$db->idate($now)."'";
|
||||||
} elseif (!$notifiedvalidationdate) {
|
} elseif (!empty($notifiedvalidationdate)) {
|
||||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -914,7 +914,8 @@ class AccountancyExport
|
|||||||
print "ValidDate".$separator;
|
print "ValidDate".$separator;
|
||||||
print "Montantdevise".$separator;
|
print "Montantdevise".$separator;
|
||||||
print "Idevise".$separator;
|
print "Idevise".$separator;
|
||||||
print "DateLimitReglmt";
|
print "DateLimitReglmt".$separator;
|
||||||
|
print "NumFacture".$separator;
|
||||||
print $end_line;
|
print $end_line;
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
@ -927,6 +928,22 @@ class AccountancyExport
|
|||||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||||
|
|
||||||
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
|
// Customer invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
$invoice = new Facture($db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref;
|
||||||
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
|
// Supplier invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
$invoice = new FactureFournisseur($db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref_supplier;
|
||||||
|
}
|
||||||
|
|
||||||
// FEC:JournalCode
|
// FEC:JournalCode
|
||||||
print $line->code_journal . $separator;
|
print $line->code_journal . $separator;
|
||||||
|
|
||||||
@ -984,6 +1001,9 @@ class AccountancyExport
|
|||||||
// FEC_suppl:DateLimitReglmt
|
// FEC_suppl:DateLimitReglmt
|
||||||
print $date_limit_payment;
|
print $date_limit_payment;
|
||||||
|
|
||||||
|
// FEC_suppl:NumFacture
|
||||||
|
print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator;
|
||||||
|
|
||||||
print $end_line;
|
print $end_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1020,7 +1040,8 @@ class AccountancyExport
|
|||||||
print "ValidDate".$separator;
|
print "ValidDate".$separator;
|
||||||
print "Montantdevise".$separator;
|
print "Montantdevise".$separator;
|
||||||
print "Idevise".$separator;
|
print "Idevise".$separator;
|
||||||
print "DateLimitReglmt";
|
print "DateLimitReglmt".$separator;
|
||||||
|
print "NumFacture".$separator;
|
||||||
print $end_line;
|
print $end_line;
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
@ -1033,6 +1054,22 @@ class AccountancyExport
|
|||||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||||
|
|
||||||
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
|
// Customer invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
$invoice = new Facture($db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref;
|
||||||
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
|
// Supplier invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
$invoice = new FactureFournisseur($db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref_supplier;
|
||||||
|
}
|
||||||
|
|
||||||
// FEC:JournalCode
|
// FEC:JournalCode
|
||||||
print $line->code_journal . $separator;
|
print $line->code_journal . $separator;
|
||||||
|
|
||||||
@ -1090,6 +1127,10 @@ class AccountancyExport
|
|||||||
// FEC_suppl:DateLimitReglmt
|
// FEC_suppl:DateLimitReglmt
|
||||||
print $date_limit_payment;
|
print $date_limit_payment;
|
||||||
|
|
||||||
|
// FEC_suppl:NumFacture
|
||||||
|
print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator;
|
||||||
|
|
||||||
|
|
||||||
print $end_line;
|
print $end_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,9 @@
|
|||||||
* \brief File of class to manage accounting accounts
|
* \brief File of class to manage accounting accounts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
/**
|
/**
|
||||||
* Class to manage accounting accounts
|
* Class to manage accounting accounts
|
||||||
*/
|
*/
|
||||||
@ -140,6 +143,11 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $reconcilable;
|
public $reconcilable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array cache array
|
||||||
|
*/
|
||||||
|
private $accountingaccount_codetotid_cache = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -225,8 +233,8 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Insert new accounting account in chart of accounts
|
* Insert new accounting account in chart of accounts
|
||||||
*
|
*
|
||||||
* @param User $user User making action
|
* @param User $user User making action
|
||||||
* @param int $notrigger Disable triggers
|
* @param int $notrigger Disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
@ -259,7 +267,7 @@ class AccountingAccount extends CommonObject
|
|||||||
// Put here code to add control on parameters values
|
// Put here code to add control on parameters values
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_account(";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
|
||||||
$sql .= "datec";
|
$sql .= "datec";
|
||||||
$sql .= ", entity";
|
$sql .= ", entity";
|
||||||
$sql .= ", fk_pcg_version";
|
$sql .= ", fk_pcg_version";
|
||||||
@ -293,11 +301,11 @@ class AccountingAccount extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = "Error ".$this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_account");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account");
|
||||||
|
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action to call a trigger.
|
// want this action to call a trigger.
|
||||||
@ -313,8 +321,8 @@ class AccountingAccount extends CommonObject
|
|||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
foreach ($this->errors as $errmsg) {
|
foreach ($this->errors as $errmsg) {
|
||||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR);
|
||||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1 * $error;
|
return -1 * $error;
|
||||||
@ -327,7 +335,7 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Update record
|
* Update record
|
||||||
*
|
*
|
||||||
* @param User $user Use making update
|
* @param User $user Use making update
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function update($user)
|
public function update($user)
|
||||||
@ -339,18 +347,18 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
$sql .= " SET fk_pcg_version = ".($this->fk_pcg_version ? "'".$this->db->escape($this->fk_pcg_version)."'" : "null");
|
$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
|
||||||
$sql .= " , pcg_type = ".($this->pcg_type ? "'".$this->db->escape($this->pcg_type)."'" : "null");
|
$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
|
||||||
$sql .= " , account_number = '".$this->db->escape($this->account_number)."'";
|
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
|
||||||
$sql .= " , account_parent = ".(int) $this->account_parent;
|
$sql .= " , account_parent = " . (int) $this->account_parent;
|
||||||
$sql .= " , label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "''");
|
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''");
|
||||||
$sql .= " , labelshort = ".($this->labelshort ? "'".$this->db->escape($this->labelshort)."'" : "''");
|
$sql .= " , labelshort = " . ($this->labelshort ? "'" . $this->db->escape($this->labelshort) . "'" : "''");
|
||||||
$sql .= " , fk_accounting_category = ".(empty($this->account_category) ? 0 : (int) $this->account_category);
|
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||||
$sql .= " , fk_user_modif = ".((int) $user->id);
|
$sql .= " , fk_user_modif = " . ((int) $user->id);
|
||||||
$sql .= " , active = ".(int) $this->active;
|
$sql .= " , active = " . (int) $this->active;
|
||||||
$sql .= " , reconcilable = ".(int) $this->reconcilable;
|
$sql .= " , reconcilable = " . (int) $this->reconcilable;
|
||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = " . ((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -413,22 +421,22 @@ class AccountingAccount extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_account";
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||||
$sql .= " WHERE rowid=".((int) $this->id);
|
$sql .= " WHERE rowid=" . ((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delete sql=".$sql);
|
dol_syslog(get_class($this) . "::delete sql=" . $sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = "Error ".$this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
foreach ($this->errors as $errmsg) {
|
foreach ($this->errors as $errmsg) {
|
||||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
|
||||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1 * $error;
|
return -1 * $error;
|
||||||
@ -444,20 +452,20 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return clicable name (with picto eventually)
|
||||||
*
|
*
|
||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||||
* @param int $withlabel 0=No label, 1=Include label of account
|
* @param int $withlabel 0=No label, 1=Include label of account
|
||||||
* @param int $nourl 1=Disable url
|
* @param int $nourl 1=Disable url
|
||||||
* @param string $moretitle Add more text to title tooltip
|
* @param string $moretitle Add more text to title tooltip
|
||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
||||||
* @param string $option 'ledger', 'journals', 'accountcard'
|
* @param string $option 'ledger', 'journals', 'accountcard'
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
|
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
if (!empty($conf->dol_no_mouse_hover)) {
|
if (!empty($conf->dol_no_mouse_hover)) {
|
||||||
$notooltip = 1; // Force disable tooltips
|
$notooltip = 1; // Force disable tooltips
|
||||||
@ -465,15 +473,16 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$url = ''; $labelurl = '';
|
$url = '';
|
||||||
|
$labelurl = '';
|
||||||
if (empty($option) || $option == 'ledger') {
|
if (empty($option) || $option == 'ledger') {
|
||||||
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
|
||||||
$labelurl = $langs->trans("ShowAccountingAccountInLedger");
|
$labelurl = $langs->trans("ShowAccountingAccountInLedger");
|
||||||
} elseif ($option == 'journals') {
|
} elseif ($option == 'journals') {
|
||||||
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
|
||||||
$labelurl = $langs->trans("ShowAccountingAccountInJournals");
|
$labelurl = $langs->trans("ShowAccountingAccountInJournals");
|
||||||
} elseif ($option == 'accountcard') {
|
} elseif ($option == 'accountcard') {
|
||||||
$url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id);
|
$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . urlencode($this->id);
|
||||||
$labelurl = $langs->trans("ShowAccountingAccount");
|
$labelurl = $langs->trans("ShowAccountingAccount");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,29 +504,29 @@ class AccountingAccount extends CommonObject
|
|||||||
$labeltoshow = $this->labelshort;
|
$labeltoshow = $this->labelshort;
|
||||||
}
|
}
|
||||||
|
|
||||||
$label = '<u>'.$labelurl.'</u>';
|
$label = '<u>' . $labelurl . '</u>';
|
||||||
if (!empty($this->account_number)) {
|
if (!empty($this->account_number)) {
|
||||||
$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
|
$label .= '<br><b>' . $langs->trans('AccountAccounting') . ':</b> ' . length_accountg($this->account_number);
|
||||||
}
|
}
|
||||||
if (!empty($labeltoshow)) {
|
if (!empty($labeltoshow)) {
|
||||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
|
$label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $labeltoshow;
|
||||||
}
|
}
|
||||||
if ($moretitle) {
|
if ($moretitle) {
|
||||||
$label .= ' - '.$moretitle;
|
$label .= ' - ' . $moretitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkclose = '';
|
$linkclose = '';
|
||||||
if (empty($notooltip)) {
|
if (empty($notooltip)) {
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
$label = $labelurl;
|
$label = $labelurl;
|
||||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
|
||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
|
||||||
$linkclose .= ' class="classfortooltip"';
|
$linkclose .= ' class="classfortooltip"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkstart = '<a href="'.$url.'"';
|
$linkstart = '<a href="' . $url . '"';
|
||||||
$linkstart .= $linkclose.'>';
|
$linkstart .= $linkclose . '>';
|
||||||
$linkend = '</a>';
|
$linkend = '</a>';
|
||||||
|
|
||||||
if ($nourl) {
|
if ($nourl) {
|
||||||
@ -528,17 +537,17 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
$label_link = length_accountg($this->account_number);
|
$label_link = length_accountg($this->account_number);
|
||||||
if ($withlabel) {
|
if ($withlabel) {
|
||||||
$label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$labeltoshow.($nourl ? '</span>' : '');
|
$label_link .= ' - ' . ($nourl ? '<span class="opacitymedium">' : '') . $labeltoshow . ($nourl ? '</span>' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
$result .= ($linkstart.img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend);
|
$result .= ($linkstart . img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . $linkend);
|
||||||
}
|
}
|
||||||
if ($withpicto && $withpicto != 2) {
|
if ($withpicto && $withpicto != 2) {
|
||||||
$result .= ' ';
|
$result .= ' ';
|
||||||
}
|
}
|
||||||
if ($withpicto != 2) {
|
if ($withpicto != 2) {
|
||||||
$result .= $linkstart.$label_link.$linkend;
|
$result .= $linkstart . $label_link . $linkend;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -552,10 +561,10 @@ class AccountingAccount extends CommonObject
|
|||||||
public function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as a';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
||||||
$sql .= ' WHERE a.rowid = '.((int) $id);
|
$sql .= ' WHERE a.rowid = ' . ((int) $id);
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::info sql='.$sql);
|
dol_syslog(get_class($this) . '::info sql=' . $sql);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -584,8 +593,8 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Deactivate an account (for status active or status reconcilable)
|
* Deactivate an account (for status active or status reconcilable)
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @param int $mode 0=field active, 1=field reconcilable
|
* @param int $mode 0=field active, 1=field reconcilable
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function accountDeactivate($id, $mode = 0)
|
public function accountDeactivate($id, $mode = 0)
|
||||||
@ -620,15 +629,15 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Account activated
|
* Account activated
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @param int $mode 0=field active, 1=field reconcilable
|
* @param int $mode 0=field active, 1=field reconcilable
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function account_activate($id, $mode = 0)
|
public function accountActivate($id, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -654,12 +663,11 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne le libelle du statut d'un user (actif, inactif)
|
* Retourne le libelle du statut d'un user (actif, inactif)
|
||||||
*
|
*
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
public function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
@ -670,9 +678,9 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $status Id status
|
* @param int $status Id status
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
public function LibStatut($status, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
@ -694,9 +702,9 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
} elseif ($mode == 2) {
|
} elseif ($mode == 2) {
|
||||||
if ($status == 1) {
|
if ($status == 1) {
|
||||||
return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled');
|
||||||
} elseif ($status == 0) {
|
} elseif ($status == 0) {
|
||||||
return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
} elseif ($mode == 3) {
|
} elseif ($mode == 3) {
|
||||||
if ($status == 1) {
|
if ($status == 1) {
|
||||||
@ -706,15 +714,173 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
} elseif ($mode == 4) {
|
} elseif ($mode == 4) {
|
||||||
if ($status == 1) {
|
if ($status == 1) {
|
||||||
return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled');
|
||||||
} elseif ($status == 0) {
|
} elseif ($status == 0) {
|
||||||
return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
} elseif ($mode == 5) {
|
} elseif ($mode == 5) {
|
||||||
if ($status == 1) {
|
if ($status == 1) {
|
||||||
return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
|
return $langs->trans('Enabled') . ' ' . img_picto($langs->trans('Enabled'), 'statut4');
|
||||||
} elseif ($status == 0) {
|
} elseif ($status == 0) {
|
||||||
return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
|
return $langs->trans('Disabled') . ' ' . img_picto($langs->trans('Disabled'), 'statut5');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return Suggest accounting accounts to bind
|
||||||
|
*
|
||||||
|
* @param Societe $buyer Societe Object Buyers
|
||||||
|
* @param $seller Company Object seller
|
||||||
|
* @param Product $product Product object sell or buy
|
||||||
|
* @param Facture $facture Facture
|
||||||
|
* @param FactureLigne $factureDet Facture Det
|
||||||
|
* @param array $accountingAccount array of Account account
|
||||||
|
*
|
||||||
|
* @return array Accounting accounts suggested
|
||||||
|
*/
|
||||||
|
public function getAccountingCodeToBind(Societe $buyer, $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array())
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
global $hookmanager;
|
||||||
|
|
||||||
|
// Instantiate hooks for external modules
|
||||||
|
$hookmanager->initHooks(array('accoutancyBindingCalculation'));
|
||||||
|
|
||||||
|
// Execute hook accoutancyBindingCalculation
|
||||||
|
$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount);
|
||||||
|
$reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||||
|
$isBuyerInEEC = isInEEC($buyer);
|
||||||
|
$isSellerInEEC = isInEEC($seller);
|
||||||
|
$code_sell_l = '';
|
||||||
|
$code_sell_p = '';
|
||||||
|
$code_sell_t = '';
|
||||||
|
$suggestedid = '';
|
||||||
|
|
||||||
|
// Level 1: Search suggested default account for product/service
|
||||||
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
|
if ($factureDet->product_type == 1) {
|
||||||
|
if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
|
} else {
|
||||||
|
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
|
} else { // Foreign sale
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($factureDet->product_type == 0) {
|
||||||
|
if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
|
} else {
|
||||||
|
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
|
} else {
|
||||||
|
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($code_sell_l == -1) {
|
||||||
|
$code_sell_l = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||||
|
$suggestedaccountingaccountfor = '';
|
||||||
|
if ((($buyer->country_code == $seller->country_code) || empty($buyer->country_code)) && !empty($product->accountancy_code_sell)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
|
$code_sell_p = $product->accountancy_code_sell;
|
||||||
|
$suggestedid = $accountingAccount['dom'];
|
||||||
|
$suggestedaccountingaccountfor = 'prodserv';
|
||||||
|
} else {
|
||||||
|
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0 && !empty($product->accountancy_code_sell)) { // European intravat sale, but with VAT
|
||||||
|
$code_sell_p = $product->accountancy_code_sell;
|
||||||
|
$suggestedid = $accountingAccount['dom'];
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra) && !empty($product->accountancy_code_sell)) { // European intravat sale, without VAT intra community number
|
||||||
|
$code_sell_p = $product->accountancy_code_sell;
|
||||||
|
$suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { // European intravat sale
|
||||||
|
$code_sell_p = $product->accountancy_code_sell_intra;
|
||||||
|
$suggestedid = $accountingAccount['intra'];
|
||||||
|
$suggestedaccountingaccountfor = 'eec';
|
||||||
|
} elseif (!empty($product->accountancy_code_sell_export)) { // Foreign sale
|
||||||
|
$code_sell_p = $product->accountancy_code_sell_export;
|
||||||
|
$suggestedid = $accountingAccount['export'];
|
||||||
|
$suggestedaccountingaccountfor = 'export';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||||
|
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||||
|
if (!empty($buyer->code_compta)) {
|
||||||
|
$code_sell_t = $buyer->code_compta;
|
||||||
|
$suggestedid = $accountingAccount['thirdparty'];
|
||||||
|
$suggestedaccountingaccountfor = 'thridparty';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Manage Deposit
|
||||||
|
if ($factureDet->desc == "(DEPOSIT)") {
|
||||||
|
$accountdeposittoventilated = new self($this->db);
|
||||||
|
$result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||||
|
if ($result < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$code_sell_l = $accountdeposittoventilated->ref;
|
||||||
|
$suggestedid = $accountdeposittoventilated->rowid;
|
||||||
|
$suggestedaccountingaccountfor = 'deposit';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($suggestedid) && empty($code_sell_p) && !empty($code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
|
||||||
|
if (empty($this->accountingaccount_codetotid_cache[$code_sell_l])) {
|
||||||
|
$tmpaccount = new self($this->db);
|
||||||
|
$result = $tmpaccount->fetch(0, $code_sell_l, 1);
|
||||||
|
if ($result < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if ($tmpaccount->id > 0) {
|
||||||
|
$suggestedid = $tmpaccount->id;
|
||||||
|
}
|
||||||
|
$this->accountingaccount_codetotid_cache[$code_sell_l] = $tmpaccount->id;
|
||||||
|
} else {
|
||||||
|
$suggestedid = $this->accountingaccount_codetotid_cache[$code_sell_l];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array(
|
||||||
|
'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor,
|
||||||
|
'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor,
|
||||||
|
'suggestedid' => $suggestedid,
|
||||||
|
'code_sell_l' => $code_sell_l,
|
||||||
|
'code_sell_p' => $code_sell_p,
|
||||||
|
'code_sell_t' => $code_sell_t,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) {
|
||||||
|
return $hookmanager->resArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||||
@ -46,6 +47,7 @@ if (!$user->rights->accounting->bind->write) {
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$accountingAccount = new AccountingAccount($db);
|
||||||
|
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
if (GETPOST("year", 'int')) {
|
if (GETPOST("year", 'int')) {
|
||||||
@ -172,35 +174,75 @@ if ($action == 'validatehistory') {
|
|||||||
|
|
||||||
$isSellerInEEC = isInEEC($mysoc);
|
$isSellerInEEC = isInEEC($mysoc);
|
||||||
|
|
||||||
|
$thirdpartystatic = new Societe($db);
|
||||||
|
$facture_static = new Facture($db);
|
||||||
|
$facture_static_det = new FactureLigne($db);
|
||||||
|
$product_static = new Product($db);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$isBuyerInEEC = isInEEC($objp); // This make a database request but there is a cache into $conf->cache['country_code_in_EEC']
|
$thirdpartystatic->id = $objp->socid;
|
||||||
|
$thirdpartystatic->name = $objp->name;
|
||||||
|
$thirdpartystatic->client = $objp->client;
|
||||||
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
$thirdpartystatic->code_client = $objp->code_client;
|
||||||
|
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||||
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
|
$thirdpartystatic->email = $objp->email;
|
||||||
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||||
|
$thirdpartystatic->code_compta = $objp->company_code_sell;
|
||||||
|
|
||||||
// Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
$product_static->ref = $objp->product_ref;
|
||||||
$suggestedaccountingaccountfor = '';
|
$product_static->id = $objp->product_id;
|
||||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
$product_static->type = $objp->type;
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$product_static->label = $objp->product_label;
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$product_static->status = $objp->status;
|
||||||
$suggestedaccountingaccountfor = '';
|
$product_static->status_buy = $objp->status_buy;
|
||||||
|
$product_static->accountancy_code_sell = $objp->code_sell;
|
||||||
|
$product_static->accountancy_code_sell_intra = $objp->code_sell_intra;
|
||||||
|
$product_static->accountancy_code_sell_export = $objp->code_sell_export;
|
||||||
|
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||||
|
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||||
|
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||||
|
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||||
|
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||||
|
|
||||||
|
$facture_static->ref = $objp->ref;
|
||||||
|
$facture_static->id = $objp->facid;
|
||||||
|
$facture_static->type = $objp->ftype;
|
||||||
|
$facture_static->datef = $objp->datef;
|
||||||
|
|
||||||
|
$facture_static_det->id = $objp->rowid;
|
||||||
|
$facture_static_det->total_ht = $objp->total_ht;
|
||||||
|
$facture_static_det->tva_tx = $objp->tva_tx_line;
|
||||||
|
$facture_static_det->vat_src_code = $objp->vat_src_code;
|
||||||
|
$facture_static_det->product_type = $objp->type_l;
|
||||||
|
$facture_static_det->desc = $objp->description;
|
||||||
|
|
||||||
|
$accoutinAccountArray = array(
|
||||||
|
'dom'=>$objp->aarowid,
|
||||||
|
'intra'=>$objp->aarowid_intra,
|
||||||
|
'export'=>$objp->aarowid_export,
|
||||||
|
'thirdparty' =>$objp->aarowid_thirdparty);
|
||||||
|
|
||||||
|
$code_sell_p_notset = '';
|
||||||
|
$code_sell_t_notset = '';
|
||||||
|
|
||||||
|
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray);
|
||||||
|
if (!is_array($return) && $return<0) {
|
||||||
|
setEventMessage($accountingAccount->error, 'errors');
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
$suggestedid=$return['suggestedid'];
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
|
||||||
$suggestedaccountingaccountfor = 'eecwithvat';
|
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
$suggestedid=$return['suggestedid'];
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
} else {
|
||||||
$objp->aarowid_suggest = 0; // There is a doubt, no automatic binding
|
$suggestedid=0;
|
||||||
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
|
||||||
$objp->code_sell_p = $objp->code_sell_intra;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
|
||||||
$suggestedaccountingaccountfor = 'eec';
|
|
||||||
} else { // Foreign sale
|
|
||||||
$objp->code_sell_p = $objp->code_sell_export;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
|
||||||
$suggestedaccountingaccountfor = 'export';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,8 +257,8 @@ if ($action == 'validatehistory') {
|
|||||||
|
|
||||||
if ($objp->aarowid_suggest > 0) {
|
if ($objp->aarowid_suggest > 0) {
|
||||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||||
$sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest);
|
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
|
||||||
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $objp->rowid);
|
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id);
|
||||||
|
|
||||||
$resqlupdate = $db->query($sqlupdate);
|
$resqlupdate = $db->query($sqlupdate);
|
||||||
if (!$resqlupdate) {
|
if (!$resqlupdate) {
|
||||||
|
|||||||
@ -191,7 +191,14 @@ print '<script type="text/javascript">
|
|||||||
*/
|
*/
|
||||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
|
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
|
||||||
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
$sql .= " s.rowid as socid, s.nom as name, s.code_client,";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta_client,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
|
} else {
|
||||||
|
$sql .= " s.code_compta as code_compta_client,";
|
||||||
|
$sql .= " s.code_compta_fournisseur,";
|
||||||
|
}
|
||||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label,";
|
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label,";
|
||||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||||
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
|
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
|
||||||
@ -201,7 +208,7 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " aa.rowid as fk_compte, aa.account_number, aa.label as label_account, aa.labelshort as labelshort_account,";
|
$sql .= " aa.rowid as fk_compte, aa.account_number, aa.label as label_account, aa.labelshort as labelshort_account,";
|
||||||
$sql .= " fd.situation_percent,";
|
$sql .= " fd.situation_percent,";
|
||||||
$sql .= " co.code as country_code, co.label as country,";
|
$sql .= " co.code as country_code, co.label as country,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -213,6 +220,9 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||||
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||||
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
||||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||||
|
|||||||
@ -45,6 +45,7 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
|
||||||
// Select Box
|
// Select Box
|
||||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||||
@ -96,6 +97,7 @@ if (!$sortorder) {
|
|||||||
$hookmanager->initHooks(array('accountancycustomerlist'));
|
$hookmanager->initHooks(array('accountancycustomerlist'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
$accountingAccount = new AccountingAccount($db);
|
||||||
|
|
||||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||||
|
|
||||||
@ -238,10 +240,14 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur,";
|
||||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta_client,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
$sql .= " spe.accountancy_code_sell as company_code_sell";
|
$sql .= " spe.accountancy_code_sell as company_code_sell";
|
||||||
} else {
|
} else {
|
||||||
|
$sql .= " s.code_compta as code_compta_client,";
|
||||||
|
$sql .= " s.code_compta_fournisseur,";
|
||||||
$sql .= " s.accountancy_code_sell as company_code_sell";
|
$sql .= " s.accountancy_code_sell as company_code_sell";
|
||||||
}
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -510,17 +516,17 @@ if ($result) {
|
|||||||
|
|
||||||
$thirdpartystatic = new Societe($db);
|
$thirdpartystatic = new Societe($db);
|
||||||
$facture_static = new Facture($db);
|
$facture_static = new Facture($db);
|
||||||
|
$facture_static_det = new FactureLigne($db);
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
$isSellerInEEC = isInEEC($mysoc);
|
|
||||||
|
|
||||||
$accountingaccount_codetotid_cache = array();
|
$accountingaccount_codetotid_cache = array();
|
||||||
|
|
||||||
while ($i < min($num_lines, $limit)) {
|
while ($i < min($num_lines, $limit)) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$objp->code_sell_l = '';
|
$code_sell_l = '';
|
||||||
$objp->code_sell_p = '';
|
$code_sell_p = '';
|
||||||
|
|
||||||
$thirdpartystatic->id = $objp->socid;
|
$thirdpartystatic->id = $objp->socid;
|
||||||
$thirdpartystatic->name = $objp->name;
|
$thirdpartystatic->name = $objp->name;
|
||||||
@ -532,6 +538,8 @@ if ($result) {
|
|||||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
$thirdpartystatic->email = $objp->email;
|
$thirdpartystatic->email = $objp->email;
|
||||||
$thirdpartystatic->country_code = $objp->country_code;
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||||
|
$thirdpartystatic->code_compta = $objp->company_code_sell;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
@ -545,146 +553,84 @@ if ($result) {
|
|||||||
$product_static->accountancy_code_buy = $objp->code_buy;
|
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||||
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||||
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||||
|
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||||
|
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||||
|
|
||||||
$facture_static->ref = $objp->ref;
|
$facture_static->ref = $objp->ref;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
$facture_static->type = $objp->ftype;
|
$facture_static->type = $objp->ftype;
|
||||||
|
$facture_static->datef = $objp->datef;
|
||||||
|
|
||||||
|
$facture_static_det->id = $objp->rowid;
|
||||||
|
$facture_static_det->total_ht = $objp->total_ht;
|
||||||
|
$facture_static_det->tva_tx = $objp->tva_tx_line;
|
||||||
|
$facture_static_det->vat_src_code = $objp->vat_src_code;
|
||||||
|
$facture_static_det->product_type = $objp->type_l;
|
||||||
|
$facture_static_det->desc = $objp->description;
|
||||||
|
|
||||||
|
$accoutinAccountArray = array(
|
||||||
|
'dom'=>$objp->aarowid,
|
||||||
|
'intra'=>$objp->aarowid_intra,
|
||||||
|
'export'=>$objp->aarowid_export,
|
||||||
|
'thirdparty' =>$objp->aarowid_thirdparty);
|
||||||
|
|
||||||
$code_sell_p_notset = '';
|
$code_sell_p_notset = '';
|
||||||
$code_sell_t_notset = '';
|
$code_sell_t_notset = '';
|
||||||
$objp->aarowid_suggest = ''; // Will be set later
|
|
||||||
|
|
||||||
$isBuyerInEEC = isInEEC($objp);
|
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray);
|
||||||
|
if (!is_array($return) && $return<0) {
|
||||||
// Level 1: Search suggested default account for product/service
|
setEventMessage($accountingAccount->error, 'errors');
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
|
||||||
if ($objp->type_l == 1) {
|
|
||||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
|
||||||
} else {
|
|
||||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
|
||||||
} else { // Foreign sale
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif ($objp->type_l == 0) {
|
|
||||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
|
||||||
} else {
|
|
||||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
|
||||||
} else {
|
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : '');
|
|
||||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($objp->code_sell_l == -1) {
|
|
||||||
$objp->code_sell_l = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
|
||||||
$suggestedaccountingaccountfor = '';
|
|
||||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
|
||||||
$suggestedaccountingaccountfor = '';
|
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
$suggestedid=$return['suggestedid'];
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor'];
|
||||||
$suggestedaccountingaccountfor = 'eecwithvat';
|
$code_sell_l=$return['code_sell_l'];
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
$code_sell_p=$return['code_sell_p'];
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$code_sell_t=$return['code_sell_t'];
|
||||||
$objp->aarowid_suggest = $objp->aarowid; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
|
|
||||||
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
|
||||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
|
||||||
$objp->code_sell_p = $objp->code_sell_intra;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
|
||||||
$suggestedaccountingaccountfor = 'eec';
|
|
||||||
} else { // Foreign sale
|
|
||||||
$objp->code_sell_p = $objp->code_sell_export;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
|
||||||
$suggestedaccountingaccountfor = 'export';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//var_dump($return);
|
||||||
|
|
||||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
if (!empty($code_sell_p)) {
|
||||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
|
||||||
if (!empty($objp->company_code_sell)) {
|
|
||||||
$objp->code_sell_t = $objp->company_code_sell;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
|
||||||
$suggestedaccountingaccountfor = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage Deposit
|
|
||||||
if ($objp->description == "(DEPOSIT)") {
|
|
||||||
$accountdeposittoventilated = new AccountingAccount($db);
|
|
||||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
|
||||||
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
|
||||||
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($objp->code_sell_p)) {
|
|
||||||
// Value was defined previously
|
// Value was defined previously
|
||||||
} else {
|
} else {
|
||||||
$code_sell_p_notset = 'color:orange';
|
$code_sell_p_notset = 'color:orange';
|
||||||
}
|
}
|
||||||
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) {
|
if (empty($code_sell_l) && empty($code_sell_p)) {
|
||||||
$code_sell_p_notset = 'color:red';
|
$code_sell_p_notset = 'color:red';
|
||||||
}
|
}
|
||||||
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) {
|
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) {
|
||||||
$code_sell_p_notset = 'color:orange';
|
$code_sell_p_notset = 'color:orange';
|
||||||
}
|
}
|
||||||
|
|
||||||
// $objp->code_sell_l is now default code of product/service
|
// $code_sell_l is now default code of product/service
|
||||||
// $objp->code_sell_p is now code of product/service
|
// $code_sell_p is now code of product/service
|
||||||
// $objp->code_sell_t is now code of thirdparty
|
// $code_sell_t is now code of thirdparty
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Line id
|
// Line id
|
||||||
print '<td>'.$objp->rowid.'</td>';
|
print '<td>'.$facture_static_det->id.'</td>';
|
||||||
|
|
||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
print '<td class="nowraponall">'.$facture_static->getNomUrl(1).'</td>';
|
print '<td class="nowraponall">'.$facture_static->getNomUrl(1).'</td>';
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($facture_static->datef), 'day').'</td>';
|
||||||
|
|
||||||
// Ref Product
|
// Ref Product
|
||||||
print '<td class="tdoverflowmax150">';
|
print '<td class="tdoverflowmax150">';
|
||||||
if ($product_static->id > 0) {
|
if ($product_static->id > 0) {
|
||||||
print $product_static->getNomUrl(1);
|
print $product_static->getNomUrl(1);
|
||||||
}
|
}
|
||||||
if ($objp->product_label) {
|
if ($product_static->label) {
|
||||||
print '<br><span class="opacitymedium small">'.$objp->product_label.'</span>';
|
print '<br><span class="opacitymedium small">'.$product_static->label.'</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="tdoverflowonsmartphone small">';
|
print '<td class="tdoverflowonsmartphone small">';
|
||||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc));
|
||||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right nowraponall amount">';
|
print '<td class="right nowraponall amount">';
|
||||||
@ -692,11 +638,12 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Vat rate
|
// Vat rate
|
||||||
if ($objp->vat_tx_l != $objp->vat_tx_p) {
|
$code_vat_differ='';
|
||||||
|
if ($product_static->tva_tx !== $facture_static_det->tva_tx && ! empty($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||||
}
|
}
|
||||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : ''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
@ -713,18 +660,18 @@ if ($result) {
|
|||||||
|
|
||||||
// Found accounts
|
// Found accounts
|
||||||
print '<td class="small">';
|
print '<td class="small">';
|
||||||
$s = '1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
$s = '1. '.(($facture_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
|
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
|
||||||
$shelp .= $langs->trans("SaleEEC");
|
$shelp .= $langs->trans("SaleEEC");
|
||||||
} elseif ($suggestedaccountingaccountbydefaultfor == 'export') {
|
} elseif ($suggestedaccountingaccountbydefaultfor == 'export') {
|
||||||
$shelp .= $langs->trans("SaleExport");
|
$shelp .= $langs->trans("SaleExport");
|
||||||
}
|
}
|
||||||
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
$s .= ($code_sell_l > 0 ? length_accountg($code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||||
if ($objp->product_id > 0) {
|
if ($product_static->id > 0) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
$s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||||
$shelp = ''; $ttype = 'help';
|
$shelp = ''; $ttype = 'help';
|
||||||
if ($suggestedaccountingaccountfor == 'eec') {
|
if ($suggestedaccountingaccountfor == 'eec') {
|
||||||
$shelp = $langs->trans("SaleEEC");
|
$shelp = $langs->trans("SaleEEC");
|
||||||
@ -736,7 +683,7 @@ if ($result) {
|
|||||||
} elseif ($suggestedaccountingaccountfor == 'export') {
|
} elseif ($suggestedaccountingaccountfor == 'export') {
|
||||||
$shelp = $langs->trans("SaleExport");
|
$shelp = $langs->trans("SaleExport");
|
||||||
}
|
}
|
||||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
$s .= (empty($code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($code_sell_p));
|
||||||
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -747,38 +694,26 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
$s = '3. '.(($facture_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
$s .= ($objp->code_sell_t > 0 ? length_accountg($objp->code_sell_t) : '<span style="'.$code_sell_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
$s .= ($code_sell_t > 0 ? length_accountg($code_sell_t) : '<span style="'.$code_sell_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Suggested accounting account
|
// Suggested accounting account
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$suggestedid = $objp->aarowid_suggest;
|
print $formaccounting->select_account($suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
if (empty($suggestedid) && empty($objp->code_sell_p) && !empty($objp->code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
|
|
||||||
if (empty($accountingaccount_codetotid_cache[$objp->code_sell_l])) {
|
|
||||||
$tmpaccount = new AccountingAccount($db);
|
|
||||||
$tmpaccount->fetch(0, $objp->code_sell_l, 1);
|
|
||||||
if ($tmpaccount->id > 0) {
|
|
||||||
$suggestedid = $tmpaccount->id;
|
|
||||||
}
|
|
||||||
$accountingaccount_codetotid_cache[$objp->code_sell_l] = $tmpaccount->id;
|
|
||||||
} else {
|
|
||||||
$suggestedid = $accountingaccount_codetotid_cache[$objp->code_sell_l];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Column with checkbox
|
// Column with checkbox
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$ischecked = $objp->aarowid_suggest;
|
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
|
||||||
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
$ischecked=1;
|
||||||
|
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||||
$ischecked = 0;
|
$ischecked = 0;
|
||||||
}
|
}
|
||||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="'.$objp->rowid."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facture_static_det->id.'" name="toselect[]" value="'.$facture_static_det->id."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -81,7 +81,12 @@ $help_url = '';
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("AccountancyArea"), $help_url);
|
llxHeader('', $langs->trans("AccountancyArea"), $help_url);
|
||||||
|
|
||||||
if ($conf->accounting->enabled) {
|
if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) {
|
||||||
|
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
||||||
|
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."</span>\n";
|
||||||
|
print "<br>";
|
||||||
|
} elseif ($conf->accounting->enabled) {
|
||||||
$step = 0;
|
$step = 0;
|
||||||
|
|
||||||
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||||
@ -258,7 +263,8 @@ if ($conf->accounting->enabled) {
|
|||||||
} else {
|
} else {
|
||||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("Module10Desc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("Module10Desc")."</span>\n";
|
||||||
|
print "<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -119,7 +119,14 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
|||||||
|
|
||||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
|
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
|
||||||
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
|
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
|
||||||
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,";
|
$sql .= " soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
|
} else {
|
||||||
|
$sql .= " soc.code_compta,";
|
||||||
|
$sql .= " soc.code_compta_fournisseur,";
|
||||||
|
}
|
||||||
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, u.email as useremail, u.statut as userstatus,";
|
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, u.email as useremail, u.statut as userstatus,";
|
||||||
$sql .= " bu2.type as typeop_user,";
|
$sql .= " bu2.type as typeop_user,";
|
||||||
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
|
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
|
||||||
@ -130,6 +137,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid A
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||||
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
||||||
$sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal);
|
$sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal);
|
||||||
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||||
@ -362,7 +372,7 @@ if ($result) {
|
|||||||
|
|
||||||
// Retrieve the accounting code of the social contribution of the payment from link of payment.
|
// Retrieve the accounting code of the social contribution of the payment from link of payment.
|
||||||
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
$sqlmid = "SELECT cchgsoc.accountancy_code";
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
||||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
||||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid";
|
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid";
|
||||||
@ -1019,7 +1029,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
|
|
||||||
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
||||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."bank_account WHERE entity = ".((int) $conf->entity)." AND fk_accountancy_journal IS NULL AND clos=0";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|||||||
@ -105,7 +105,14 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
|||||||
|
|
||||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
||||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur,";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
|
} else {
|
||||||
|
$sql .= " s.code_compta as code_compta,";
|
||||||
|
$sql .= " s.code_compta_fournisseur,";
|
||||||
|
}
|
||||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||||
$sql .= " ppe.accountancy_code_buy,";
|
$sql .= " ppe.accountancy_code_buy,";
|
||||||
} else {
|
} else {
|
||||||
@ -120,6 +127,9 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||||
$sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
|
$sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
|
||||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||||
|
}
|
||||||
$sql .= " WHERE f.fk_statut > 0";
|
$sql .= " WHERE f.fk_statut > 0";
|
||||||
$sql .= " AND fd.fk_code_ventilation > 0";
|
$sql .= " AND fd.fk_code_ventilation > 0";
|
||||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||||
|
|||||||
@ -107,7 +107,14 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
|||||||
|
|
||||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
||||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
|
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur,";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
|
} else {
|
||||||
|
$sql .= " s.code_compta as code_compta,";
|
||||||
|
$sql .= " s.code_compta_fournisseur,";
|
||||||
|
}
|
||||||
$sql .= " p.rowid as pid, p.ref as pref, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
|
$sql .= " p.rowid as pid, p.ref as pref, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
|
||||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||||
$sql .= " ppe.accountancy_code_sell";
|
$sql .= " ppe.accountancy_code_sell";
|
||||||
@ -122,6 +129,9 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||||
$sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
$sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||||
|
}
|
||||||
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
||||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).')'; // We don't share object for accountancy, we use source object sharing
|
$sql .= " AND f.entity IN (".getEntity('invoice', 0).')'; // We don't share object for accountancy, we use source object sharing
|
||||||
$sql .= " AND f.fk_statut > 0";
|
$sql .= " AND f.fk_statut > 0";
|
||||||
|
|||||||
@ -202,7 +202,14 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
|
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
|
||||||
}
|
}
|
||||||
$sql .= " co.code as country_code, co.label as country,";
|
$sql .= " co.code as country_code, co.label as country,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= ", spe.accountancy_code_customer as code_compta_client";
|
||||||
|
$sql .= ", spe.accountancy_code_supplier as code_compta_fournisseur";
|
||||||
|
} else {
|
||||||
|
$sql .= ", s.code_compta as code_compta_client";
|
||||||
|
$sql .= ", s.code_compta_fournisseur";
|
||||||
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -214,6 +221,9 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_facture_fourn";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_facture_fourn";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||||
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||||
// Add search filter like
|
// Add search filter like
|
||||||
|
|||||||
@ -243,10 +243,14 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur,";
|
||||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||||
|
$sql .= " spe.accountancy_code_customer as code_compta_client,";
|
||||||
|
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||||
$sql .= " spe.accountancy_code_buy as company_code_buy";
|
$sql .= " spe.accountancy_code_buy as company_code_buy";
|
||||||
} else {
|
} else {
|
||||||
|
$sql .= " s.code_compta as code_compta_client,";
|
||||||
|
$sql .= " s.code_compta_fournisseur,";
|
||||||
$sql .= " s.accountancy_code_buy as company_code_buy";
|
$sql .= " s.accountancy_code_buy as company_code_buy";
|
||||||
}
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -678,7 +682,7 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Vat rate
|
// Vat rate
|
||||||
if ($objp->vat_tx_l != $objp->vat_tx_p) {
|
if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||||
}
|
}
|
||||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||||
|
|||||||
@ -38,10 +38,12 @@ header('Content-Type: text/csv');
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||||
$accountancyexport = new AccountancyExport($db);
|
$accountancyexport = new AccountancyExport($db);
|
||||||
|
|
||||||
if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger
|
// Specific filename for FEC model export into the general ledger
|
||||||
|
if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2')
|
||||||
|
&& $type_export == "general_ledger") {
|
||||||
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
|
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
|
||||||
if (empty($search_date_end)) {
|
if (empty($search_date_end)) {
|
||||||
// TODO Get the max date into bookeeping table
|
// TODO Get the max date into bookkeeping table
|
||||||
$search_date_end = dol_now();
|
$search_date_end = dol_now();
|
||||||
}
|
}
|
||||||
$datetouseforfilename = $search_date_end;
|
$datetouseforfilename = $search_date_end;
|
||||||
@ -58,7 +60,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
|||||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||||
|
|
||||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||||
$completefilename = "XIMPORT.TXT";
|
$completefilename = "XIMPORT.TXT";
|
||||||
} else {
|
} else {
|
||||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||||
|
|||||||
@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (count($listetype)) {
|
if (count($listetype)) {
|
||||||
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<font class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</font>';
|
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
@ -1907,7 +1907,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if (!empty($user->rights->adherent->creer)) {
|
if (!empty($user->rights->adherent->creer)) {
|
||||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||||
}
|
}
|
||||||
@ -1997,7 +1997,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if ($isinspip == -1) {
|
if ($isinspip == -1) {
|
||||||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
print '<br><br><span class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2012,7 +2012,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Generated documents
|
// Generated documents
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
//$filename = 'tmp_cards.php';
|
|
||||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
$genallowed = $user->rights->adherent->lire;
|
$genallowed = $user->rights->adherent->lire;
|
||||||
@ -2046,14 +2045,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
$MAX = 10;
|
$MAX = 10;
|
||||||
|
|
||||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id.'">';
|
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id);
|
||||||
$morehtmlright .= $langs->trans("SeeAll");
|
|
||||||
$morehtmlright .= '</a>';
|
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlright);
|
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlcenter);
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $day = dol_print_date($now, '%d');
|
|||||||
$foruserid = GETPOST('foruserid', 'alphanohtml');
|
$foruserid = GETPOST('foruserid', 'alphanohtml');
|
||||||
$foruserlogin = GETPOST('foruserlogin', 'alphanohtml');
|
$foruserlogin = GETPOST('foruserlogin', 'alphanohtml');
|
||||||
$mode = GETPOST('mode', 'aZ09');
|
$mode = GETPOST('mode', 'aZ09');
|
||||||
|
$modelcard = GETPOST("modelcard", 'aZ09'); // Doc template to use for business cards
|
||||||
$model = GETPOST("model", 'aZ09'); // Doc template to use for business cards
|
$model = GETPOST("model", 'aZ09'); // Doc template to use for business cards
|
||||||
$modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use for address sheet
|
$modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use for address sheet
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
@ -84,10 +85,10 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||||
if (is_numeric($foruserid)) {
|
if (is_numeric($foruserid)) {
|
||||||
$sql .= " AND d.rowid=".(int) $foruserid;
|
$sql .= " AND d.rowid = ".(int) $foruserid;
|
||||||
}
|
}
|
||||||
if ($foruserlogin) {
|
if ($foruserlogin) {
|
||||||
$sql .= " AND d.login='".$db->escape($foruserlogin)."'";
|
$sql .= " AND d.login = '".$db->escape($foruserlogin)."'";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY d.rowid ASC";
|
$sql .= " ORDER BY d.rowid ASC";
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
'__MONTH__'=>$month,
|
'__MONTH__'=>$month,
|
||||||
'__DAY__'=>$day,
|
'__DAY__'=>$day,
|
||||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
'__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
'__SERVER__'=>"https://".$_SERVER["SERVER_NAME"]."/"
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarray, $langs, $adherentstatic);
|
complete_substitutions_array($substitutionarray, $langs, $adherentstatic);
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
$textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
|
$textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
|
||||||
|
|
||||||
if (is_numeric($foruserid) || $foruserlogin) {
|
if (is_numeric($foruserid) || $foruserlogin) {
|
||||||
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY'];
|
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY']; // $_Avery_Labels is defined into an include
|
||||||
if ($nb <= 0) {
|
if ($nb <= 0) {
|
||||||
$nb = 1; // Protection to avoid empty page
|
$nb = 1; // Protection to avoid empty page
|
||||||
}
|
}
|
||||||
@ -209,7 +210,19 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build and output PDF
|
// Build and output PDF
|
||||||
if (empty($mode) || $mode == 'card' || $mode == 'cardlogin') {
|
$outputlangs = $langs;
|
||||||
|
|
||||||
|
if (empty($mode) || $mode == 'card') {
|
||||||
|
if (!count($arrayofmembers)) {
|
||||||
|
$mesg = $langs->trans("ErrorRecordNotFound");
|
||||||
|
}
|
||||||
|
if (empty($modelcard) || $modelcard == '-1') {
|
||||||
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||||
|
}
|
||||||
|
if (!$mesg) {
|
||||||
|
$result = members_card_pdf_create($db, $arrayofmembers, $modelcard, $outputlangs, '', 'standard', 'tmp_cards');
|
||||||
|
}
|
||||||
|
} elseif ($mode == 'cardlogin') {
|
||||||
if (!count($arrayofmembers)) {
|
if (!count($arrayofmembers)) {
|
||||||
$mesg = $langs->trans("ErrorRecordNotFound");
|
$mesg = $langs->trans("ErrorRecordNotFound");
|
||||||
}
|
}
|
||||||
@ -217,7 +230,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||||
}
|
}
|
||||||
if (!$mesg) {
|
if (!$mesg) {
|
||||||
$result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs);
|
$result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs, '', 'standard', 'tmp_cards_login');
|
||||||
}
|
}
|
||||||
} elseif ($mode == 'label') {
|
} elseif ($mode == 'label') {
|
||||||
if (!count($arrayofmembers)) {
|
if (!count($arrayofmembers)) {
|
||||||
@ -275,7 +288,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
|
|||||||
$arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
|
$arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
|
||||||
}
|
}
|
||||||
asort($arrayoflabels);
|
asort($arrayoflabels);
|
||||||
print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray('modelcard', $arrayoflabels, (GETPOST('modelcard') ? GETPOST('modelcard') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
|
print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -2338,12 +2338,12 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
} elseif ($status == self::STATUS_RESILIATED) {
|
} elseif ($status == self::STATUS_RESILIATED) {
|
||||||
$statusType = 'status6';
|
$statusType = 'status6';
|
||||||
$labelStatus = $langs->trans("MemberStatusResiliated");
|
$labelStatus = $langs->transnoentitiesnoconv("MemberStatusResiliated");
|
||||||
$labelStatusShort = $langs->trans("MemberStatusResiliatedShort");
|
$labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusResiliatedShort");
|
||||||
} elseif ($status == self::STATUS_EXCLUDED) {
|
} elseif ($status == self::STATUS_EXCLUDED) {
|
||||||
$statusType = 'status10';
|
$statusType = 'status10';
|
||||||
$labelStatus = $langs->trans("MemberStatusExcluded");
|
$labelStatus = $langs->transnoentitiesnoconv("MemberStatusExcluded");
|
||||||
$labelStatusShort = $langs->trans("MemberStatusExcludedShort");
|
$labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusExcludedShort");
|
||||||
}
|
}
|
||||||
|
|
||||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
||||||
|
|||||||
@ -737,10 +737,10 @@ class AdherentType extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||||
$this->labelStatus[0] = $langs->trans("ActivityCeased");
|
$this->labelStatus[0] = $langs->transnoentitiesnoconv("ActivityCeased");
|
||||||
$this->labelStatus[1] = $langs->trans("InActivity");
|
$this->labelStatus[1] = $langs->transnoentitiesnoconv("InActivity");
|
||||||
$this->labelStatusShort[0] = $langs->trans("ActivityCeased");
|
$this->labelStatusShort[0] = $langs->transnoentitiesnoconv("ActivityCeased");
|
||||||
$this->labelStatusShort[1] = $langs->trans("InActivity");
|
$this->labelStatusShort[1] = $langs->transnoentitiesnoconv("InActivity");
|
||||||
}
|
}
|
||||||
|
|
||||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||||
|
|||||||
@ -190,7 +190,7 @@ if ($result > 0) {
|
|||||||
|
|
||||||
if (empty($dn)) {
|
if (empty($dn)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
|
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</span></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
$records = $ldap->getAttribute($dn, $search);
|
$records = $ldap->getAttribute($dn, $search);
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ if ($result > 0) {
|
|||||||
// Show tree
|
// Show tree
|
||||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||||
if (!is_array($records)) {
|
if (!is_array($records)) {
|
||||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,40 +161,40 @@ if ($mode) {
|
|||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($mode == 'memberbycountry') {
|
if ($mode == 'memberbycountry') {
|
||||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'code'=>$obj->code,
|
'code'=>$obj->code,
|
||||||
'nb'=>$obj->nb,
|
'nb'=>$obj->nb,
|
||||||
'lastdate'=>$db->jdate($obj->lastdate),
|
'lastdate'=>$db->jdate($obj->lastdate),
|
||||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($mode == 'memberbyregion') { //+
|
if ($mode == 'memberbyregion') { //+
|
||||||
$data[] = array(
|
$data[] = array(
|
||||||
'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label :'<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||||
'nb'=>$obj->nb,
|
'nb'=>$obj->nb,
|
||||||
'lastdate'=>$db->jdate($obj->lastdate),
|
'lastdate'=>$db->jdate($obj->lastdate),
|
||||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($mode == 'memberbystate') {
|
if ($mode == 'memberbystate') {
|
||||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||||
'nb'=>$obj->nb,
|
'nb'=>$obj->nb,
|
||||||
'lastdate'=>$db->jdate($obj->lastdate),
|
'lastdate'=>$db->jdate($obj->lastdate),
|
||||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($mode == 'memberbytown') {
|
if ($mode == 'memberbytown') {
|
||||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||||
'nb'=>$obj->nb,
|
'nb'=>$obj->nb,
|
||||||
'lastdate'=>$db->jdate($obj->lastdate),
|
'lastdate'=>$db->jdate($obj->lastdate),
|
||||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -587,7 +587,7 @@ if ($rowid > 0) {
|
|||||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
|
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
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>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
@ -631,7 +631,7 @@ if ($rowid > 0) {
|
|||||||
if ($action != 'editlogin' && $user->rights->adherent->creer) {
|
if ($action != 'editlogin' && $user->rights->adherent->creer) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($user->rights->user->user->creer) {
|
if ($user->rights->user->user->creer) {
|
||||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ if ($rowid > 0) {
|
|||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($object->statut > 0) {
|
if ($object->statut > 0) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a></div>";
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription&token='.newToken().'">'.$langs->trans("AddSubscription")."</a></div>";
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<!-- BEGIN PHP TEMPLATE -->\n";
|
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedopjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ $total = 0;
|
|||||||
foreach ($linkedObjectBlock as $key => $objectlink) {
|
foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||||
echo '<tr class="oddeven">';
|
echo '<tr class="oddeven">';
|
||||||
echo '<td>'.$langs->trans("Subscription").'</td>';
|
echo '<td>'.$langs->trans("Subscription").'</td>';
|
||||||
echo '<td>'.$objectlink->getNomUrl(1).'</td>';
|
echo '<td class="nowraponall">'.$objectlink->getNomUrl(1).'</td>';
|
||||||
echo '<td class="center"></td>';
|
echo '<td class="center"></td>';
|
||||||
echo '<td class="center">'.dol_print_date($objectlink->dateh, 'day').'</td>';
|
echo '<td class="center">'.dol_print_date($objectlink->dateh, 'day').'</td>';
|
||||||
echo '<td class="right">';
|
echo '<td class="right">';
|
||||||
|
|||||||
@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0) {
|
||||||
|
/*$colspan = 1;
|
||||||
|
foreach ($arrayfields as $key => $val) {
|
||||||
|
if (!empty($val['checked'])) {
|
||||||
|
$colspan++;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$colspan = 8;
|
||||||
|
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -481,12 +494,12 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->adherent->configurer) {
|
if ($user->rights->adherent->configurer) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add
|
// Add
|
||||||
if ($user->rights->adherent->configurer && !empty($object->status)) {
|
if ($user->rights->adherent->configurer && !empty($object->status)) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -728,10 +741,10 @@ if ($rowid > 0) {
|
|||||||
// Actions
|
// Actions
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->rights->adherent->creer) {
|
||||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
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) {
|
if ($user->rights->adherent->supprimer) {
|
||||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
|
|||||||
@ -161,7 +161,7 @@ if ($result > 0) {
|
|||||||
// Show tree
|
// Show tree
|
||||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||||
if (!is_array($records)) {
|
if (!is_array($records)) {
|
||||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,9 +185,9 @@ print "\n<div class=\"tabsAction\">\n";
|
|||||||
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||||
if ($cnt_trans > 0) {
|
if ($cnt_trans > 0) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,10 +91,10 @@ $form = new Form($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit parameters
|
* Edit parameters
|
||||||
|
|||||||
@ -302,7 +302,7 @@ if (!isset($_SERVER['WINDIR'])) {
|
|||||||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
|
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
|
||||||
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<br><font class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</font>';
|
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ if ($conf->product->enabled) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
|
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
|
||||||
|
|
||||||
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
||||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&value='.urlencode($file).'">';
|
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&value='.urlencode($file).'">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|||||||
@ -360,7 +360,7 @@ foreach ($boxtoadd as $box) {
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
if (!count($boxtoadd) && count($boxactivated)) {
|
if (!count($boxtoadd) && count($boxactivated)) {
|
||||||
print '<tr><td class="opacitymedium" colspan="4">'.$langs->trans("AllWidgetsWereEnabled").'</td></tr>';
|
print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("AllWidgetsWereEnabled").'</span></td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -369,7 +369,7 @@ $form = new Form($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ $head = company_admin_prepare_head();
|
|||||||
print dol_get_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company');
|
print dol_get_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -457,7 +457,7 @@ print '</td></tr>'."\n";
|
|||||||
// Email
|
// Email
|
||||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
||||||
print '<input class="maxwidth150" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
print '<input class="width300" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
|
|||||||
@ -133,7 +133,6 @@ foreach ($listofnetworks as $key => $value) {
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print $form->buttonsSaveCancel("Save", '');
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|
||||||
|
|||||||
@ -259,7 +259,7 @@ if ($result) {
|
|||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$obj->name.'</td>'."\n";
|
print '<tr class="oddeven" data-checkbox-id="check_'.$i.'"><td>'.$obj->name.'</td>'."\n";
|
||||||
|
|
||||||
// Value
|
// Value
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -145,7 +145,7 @@ if ($action == 'edit') {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -452,7 +452,7 @@ if ($action == 'edit') {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print '<br><div class="tabsAction">';
|
print '<br><div class="tabsAction">';
|
||||||
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a></div>';
|
print '<a class="butAction" href="delais.php?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI
|
|||||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||||
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||||
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||||
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||||
@ -315,7 +315,7 @@ $tabfield[24] = "code,label";
|
|||||||
$tabfield[25] = "code,label";
|
$tabfield[25] = "code,label";
|
||||||
//$tabfield[26]= "code,label,short_label";
|
//$tabfield[26]= "code,label,short_label";
|
||||||
$tabfield[27] = "code,libelle,picto";
|
$tabfield[27] = "code,libelle,picto";
|
||||||
$tabfield[28] = "code,label,affect,delay,newByMonth,country_id,country";
|
$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
|
||||||
$tabfield[29] = "code,label,percent,position";
|
$tabfield[29] = "code,label,percent,position";
|
||||||
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfield[31]= "pcg_version,label";
|
//$tabfield[31]= "pcg_version,label";
|
||||||
@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label";
|
|||||||
$tabfieldvalue[25] = "code,label";
|
$tabfieldvalue[25] = "code,label";
|
||||||
//$tabfieldvalue[26]= "code,label,short_label";
|
//$tabfieldvalue[26]= "code,label,short_label";
|
||||||
$tabfieldvalue[27] = "code,libelle,picto";
|
$tabfieldvalue[27] = "code,libelle,picto";
|
||||||
$tabfieldvalue[28] = "code,label,affect,delay,newByMonth,country";
|
$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
|
||||||
$tabfieldvalue[29] = "code,label,percent,position";
|
$tabfieldvalue[29] = "code,label,percent,position";
|
||||||
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfieldvalue[31]= "pcg_version,label";
|
//$tabfieldvalue[31]= "pcg_version,label";
|
||||||
@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label";
|
|||||||
$tabfieldinsert[25] = "code,label";
|
$tabfieldinsert[25] = "code,label";
|
||||||
//$tabfieldinsert[26]= "code,label,short_label";
|
//$tabfieldinsert[26]= "code,label,short_label";
|
||||||
$tabfieldinsert[27] = "code,libelle,picto";
|
$tabfieldinsert[27] = "code,libelle,picto";
|
||||||
$tabfieldinsert[28] = "code,label,affect,delay,newByMonth,fk_country";
|
$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
|
||||||
$tabfieldinsert[29] = "code,label,percent,position";
|
$tabfieldinsert[29] = "code,label,percent,position";
|
||||||
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||||
//$tabfieldinsert[31]= "pcg_version,label";
|
//$tabfieldinsert[31]= "pcg_version,label";
|
||||||
@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
|||||||
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
||||||
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||||
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||||
@ -1175,6 +1175,8 @@ if ($id) {
|
|||||||
$sql .= natural_search("r.code_region", $search_code);
|
$sql .= natural_search("r.code_region", $search_code);
|
||||||
} elseif ($search_code != '' && $id == 7) {
|
} elseif ($search_code != '' && $id == 7) {
|
||||||
$sql .= natural_search("a.code", $search_code);
|
$sql .= natural_search("a.code", $search_code);
|
||||||
|
} elseif ($search_code != '' && $id == 10) {
|
||||||
|
$sql .= natural_search("t.code", $search_code);
|
||||||
} elseif ($search_code != '' && $id != 9) {
|
} elseif ($search_code != '' && $id != 9) {
|
||||||
$sql .= natural_search("code", $search_code);
|
$sql .= natural_search("code", $search_code);
|
||||||
}
|
}
|
||||||
@ -1392,7 +1394,7 @@ if ($id) {
|
|||||||
if ($value == 'delay') {
|
if ($value == 'delay') {
|
||||||
$valuetoshow = $langs->trans("NoticePeriod");
|
$valuetoshow = $langs->trans("NoticePeriod");
|
||||||
}
|
}
|
||||||
if ($value == 'newByMonth') {
|
if ($value == 'newbymonth') {
|
||||||
$valuetoshow = $langs->trans("NewByMonth");
|
$valuetoshow = $langs->trans("NewByMonth");
|
||||||
}
|
}
|
||||||
if ($value == 'fk_tva') {
|
if ($value == 'fk_tva') {
|
||||||
@ -1455,6 +1457,10 @@ if ($id) {
|
|||||||
print $tdsoffields;
|
print $tdsoffields;
|
||||||
|
|
||||||
|
|
||||||
|
// Line to enter new values
|
||||||
|
print '<!-- line to add new entry -->';
|
||||||
|
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd')) {
|
if (GETPOST('actionadd')) {
|
||||||
@ -1474,9 +1480,6 @@ if ($id) {
|
|||||||
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
|
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line to enter new values
|
|
||||||
print '<!-- line to add new entry -->';
|
|
||||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
||||||
@ -1737,7 +1740,7 @@ if ($id) {
|
|||||||
if ($value == 'delay') {
|
if ($value == 'delay') {
|
||||||
$valuetoshow = $langs->trans("NoticePeriod");
|
$valuetoshow = $langs->trans("NoticePeriod");
|
||||||
}
|
}
|
||||||
if ($value == 'newByMonth') {
|
if ($value == 'newbymonth') {
|
||||||
$valuetoshow = $langs->trans("NewByMonth");
|
$valuetoshow = $langs->trans("NewByMonth");
|
||||||
}
|
}
|
||||||
if ($value == 'fk_tva') {
|
if ($value == 'fk_tva') {
|
||||||
|
|||||||
@ -232,7 +232,7 @@ class PrestaShopWebservice
|
|||||||
if ($response != '') {
|
if ($response != '') {
|
||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
|
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||||
if (libxml_get_errors()) {
|
if (libxml_get_errors()) {
|
||||||
$msg = var_export(libxml_get_errors(), true);
|
$msg = var_export(libxml_get_errors(), true);
|
||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
|
|||||||
@ -656,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// Delete
|
// Delete
|
||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall">';
|
||||||
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
|
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&token='.newToken().'&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
|
||||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&token='.newToken().'&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
|
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&token='.newToken().'&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -693,14 +693,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Edit
|
// Edit
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Edit").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Edit").'</a></div>';
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=order">'.$langs->trans("ToClone").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=order">'.$langs->trans("ToClone").'</a></div>';
|
||||||
|
|
||||||
// Collect now
|
// Collect now
|
||||||
if (count($object->actions) > 0) {
|
if (count($object->actions) > 0) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect">'.$langs->trans("CollectNow").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect&token='.newToken().'">'.$langs->trans("CollectNow").'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoOperations")).'">'.$langs->trans("CollectNow").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoOperations")).'">'.$langs->trans("CollectNow").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -376,7 +376,7 @@ if ($action == 'edit') {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
} else {
|
} else {
|
||||||
print '<br>'.$langs->trans("NothingToSetup");
|
print '<br>'.$langs->trans("NothingToSetup");
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/eventorganization_extrafields.php
|
* \file htdocs/admin/eventorganization_confbooth_extrafields.php
|
||||||
* \ingroup bom
|
* \ingroup bom
|
||||||
* \brief Page to setup extra fields of EventOrganization
|
* \brief Page to setup extra fields of EventOrganization
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file admin/conferenceorboothattendee_extrafields.php
|
* \file htdocs/admin/eventorganization_confboothattendee_extrafields.php
|
||||||
* \ingroup eventorganization
|
* \ingroup eventorganization
|
||||||
* \brief Page to setup extra fields of conferenceorboothattendee
|
* \brief Page to setup extra fields of conferenceorboothattendee
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -145,7 +145,18 @@ if ($action == 'updateMask') {
|
|||||||
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
|
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
|
||||||
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (!$res1 > 0 || !$res2 > 0) {
|
$res3 = 0;
|
||||||
|
if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
|
||||||
|
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
$dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
|
||||||
|
$res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
|
||||||
|
$res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,6 +469,26 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
|
|||||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
if (!empty($conf->projet->enabled)) {
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans('ProjectIsRequiredOnExpenseReports');
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH) ? 0 : 1, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print $form->buttonsSaveCancel("Save", '');
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
|
|||||||
@ -33,10 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
$langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
||||||
|
|
||||||
if (!$user->admin) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -45,10 +41,20 @@ $ikoffset = GETPOST('ikoffset', 'int');
|
|||||||
$coef = GETPOST('coef', 'int');
|
$coef = GETPOST('coef', 'int');
|
||||||
|
|
||||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
||||||
$fk_range = GETPOST('fk_range');
|
$fk_range = GETPOST('fk_range', 'int');
|
||||||
|
|
||||||
|
$expIk = new ExpenseReportIk($db);
|
||||||
|
|
||||||
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action == 'updateik') {
|
if ($action == 'updateik') {
|
||||||
$expIk = new ExpenseReportIk($db);
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$result = $expIk->fetch($id);
|
$result = $expIk->fetch($id);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -61,13 +67,13 @@ if ($action == 'updateik') {
|
|||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
setEventMessages('SetupSaved', null, 'mesgs');
|
setEventMessages('SetupSaved', null, 'mesgs');
|
||||||
|
|
||||||
header('Location: '.$_SERVER['PHP_SELF']);
|
header('Location: '.$_SERVER['PHP_SELF']);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($expIk->error, $expIk->errors, 'errors');
|
setEventMessages($expIk->error, $expIk->errors, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action == 'delete') { // TODO add confirm
|
} elseif ($action == 'delete') { // TODO add confirm
|
||||||
$expIk = new ExpenseReportIk($db);
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$result = $expIk->fetch($id);
|
$result = $expIk->fetch($id);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -77,12 +83,11 @@ if ($action == 'updateik') {
|
|||||||
$expIk->delete($user);
|
$expIk->delete($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
header('Location: '.$_SERVER['PHP_SELF']);
|
header('Location: '.$_SERVER['PHP_SELF']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rangesbycateg = ExpenseReportIk::getAllRanges();
|
$rangesbycateg = $expIk->getAllRanges();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -102,7 +107,8 @@ print dol_get_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"),
|
|||||||
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportIkDesc').'</span>';
|
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportIkDesc').'</span>';
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
|
echo '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
echo '<input type="hidden" name="id" value="'.$id.'" />';
|
echo '<input type="hidden" name="id" value="'.$id.'" />';
|
||||||
@ -111,8 +117,6 @@ if ($action == 'edit') {
|
|||||||
echo '<input type="hidden" name="action" value="updateik" />';
|
echo '<input type="hidden" name="action" value="updateik" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<input type="hidden" name="token" value="'.newToken().'" />';
|
|
||||||
|
|
||||||
echo '<table class="noborder centpercent">';
|
echo '<table class="noborder centpercent">';
|
||||||
|
|
||||||
foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) {
|
foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) {
|
||||||
|
|||||||
@ -54,7 +54,6 @@ $code_expense_rules_type = GETPOST('code_expense_rules_type');
|
|||||||
$dates = dol_mktime(12, 0, 0, GETPOST('startmonth'), GETPOST('startday'), GETPOST('startyear'));
|
$dates = dol_mktime(12, 0, 0, GETPOST('startmonth'), GETPOST('startday'), GETPOST('startyear'));
|
||||||
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
|
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
|
||||||
$amount = GETPOST('amount');
|
$amount = GETPOST('amount');
|
||||||
$restrictive = GETPOST('restrictive');
|
|
||||||
|
|
||||||
$object = new ExpenseReportRule($db);
|
$object = new ExpenseReportRule($db);
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
@ -138,7 +137,7 @@ if ($action == 'save') {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rules = ExpenseReportRule::getAllRule();
|
$rules = $object->getAllRule();
|
||||||
|
|
||||||
$tab_apply = array(
|
$tab_apply = array(
|
||||||
'A' => $langs->trans('All'),
|
'A' => $langs->trans('All'),
|
||||||
|
|||||||
@ -275,9 +275,9 @@ if ($resql) {
|
|||||||
print "<td>".$langs->trans("Status")."</td>";
|
print "<td>".$langs->trans("Status")."</td>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($result > 0 && empty($rss->error)) {
|
if ($result > 0 && empty($rss->error)) {
|
||||||
print '<font class="ok">'.$langs->trans("Online").'</div>';
|
print '<span class="ok">'.$langs->trans("Online").'</div>';
|
||||||
} else {
|
} else {
|
||||||
print '<font class="error">'.$langs->trans("Offline");
|
print '<span class="error">'.$langs->trans("Offline");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
if ($rssparser->error) {
|
if ($rssparser->error) {
|
||||||
print ' - '.$langs->trans($rssparser->error);
|
print ' - '.$langs->trans($rssparser->error);
|
||||||
|
|||||||
@ -466,9 +466,9 @@ if ($conf->use_javascript_ajax) {
|
|||||||
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0);
|
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY)) {
|
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY)) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -482,9 +482,9 @@ if ($conf->use_javascript_ajax) {
|
|||||||
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0);
|
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY)) {
|
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY)) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -498,9 +498,9 @@ if ($conf->use_javascript_ajax) {
|
|||||||
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1);
|
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
|
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -514,9 +514,9 @@ if ($conf->use_javascript_ajax) {
|
|||||||
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1);
|
print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
|
if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newtoken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
655
htdocs/admin/hrm.php
Normal file
655
htdocs/admin/hrm.php
Normal file
@ -0,0 +1,655 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.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 hrm/admin/setup.php
|
||||||
|
* \ingroup hrm
|
||||||
|
* \brief HrmTest setup page.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
require '../main.inc.php';
|
||||||
|
|
||||||
|
global $langs, $user;
|
||||||
|
|
||||||
|
// Libraries
|
||||||
|
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
|
||||||
|
//require_once "../class/myclass.class.php";
|
||||||
|
|
||||||
|
// Translations
|
||||||
|
$langs->loadLangs(array("admin", "hrm"));
|
||||||
|
|
||||||
|
// Access control
|
||||||
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parameters
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$label = GETPOST('label', 'alpha');
|
||||||
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
|
$type = 'myobject';
|
||||||
|
|
||||||
|
$arrayofparameters = array(
|
||||||
|
'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1),
|
||||||
|
'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'textarea','enabled'=>1),
|
||||||
|
);
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
$setupnotempty = 0;
|
||||||
|
|
||||||
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ((float) DOL_VERSION >= 6) {
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'update') {
|
||||||
|
$max_rank = GETPOST('HRM_MAXRANK', 'int');
|
||||||
|
|
||||||
|
// We complete skill possible level notation if necessary
|
||||||
|
if (!empty($max_rank)) {
|
||||||
|
$static_skill = new Skill($db);
|
||||||
|
$TAllSkills = $static_skill->fetchAll();
|
||||||
|
foreach ($TAllSkills as &$skill) {
|
||||||
|
if (empty($skill->lines)) $skill->fetchLines();
|
||||||
|
if (count($skill->lines) < $conf->global->HRM_MAXRANK) {
|
||||||
|
$skill->createSkills(count($skill->lines) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($action == 'updateMask') {
|
||||||
|
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||||
|
$maskorder = GETPOST('maskorder', 'alpha');
|
||||||
|
|
||||||
|
if ($maskconstorder) {
|
||||||
|
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
} elseif ($action == 'specimen') {
|
||||||
|
$modele = GETPOST('module', 'alpha');
|
||||||
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
|
||||||
|
$tmpobject = new $tmpobjectkey($db);
|
||||||
|
$tmpobject->initAsSpecimen();
|
||||||
|
|
||||||
|
// Search template files
|
||||||
|
$file = ''; $classname = ''; $filefound = 0;
|
||||||
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
|
foreach ($dirmodels as $reldir) {
|
||||||
|
$file = dol_buildpath($reldir."core/modules/hrm/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||||
|
if (file_exists($file)) {
|
||||||
|
$filefound = 1;
|
||||||
|
$classname = "pdf_".$modele;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($filefound) {
|
||||||
|
require_once $file;
|
||||||
|
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
if ($module->write_file($tmpobject, $langs) > 0) {
|
||||||
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
setEventMessages($module->error, null, 'errors');
|
||||||
|
dol_syslog($module->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
|
}
|
||||||
|
} elseif ($action == 'setmod') {
|
||||||
|
// TODO Check if numbering module chosen can be activated by calling method canBeActivated
|
||||||
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
if (!empty($tmpobjectkey)) {
|
||||||
|
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey)."_ADDON";
|
||||||
|
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
} elseif ($action == 'set') {
|
||||||
|
// Activate a model
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
} elseif ($action == 'del') {
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0) {
|
||||||
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
if (!empty($tmpobjectkey)) {
|
||||||
|
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||||
|
if ($conf->global->$constforval == "$value") {
|
||||||
|
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($action == 'setdoc') {
|
||||||
|
// Set or unset default model
|
||||||
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
if (!empty($tmpobjectkey)) {
|
||||||
|
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||||
|
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
||||||
|
// The constant that was read before the new set
|
||||||
|
// We therefore requires a variable to have a coherent view
|
||||||
|
$conf->global->$constforval = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We disable/enable the document template (into llx_document_model table)
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0) {
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($action == 'unsetdoc') {
|
||||||
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
if (!empty($tmpobjectkey)) {
|
||||||
|
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||||
|
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$help_url = '';
|
||||||
|
$page_name = "HRMSetup";
|
||||||
|
|
||||||
|
llxHeader('', $langs->trans($page_name), $help_url);
|
||||||
|
|
||||||
|
// Subheader
|
||||||
|
$linkback = '<a href="'.($backtopage ? $backtopage : 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');
|
||||||
|
|
||||||
|
// Configuration header
|
||||||
|
$head = hrmAdminPrepareHead();
|
||||||
|
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "hrm");
|
||||||
|
|
||||||
|
$moduledir = 'hrm';
|
||||||
|
$myTmpObjects = array();
|
||||||
|
$myTmpObjects['evaluation'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0);
|
||||||
|
|
||||||
|
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||||
|
if ($myTmpObjectKey == 'MyObject') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($myTmpObjectArray['includerefgeneration']) {
|
||||||
|
/*
|
||||||
|
* Orders Numbering model
|
||||||
|
*/
|
||||||
|
$setupnotempty++;
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
|
||||||
|
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($dirmodels as $reldir) {
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/".$moduledir);
|
||||||
|
|
||||||
|
if (is_dir($dir)) {
|
||||||
|
$handle = opendir($dir);
|
||||||
|
if (is_resource($handle)) {
|
||||||
|
while (($file = readdir($handle)) !== false) {
|
||||||
|
if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||||
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file.'.php';
|
||||||
|
|
||||||
|
$module = new $file($db);
|
||||||
|
|
||||||
|
// Show modules according to features level
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($module->isEnabled()) {
|
||||||
|
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||||
|
print $module->info();
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Show example of numbering model
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
$tmp = $module->getExample();
|
||||||
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') {
|
||||||
|
print $langs->trans($tmp);
|
||||||
|
} else {
|
||||||
|
print $tmp;
|
||||||
|
}
|
||||||
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
$constforvar = 'HRMTEST_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||||
|
if ($conf->global->$constforvar == $file) {
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$mytmpinstance = new $myTmpObjectKey($db);
|
||||||
|
$mytmpinstance->initAsSpecimen();
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = '';
|
||||||
|
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||||
|
|
||||||
|
$nextval = $module->getNextValue($mytmpinstance);
|
||||||
|
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||||
|
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||||
|
if ($nextval) {
|
||||||
|
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||||
|
$nextval = $langs->trans($nextval);
|
||||||
|
}
|
||||||
|
$htmltooltip .= $nextval.'<br>';
|
||||||
|
} else {
|
||||||
|
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($myTmpObjectArray['includedocgeneration']) {
|
||||||
|
/*
|
||||||
|
* Document templates generators
|
||||||
|
*/
|
||||||
|
$setupnotempty++;
|
||||||
|
$type = strtolower($myTmpObjectKey);
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
|
||||||
|
|
||||||
|
// Load array def with activated templates
|
||||||
|
$def = array();
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||||
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$i = 0;
|
||||||
|
$num_rows = $db->num_rows($resql);
|
||||||
|
while ($i < $num_rows) {
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||||
|
print "<tr class=\"liste_titre\">\n";
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||||
|
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($dirmodels as $reldir) {
|
||||||
|
foreach (array('', '/doc') as $valdir) {
|
||||||
|
$realpath = $reldir."core/modules/".$moduledir.$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
|
if (is_dir($dir)) {
|
||||||
|
$handle = opendir($dir);
|
||||||
|
if (is_resource($handle)) {
|
||||||
|
while (($file = readdir($handle)) !== false) {
|
||||||
|
$filelist[] = $file;
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
arsort($filelist);
|
||||||
|
|
||||||
|
foreach ($filelist as $file) {
|
||||||
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||||
|
if (file_exists($dir.'/'.$file)) {
|
||||||
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
$modulequalified = 1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
|
$modulequalified = 0;
|
||||||
|
}
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||||
|
$modulequalified = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($modulequalified) {
|
||||||
|
print '<tr class="oddeven"><td width="100">';
|
||||||
|
print (empty($module->name) ? $name : $module->name);
|
||||||
|
print "</td><td>\n";
|
||||||
|
if (method_exists($module, 'info')) {
|
||||||
|
print $module->info($langs);
|
||||||
|
} else {
|
||||||
|
print $module->description;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def)) {
|
||||||
|
print '<td class="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'">';
|
||||||
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.$name.'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
print '<td class="center">';
|
||||||
|
$constforvar = 'HRMTEST_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||||
|
if ($conf->global->$constforvar == $name) {
|
||||||
|
//print img_picto($langs->trans("Default"), 'on');
|
||||||
|
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.$name.'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
|
if ($module->type == 'pdf') {
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($module->type == 'pdf') {
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
|
} else {
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans('OtherOptions'), '', '');
|
||||||
|
|
||||||
|
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 '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
|
foreach ($arrayofparameters as $constname => $val) {
|
||||||
|
if ($val['enabled']==1) {
|
||||||
|
$setupnotempty++;
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||||
|
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if ($val['type'] == 'textarea') {
|
||||||
|
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||||
|
print $conf->global->{$constname};
|
||||||
|
print "</textarea>\n";
|
||||||
|
} elseif ($val['type']== 'integer') {
|
||||||
|
print '<input class="flat" name="'.$constname.'" id="'.$constname.'" value="'.$conf->global->$constname.'" type="number" step="1" min="0" max="50" >' . "\n";
|
||||||
|
} elseif ($val['type']== 'html') {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||||
|
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||||
|
$doleditor->Create();
|
||||||
|
} elseif ($val['type'] == 'yesno') {
|
||||||
|
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||||
|
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
|
$tmp = explode(':', $val['type']);
|
||||||
|
$nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang
|
||||||
|
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
|
||||||
|
$arrayofmessagename = array();
|
||||||
|
if (is_array($formmail->lines_model)) {
|
||||||
|
foreach ($formmail->lines_model as $modelmail) {
|
||||||
|
//var_dump($modelmail);
|
||||||
|
$moreonlabel = '';
|
||||||
|
if (!empty($arrayofmessagename[$modelmail->label])) {
|
||||||
|
$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
|
||||||
|
}
|
||||||
|
// The 'label' is the key that is unique if we exclude the language
|
||||||
|
$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
|
} elseif (preg_match('/category:/', $val['type'])) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
|
$tmp = explode(':', $val['type']);
|
||||||
|
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||||
|
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||||
|
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||||
|
} elseif ($val['type'] == 'securekey') {
|
||||||
|
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||||
|
}
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
print "\n".'<script type="text/javascript">';
|
||||||
|
print '$(document).ready(function () {
|
||||||
|
$("#generate_token'.$constname.'").click(function() {
|
||||||
|
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||||
|
action: \'getrandompassword\',
|
||||||
|
generic: true
|
||||||
|
},
|
||||||
|
function(token) {
|
||||||
|
$("#'.$constname.'").val(token);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});';
|
||||||
|
print '</script>';
|
||||||
|
}
|
||||||
|
} elseif ($val['type'] == 'product') {
|
||||||
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||||
|
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||||
|
$form->select_produits($selected, $constname, '', 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<br><div class="center">';
|
||||||
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
print '<br>';
|
||||||
|
} else {
|
||||||
|
if (!empty($arrayofparameters)) {
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
|
foreach ($arrayofparameters as $constname => $val) {
|
||||||
|
if ($val['enabled']==1) {
|
||||||
|
$setupnotempty++;
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||||
|
print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if ($val['type'] == 'textarea') {
|
||||||
|
print dol_nl2br($conf->global->{$constname});
|
||||||
|
} elseif ($val['type']== 'html') {
|
||||||
|
print $conf->global->{$constname};
|
||||||
|
} elseif ($val['type'] == 'yesno') {
|
||||||
|
print ajax_constantonoff($constname);
|
||||||
|
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
|
$tmp = explode(':', $val['type']);
|
||||||
|
|
||||||
|
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||||
|
if ($template<0) {
|
||||||
|
setEventMessages(null, $formmail->errors, 'errors');
|
||||||
|
}
|
||||||
|
print $langs->trans($template->label);
|
||||||
|
} elseif (preg_match('/category:/', $val['type'])) {
|
||||||
|
$c = new Categorie($db);
|
||||||
|
$result = $c->fetch($conf->global->{$constname});
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages(null, $c->errors, 'errors');
|
||||||
|
}
|
||||||
|
$ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||||
|
$toprint = array();
|
||||||
|
foreach ($ways as $way) {
|
||||||
|
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
|
||||||
|
}
|
||||||
|
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||||
|
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||||
|
if ($conf->global->{$constname}==2) {
|
||||||
|
print $langs->trans("Prospect");
|
||||||
|
} elseif ($conf->global->{$constname}==3) {
|
||||||
|
print $langs->trans("ProspectCustomer");
|
||||||
|
} elseif ($conf->global->{$constname}==1) {
|
||||||
|
print $langs->trans("Customer");
|
||||||
|
} elseif ($conf->global->{$constname}==0) {
|
||||||
|
print $langs->trans("NorProspectNorCustomer");
|
||||||
|
}
|
||||||
|
} elseif ($val['type'] == 'product') {
|
||||||
|
$product = new Product($db);
|
||||||
|
$resprod = $product->fetch($conf->global->{$constname});
|
||||||
|
if ($resprod > 0) {
|
||||||
|
print $product->ref;
|
||||||
|
} elseif ($resprod < 0) {
|
||||||
|
setEventMessages(null, $object->errors, "errors");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print $conf->global->{$constname};
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
} else {
|
||||||
|
print '<br>'.$langs->trans("NothingToSetup");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($setupnotempty)) {
|
||||||
|
print '<br>'.$langs->trans("NothingToSetup");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Page end
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -451,11 +451,11 @@ if ($mode == 'other') {
|
|||||||
print '</table>' . "\n";
|
print '</table>' . "\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
@ -577,9 +577,9 @@ if ($mode == 'login') {
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
print '<tr class="liste_titre"><td class="titlefieldmax45">';
|
||||||
print $langs->trans("Parameter");
|
print $langs->trans("Parameter");
|
||||||
print '</td><td class="titlefieldmiddle">';
|
print '</td><td>';
|
||||||
print $langs->trans("Value");
|
print $langs->trans("Value");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -630,7 +630,6 @@ if ($mode == 'login') {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -82,7 +82,7 @@ print '<br><br>';
|
|||||||
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) {
|
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) {
|
||||||
$setupcompanynotcomplete = 1;
|
$setupcompanynotcomplete = 1;
|
||||||
}
|
}
|
||||||
print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
|
print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
|
||||||
print '<br><br>'.$langs->trans("SetupDescription3b");
|
print '<br><br>'.$langs->trans("SetupDescription3b");
|
||||||
if (!empty($setupcompanynotcomplete)) {
|
if (!empty($setupcompanynotcomplete)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@ -112,8 +112,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Show into other
|
// Show into other
|
||||||
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
|
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||||
print "<br>";
|
print '<br class="hideonsmartphone">';
|
||||||
|
|
||||||
// Show logo
|
// Show logo
|
||||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file knowledgemanagement/admin/setup.php
|
* \file htdocs/admin/knowledgemanagement.php
|
||||||
* \ingroup knowledgemanagement
|
* \ingroup knowledgemanagement
|
||||||
* \brief KnowledgeManagement setup page.
|
* \brief KnowledgeManagement setup page.
|
||||||
*/
|
*/
|
||||||
@ -65,9 +65,7 @@ if (!$user->admin) {
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((float) DOL_VERSION >= 6) {
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'updateMask') {
|
if ($action == 'updateMask') {
|
||||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||||
@ -324,7 +322,7 @@ if ($action == 'edit') {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
} else {
|
} else {
|
||||||
//print '<br>'.$langs->trans("NothingToSetup");
|
//print '<br>'.$langs->trans("NothingToSetup");
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -131,7 +131,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1);
|
||||||
@ -153,7 +153,7 @@ $arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
|
|||||||
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
|
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
|
||||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
|
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
|
||||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
|
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
|
||||||
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
|
print '<br><span class="error">'.$langs->trans("LDAPSetupNotComplete").'</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -297,24 +297,24 @@ if (function_exists("ldap_connect")) {
|
|||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// Test ldap connect and bind
|
// Test ldap connect and bind
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
|
print '<span class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
|
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||||
if ($result == 2) {
|
if ($result == 2) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
|
print '<span class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
|
print '<span class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans("Error").' '.$ldap->error;
|
print $langs->trans("Error").' '.$ldap->error;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'warning').' ';
|
print img_picto('', 'warning').' ';
|
||||||
print '<font class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</font>';
|
print '<span class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,18 +322,18 @@ if (function_exists("ldap_connect")) {
|
|||||||
// Test ldap_getversion
|
// Test ldap_getversion
|
||||||
if (($ldap->getVersion() == 3)) {
|
if (($ldap->getVersion() == 3)) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion3").'</font>';
|
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion3").'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion2").'</font>';
|
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion2").'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$unbind = $ldap->unbind();
|
$unbind = $ldap->unbind();
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
|
print '<span class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans("Error").' '.$ldap->error;
|
print $langs->trans("Error").' '.$ldap->error;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -145,7 +145,7 @@ print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
|||||||
print $langs->trans("LDAPDescContact").'<br>';
|
print $langs->trans("LDAPDescContact").'<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -321,12 +321,12 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result2 > 0) {
|
if ($result2 > 0) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,9 +336,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,7 +120,7 @@ print $langs->trans("LDAPDescGroups").'<br>';
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -260,12 +260,12 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result2 > 0) {
|
if ($result2 > 0) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,9 +275,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,9 +331,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -184,7 +184,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||||
@ -472,12 +472,12 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result2 > 0) {
|
if ($result2 > 0) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,9 +487,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ print $langs->trans("LDAPDescMembersTypes").'<br>';
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
@ -223,12 +223,12 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result2 > 0) {
|
if ($result2 > 0) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,9 +238,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -173,7 +173,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newtoken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
|
|
||||||
@ -444,12 +444,12 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result2 > 0) {
|
if ($result2 > 0) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,9 +459,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -530,9 +530,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</span><br>';
|
||||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -190,7 +190,7 @@ if ($action == 'edit') {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit'.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().''.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -292,7 +292,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common', '', -1);
|
print dol_get_fiche_head($head, 'common', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@ -543,7 +543,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common', '', -1);
|
print dol_get_fiche_head($head, 'common', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -784,7 +784,7 @@ if ($action == 'edit') {
|
|||||||
// Actions button
|
// Actions button
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) {
|
if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) {
|
||||||
|
|||||||
@ -243,7 +243,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@ -412,7 +412,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
@ -515,7 +515,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) {
|
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) {
|
||||||
|
|||||||
@ -632,7 +632,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
if ($sortorder) {
|
if ($sortorder) {
|
||||||
$url .= '&page='.urlencode($sortorder);
|
$url .= '&page='.urlencode($sortorder);
|
||||||
}
|
}
|
||||||
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&rowid='.$obj->rowid.'">'.img_edit().'</a>';
|
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&token='.newToken().'&rowid='.$obj->rowid.'">'.img_edit().'</a>';
|
||||||
//print ' ';
|
//print ' ';
|
||||||
print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> ';
|
print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> ';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
|||||||
@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
|
|||||||
|
|
||||||
$tabhelp = array();
|
$tabhelp = array();
|
||||||
$tabhelp[25] = array(
|
$tabhelp[25] = array(
|
||||||
|
'label'=>$langs->trans('EnterAnyCode'),
|
||||||
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
|
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||||
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
|
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
|
||||||
'content'=>'<span class="small">'.$helpsubstit.'</span>',
|
'content'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||||
@ -683,8 +684,8 @@ if ($action == 'view') {
|
|||||||
|
|
||||||
$tmpaction = 'create';
|
$tmpaction = 'create';
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'fieldlist' => $fieldlist,
|
'fieldlist' => $fieldlist,
|
||||||
'tabname' => $tabname[$id]
|
'tabname' => $tabname[$id]
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error;
|
$error = $hookmanager->error;
|
||||||
@ -822,7 +823,7 @@ if ($resql) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($value == 'fk_user') {
|
} elseif ($value == 'fk_user') {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150');
|
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($value == 'topic') {
|
} elseif ($value == 'topic') {
|
||||||
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||||
@ -1187,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
if ($value == 'fk_user') {
|
if ($value == 'fk_user') {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300');
|
||||||
} else {
|
} else {
|
||||||
if ($context == 'add') { // I am not admin and we show the add form
|
if ($context == 'add') { // I am not admin and we show the add form
|
||||||
print $user->getNomUrl(1); // Me
|
print $user->getNomUrl(1); // Me
|
||||||
|
|||||||
@ -232,7 +232,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@ -387,7 +387,7 @@ if ($action == 'edit') {
|
|||||||
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
@ -479,7 +479,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') {
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE_TICKET != 'mail' || !$linuxlike) {
|
if ($conf->global->MAIN_MAIL_SENDMODE_TICKET != 'mail' || !$linuxlike) {
|
||||||
|
|||||||
@ -281,7 +281,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup');
|
||||||
|
|
||||||
print '<form action="./edit.php?action=add&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
print '<form action="'.DOL_URL_ROOT.'/admin/menus/edit.php?action=add&token='.newToken().'&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print dol_get_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if ($action == 'install') {
|
|||||||
|
|
||||||
// $original_file should match format module_modulename-x.y[.z].zip
|
// $original_file should match format module_modulename-x.y[.z].zip
|
||||||
$original_file = basename($_FILES["fileinstall"]["name"]);
|
$original_file = basename($_FILES["fileinstall"]["name"]);
|
||||||
$original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file);
|
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
|
||||||
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
|
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
|
||||||
|
|
||||||
if (!$original_file) {
|
if (!$original_file) {
|
||||||
@ -878,7 +878,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$codeenabledisable .= '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
$codeenabledisable .= '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||||
$codeenabledisable .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&token='.newToken().'&module_position='.$module_position.'&action=set&token='.newtoken().'&value='.$modName.'&mode='.$mode.$param.'"';
|
$codeenabledisable .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&token='.newToken().'&module_position='.$module_position.'&action=set&token='.newToken().'&value='.$modName.'&mode='.$mode.$param.'"';
|
||||||
if ($warningmessage) {
|
if ($warningmessage) {
|
||||||
$codeenabledisable .= ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
$codeenabledisable .= ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ if ($action == 'add_currency') {
|
|||||||
|
|
||||||
|
|
||||||
$TCurrency = array();
|
$TCurrency = array();
|
||||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE entity = '.$conf->entity;
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."multicurrency WHERE entity = ".((int) $conf->entity);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -81,7 +81,7 @@ $head = company_admin_prepare_head();
|
|||||||
print dol_get_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company');
|
print dol_get_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("OpeningHoursDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("OpeningHoursDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
if (empty($action) || $action == 'edit' || $action == 'updateedit') {
|
if (empty($action) || $action == 'edit' || $action == 'updateedit') {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/credtitransfer.php
|
* \file htdocs/admin/paymentbybanktransfer.php
|
||||||
* \ingroup paymentbybanktransfer
|
* \ingroup paymentbybanktransfer
|
||||||
* \brief Page to setup payments by credit transfer
|
* \brief Page to setup payments by credit transfer
|
||||||
*/
|
*/
|
||||||
@ -429,7 +429,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -165,6 +165,10 @@ if ($action == 'update') {
|
|||||||
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GETPOSTISSET('PDF_USE_A')) {
|
||||||
|
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||||
@ -307,7 +311,7 @@ for ($i = 1; $i <= 6; $i++) {
|
|||||||
$pid = false;
|
$pid = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
$pid = img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||||
}
|
}
|
||||||
if ($pid) {
|
if ($pid) {
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
|
||||||
@ -534,6 +538,14 @@ if ($conf->use_javascript_ajax) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_A").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('PDF_USE_A');
|
||||||
|
} else {
|
||||||
|
print $form->selectyesno('PDF_USE_A', (empty($conf->global->PDF_USE_A) ? 0 : $conf->global->PDF_USE_A), 1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -236,7 +236,7 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<a class="reposition" href="perms.php?pid='.$obj->id.'&action=add">';
|
print '<a class="reposition" href="perms.php?pid='.$obj->id.'&action=add&token='.newToken().'">';
|
||||||
//print img_edit_add();
|
//print img_edit_add();
|
||||||
print img_picto('', 'switch_off');
|
print img_picto('', 'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -443,7 +443,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif&token='.newToken().'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -63,7 +63,7 @@ if ($action == 'updateform') {
|
|||||||
if ($res3 && $res4 && $res5 && $res6) {
|
if ($res3 && $res4 && $res5 && $res6) {
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
} elseif ($action == 'delete') {
|
} elseif ($action == 'deletefile') {
|
||||||
// Delete file
|
// Delete file
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha');
|
$file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha');
|
||||||
|
|||||||
@ -183,7 +183,7 @@ if ($action == 'edit') {
|
|||||||
if (count($listofmethods)) {
|
if (count($listofmethods)) {
|
||||||
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
|
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
|
||||||
} else {
|
} else {
|
||||||
print '<font class="error">'.$langs->trans("None").'</font>';
|
print '<span class="error">'.$langs->trans("None").'</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -132,6 +132,8 @@ if ($action == 'updateMask') {
|
|||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
} elseif ($action == 'unsetdoc') {
|
||||||
|
dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
|
||||||
} elseif ($action == 'setmod') {
|
} elseif ($action == 'setmod') {
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) {
|
|||||||
// Default
|
// Default
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
|
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
|
||||||
print img_picto($langs->trans("Default"), 'on');
|
// print img_picto($langs->trans("Default"), 'on');
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,8 @@ if ($action == 'updateMask') {
|
|||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
} elseif ($action == 'unsetdoc') {
|
||||||
|
dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity);
|
||||||
} elseif ($action == 'specimen') {
|
} elseif ($action == 'specimen') {
|
||||||
$modele = GETPOST('module', 'alpha');
|
$modele = GETPOST('module', 'alpha');
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
|
|||||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||||
//var_dump($result['content']);
|
//var_dump($result['content']);
|
||||||
if (function_exists('simplexml_load_string')) {
|
if (function_exists('simplexml_load_string')) {
|
||||||
$sfurl = simplexml_load_string($result['content']);
|
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
|
|||||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||||
$xmlfile = $xmlarray['content'];
|
$xmlfile = $xmlarray['content'];
|
||||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||||
$xml = simplexml_load_string($xmlfile);
|
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||||
} else {
|
} else {
|
||||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||||
setEventMessages($errormsg, null, 'errors');
|
setEventMessages($errormsg, null, 'errors');
|
||||||
|
|||||||
@ -91,6 +91,7 @@ $modules_files = array();
|
|||||||
$modules_fullpath = array();
|
$modules_fullpath = array();
|
||||||
$modulesdir = dolGetModulesDirs();
|
$modulesdir = dolGetModulesDirs();
|
||||||
$rights_ids = array();
|
$rights_ids = array();
|
||||||
|
$arrayofpermissions = array();
|
||||||
|
|
||||||
foreach ($modulesdir as $dir) {
|
foreach ($modulesdir as $dir) {
|
||||||
$handle = @opendir(dol_osencode($dir));
|
$handle = @opendir(dol_osencode($dir));
|
||||||
@ -155,7 +156,7 @@ foreach ($modules as $key => $module) {
|
|||||||
if (empty($rights[0])) {
|
if (empty($rights[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$arrayofpermissions[$rights[0]] = array('label'=> 'user->rights->'.$module->rights_class.'->'.$rights[4].(empty($rights[5]) ? '' : '->'.$rights[5]));
|
||||||
$permission[] = $rights[0];
|
$permission[] = $rights[0];
|
||||||
|
|
||||||
array_push($rights_ids, $rights[0]);
|
array_push($rights_ids, $rights[0]);
|
||||||
@ -336,8 +337,10 @@ foreach ($moduleList as $module) {
|
|||||||
$idperms = '';
|
$idperms = '';
|
||||||
|
|
||||||
foreach ($module->permission as $permission) {
|
foreach ($module->permission as $permission) {
|
||||||
$idperms .= ($idperms ? ", " : "").$permission;
|
|
||||||
$translationKey = "Permission".$permission;
|
$translationKey = "Permission".$permission;
|
||||||
|
$labelpermission = $langs->trans($translationKey);
|
||||||
|
$labelpermission .= ' : '.$arrayofpermissions[$permission]['label'];
|
||||||
|
$idperms .= ($idperms ? ", " : "").'<span title="'.$labelpermission.'">'.$permission.'</a>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
if (!empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
||||||
if (empty($langs->tab_translate[$translationKey])) {
|
if (empty($langs->tab_translate[$translationKey])) {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ print '<br>';
|
|||||||
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
|
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
|
||||||
$test = !function_exists('xdebug_is_enabled');
|
$test = !function_exists('xdebug_is_enabled');
|
||||||
if ($test) {
|
if ($test) {
|
||||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
|
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
|
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
|
||||||
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
|
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
|
||||||
|
|||||||
@ -98,7 +98,7 @@ if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') ==
|
|||||||
print ' '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
|
print ' '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
|
||||||
}
|
}
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
|
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").': '.$_SERVER["DOCUMENT_ROOT"].','.DOL_DATA_ROOT).')</span>')."<br>\n";
|
||||||
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
||||||
@ -258,6 +258,8 @@ print '<br>';
|
|||||||
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
|
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
|
||||||
if (!empty($dolibarr_nocsrfcheck)) {
|
if (!empty($dolibarr_nocsrfcheck)) {
|
||||||
print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
|
print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
|
||||||
|
} else {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span>';
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -391,7 +393,7 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->api->enabled)) {
|
if (!empty($conf->api->enabled)) {
|
||||||
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': endpoint1:1,endpoint2:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,7 +444,10 @@ print '<br>';
|
|||||||
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."<br>";
|
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 2)</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."<br>";
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2018 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -55,7 +55,7 @@ if (!$user->admin) {
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'delete') {
|
if ($action == 'deletefile') {
|
||||||
if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha'))) {
|
if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha'))) {
|
||||||
$file = $conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
|
$file = $conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
|
||||||
$ret = dol_delete_file($file, 1);
|
$ret = dol_delete_file($file, 1);
|
||||||
@ -441,6 +441,11 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||||||
'id' => 'radio_compression_bzip',
|
'id' => 'radio_compression_bzip',
|
||||||
'label' => $langs->trans("Bzip2")
|
'label' => $langs->trans("Bzip2")
|
||||||
);
|
);
|
||||||
|
$compression['zstd'] = array(
|
||||||
|
'function' => 'zstd_compress',
|
||||||
|
'id' => 'radio_compression_zstd',
|
||||||
|
'label' => $langs->trans("Zstd")
|
||||||
|
);
|
||||||
$compression['none'] = array(
|
$compression['none'] = array(
|
||||||
'function' => '',
|
'function' => '',
|
||||||
'id' => 'radio_compression_none',
|
'id' => 'radio_compression_none',
|
||||||
@ -513,7 +518,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) {
|
|||||||
$_SESSION["commandbackupresult"] = '';
|
$_SESSION["commandbackupresult"] = '';
|
||||||
}
|
}
|
||||||
if (!empty($_SESSION["commandbackuptorun"])) {
|
if (!empty($_SESSION["commandbackuptorun"])) {
|
||||||
print '<br><font class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</font><br>'."\n";
|
print '<br><span class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</span><br>'."\n";
|
||||||
print '<textarea id="commandbackuptoruntext" rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuptorun"].'</textarea><br>'."\n";
|
print '<textarea id="commandbackuptoruntext" rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuptorun"].'</textarea><br>'."\n";
|
||||||
print ajax_autoselect("commandbackuptoruntext", 0);
|
print ajax_autoselect("commandbackuptoruntext", 0);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -2,20 +2,21 @@
|
|||||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/tools/export.php
|
* \file htdocs/admin/tools/export.php
|
||||||
|
|||||||
@ -2,20 +2,21 @@
|
|||||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/tools/export_files.php
|
* \file htdocs/admin/tools/export_files.php
|
||||||
@ -41,7 +42,7 @@ $file = trim(GETPOST('zipfilename_template', 'alpha'));
|
|||||||
$compression = GETPOST('compression', 'aZ09');
|
$compression = GETPOST('compression', 'aZ09');
|
||||||
|
|
||||||
$file = dol_sanitizeFileName($file);
|
$file = dol_sanitizeFileName($file);
|
||||||
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $file);
|
||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
@ -137,7 +138,7 @@ if ($compression == 'zip') {
|
|||||||
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
|
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (in_array($compression, array('gz', 'bz'))) {
|
} elseif (in_array($compression, array('gz', 'bz', 'zstd'))) {
|
||||||
$userlogin = ($user->login ? $user->login : 'unknown');
|
$userlogin = ($user->login ? $user->login : 'unknown');
|
||||||
|
|
||||||
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
|
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
|
||||||
@ -156,9 +157,10 @@ if ($compression == 'zip') {
|
|||||||
} else {
|
} else {
|
||||||
if ($compression == 'gz') {
|
if ($compression == 'gz') {
|
||||||
$cmd = "gzip -f ".$outputdir."/".$file;
|
$cmd = "gzip -f ".$outputdir."/".$file;
|
||||||
}
|
} elseif ($compression == 'bz') {
|
||||||
if ($compression == 'bz') {
|
|
||||||
$cmd = "bzip2 -f ".$outputdir."/".$file;
|
$cmd = "bzip2 -f ".$outputdir."/".$file;
|
||||||
|
} elseif ($compression == 'zstd') {
|
||||||
|
$cmd = "zstd -z -9 -q --rm ".$outputdir."/".$file;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $utils->executeCLI($cmd, $outputfile);
|
$result = $utils->executeCLI($cmd, $outputfile);
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
|
|||||||
|
|
||||||
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
|
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
|
||||||
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
|
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
|
||||||
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
|
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
|
||||||
|
|
||||||
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
|
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
|
||||||
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';
|
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $version = '0.0';
|
|||||||
if ($action == 'getlastversion') {
|
if ($action == 'getlastversion') {
|
||||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||||
//var_dump($result['content']);
|
//var_dump($result['content']);
|
||||||
$sfurl = simplexml_load_string($result['content']);
|
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ if (!$user->admin) {
|
|||||||
$id = GETPOST('rowid', 'int');
|
$id = GETPOST('rowid', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$optioncss = GETPOST('optionscss', 'aZ09');
|
$optioncss = GETPOST('optionscss', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ09');
|
||||||
|
|
||||||
$langcode = GETPOST('langcode', 'alphanohtml');
|
$langcode = GETPOST('langcode', 'alphanohtml');
|
||||||
$transkey = GETPOST('transkey', 'alphanohtml');
|
$transkey = GETPOST('transkey', 'alphanohtml');
|
||||||
@ -357,7 +358,7 @@ if ($mode == 'overwrite') {
|
|||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
|
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=edit&token='.newToken().''.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
@ -457,7 +458,7 @@ if ($mode == 'searchkey') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
||||||
$title = $langs->trans("TranslationKeySearch");
|
$title = $langs->trans("Translation");
|
||||||
if ($nbtotalofrecords > 0) {
|
if ($nbtotalofrecords > 0) {
|
||||||
$title .= ' <span class="opacitymedium colorblack paddingleft">('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')</span>';
|
$title .= ' <span class="opacitymedium colorblack paddingleft">('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')</span>';
|
||||||
}
|
}
|
||||||
@ -470,18 +471,8 @@ if ($mode == 'searchkey') {
|
|||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
|
||||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
|
||||||
print '<td align="center"></td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
// Line to search new record
|
print '<tr class="liste_titre_filter"><td>';
|
||||||
print "\n";
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
|
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
|
||||||
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
|
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -507,6 +498,15 @@ if ($mode == 'searchkey') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
||||||
|
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
|
print '<td align="center"></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') {
|
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') {
|
||||||
ksort($recordtoshow);
|
ksort($recordtoshow);
|
||||||
}
|
}
|
||||||
@ -545,9 +545,9 @@ if ($mode == 'searchkey') {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
}
|
}
|
||||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
|
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
|
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().'&mode='.urlencode($mode).'">'.img_delete().'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
$htmltext = $langs->trans("OriginalValueWas", '<i>'.$newlangfileonly->tab_translate[$key].'</i>');
|
$htmltext = $langs->trans("OriginalValueWas", '<i>'.$newlangfileonly->tab_translate[$key].'</i>');
|
||||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||||
@ -574,9 +574,9 @@ if ($mode == 'searchkey') {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
}
|
}
|
||||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
|
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
|
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().'&mode='.urlencode($mode).'">'.img_delete().'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
|
|
||||||
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
|
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
|
||||||
|
|||||||
@ -136,7 +136,7 @@ if ($action == 'edit') {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user