mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into fix_dev_add_mysoc_currency
This commit is contained in:
commit
c326d6c84f
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
|
|
@ -131,7 +131,7 @@ jobs:
|
|||
ls -l ~/.cache/pre-commit/
|
||||
|
||||
- name: Convert Raw Log to Annotations
|
||||
uses: mdeweerd/logToCheckStyle@v2024.3.5
|
||||
uses: mdeweerd/logToCheckStyle@v2025.1.1
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
in: ${{ env.RAW_LOG }}
|
||||
|
|
|
|||
2
.github/workflows/windows-ci.yml
vendored
2
.github/workflows/windows-ci.yml
vendored
|
|
@ -165,7 +165,7 @@ jobs:
|
|||
for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A
|
||||
|
||||
- name: Convert Raw Log to Annotations
|
||||
uses: mdeweerd/logToCheckStyle@v2024.3.5
|
||||
uses: mdeweerd/logToCheckStyle@v2025.1.1
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
in: ${{ env.PHPUNIT_LOG }}
|
||||
|
|
|
|||
|
|
@ -511,6 +511,9 @@ script:
|
|||
php upgrade.php 20.0.0 21.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade20002100.log || cat $TRAVIS_BUILD_DIR/upgrade20002100.log
|
||||
php upgrade2.php 20.0.0 21.0.0 > $TRAVIS_BUILD_DIR/upgrade20002100-2.log || cat $TRAVIS_BUILD_DIR/upgrade20002100-2.log
|
||||
php step5.php 20.0.0 21.0.0 > $TRAVIS_BUILD_DIR/upgrade20002100-3.log || cat $TRAVIS_BUILD_DIR/upgrade20002100-3.log
|
||||
php upgrade.php 21.0.0 22.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade21002200.log || cat $TRAVIS_BUILD_DIR/upgrade21002200.log
|
||||
php upgrade2.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-2.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-2.log
|
||||
php step5.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-3.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-3.log
|
||||
set +e
|
||||
echo
|
||||
|
||||
|
|
|
|||
|
|
@ -1216,8 +1216,13 @@ NEW: updating for display Help title when try to delete Don (issue #25314)
|
|||
NEW: Upgrade in module builder in menu section
|
||||
NEW: use account address in sepa mandate (#23642)
|
||||
NEW: VAT rate - Add entity
|
||||
NEW: Website: Support of js into the Dolibarr server preview
|
||||
NEW: When an user unset the batch management of products, transformation of each batch stock movement in global stock movement
|
||||
NEW: PDF Generation for each Human Resource Evaluations.
|
||||
|
||||
SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
|
||||
SEC: Add action confirm_... as sensitive to need a CSRF token
|
||||
SEC: Disable not used PHP streams
|
||||
SEC: Add option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY
|
||||
|
||||
|
||||
For developers or integrators:
|
||||
|
|
@ -1311,7 +1316,7 @@ The following changes may create regressions for some external modules, but were
|
|||
* The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter.
|
||||
* A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english.
|
||||
* The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases.
|
||||
|
||||
* booking.class.php was removed, please have a look at calendar.class.php
|
||||
|
||||
***** ChangeLog for 18.0.6 compared to 18.0.5 *****
|
||||
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
|
||||
|
|
|
|||
|
|
@ -23,11 +23,12 @@ RUN apt-get update -y \
|
|||
msmtp \
|
||||
msmtp-mta \
|
||||
mailutils \
|
||||
libpq-dev \
|
||||
&& apt-get autoremove -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \
|
||||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
||||
&& docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql pgsql gd soap zip \
|
||||
&& docker-php-ext-configure ldap \
|
||||
&& docker-php-ext-install -j$(nproc) ldap && \
|
||||
mv ${PHP_INI_DIR}/php.ini-development ${PHP_INI_DIR}/php.ini
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
# How to use it ?
|
||||
|
||||
The docker-compose.yml file is a sample of a config file to use to build and run Dolibarr in the current workspace with Docker.
|
||||
This docker image is intended for development usage.
|
||||
For production usage you should consider other contributor reference like https://hub.docker.com/r/dolibarr/dolibarr
|
||||
The docker-compose.yml file is a sample of a config file to use to build and run
|
||||
Dolibarr in the current workspace with Docker. This docker image is intended for
|
||||
**development usage**. For production usage you should consider other
|
||||
contributor reference like https://hub.docker.com/r/dolibarr/dolibarr.
|
||||
|
||||
Before build/run, define the variable HOST_USER_ID as following:
|
||||
|
||||
|
|
@ -12,11 +13,18 @@ Go in repository build/docker :
|
|||
|
||||
cd dev/build/docker
|
||||
|
||||
And then, you can run :
|
||||
And then, depending on whether you want to run with a MariaDB database or
|
||||
PostgreSQL database, you can run:
|
||||
|
||||
docker-compose up
|
||||
docker compose -f docker-compose.yml -f mariadb.yml up
|
||||
|
||||
or
|
||||
|
||||
docker compose -f docker-compose.yml -f postgres.yml up
|
||||
|
||||
This will run 4 containers Docker : Dolibarr, MariaDB, PhpMyAdmin and MailDev.
|
||||
In the case of PostgreSQL, only Dolibarr, MailDev and the PostgreSQL database
|
||||
will be running.
|
||||
|
||||
The URL to go to the Dolibarr is :
|
||||
|
||||
|
|
@ -26,9 +34,35 @@ The URL to go to PhpMyAdmin is (login/password is root/root) :
|
|||
|
||||
http://0.0.0.0:8080
|
||||
|
||||
In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev
|
||||
In Dolibarr configuration Email let PHP mail function, To see all mail send by
|
||||
Dolibarr go to maildev
|
||||
|
||||
http://0.0.0.0:8081
|
||||
|
||||
Setup the database connection during the installation process, please use mariadb (name of the database container) as database host.
|
||||
Setup documents folder, during the installation process, to /var/documents
|
||||
Setup the database connection during the installation process, please use
|
||||
mariadb or postgres (name of the database container) as database host.
|
||||
|
||||
## Setup your custom modules
|
||||
|
||||
You can setup your own modules from your development folder by using volume
|
||||
mounts and docker compose override. For instance for your module "yourmodule"
|
||||
located in `/path/to/your/module_folder`, you can edit `yourmodule.yml` and
|
||||
write:
|
||||
|
||||
---
|
||||
services:
|
||||
web:
|
||||
volumes:
|
||||
- /path/to/your/module_folder:/var/www/html/custom/yourmodule/
|
||||
|
||||
This will add your module at runtime inside the dolibarr custom plugins and it
|
||||
will automatically be synced with your development environment.
|
||||
|
||||
Then, you can start by extending one of the commands above, for instance for
|
||||
mariadb:
|
||||
|
||||
docker compose \
|
||||
-f docker-compose.yml \
|
||||
-f postgres.yml \
|
||||
-f yourmodule.yml \
|
||||
up
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
version: '3'
|
||||
|
||||
---
|
||||
networks:
|
||||
internal-pod:
|
||||
internal: true
|
||||
|
|
@ -17,19 +16,6 @@ services:
|
|||
networks:
|
||||
- internal-pod
|
||||
- external-pod
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
environment:
|
||||
PMA_HOST: mariadb
|
||||
depends_on:
|
||||
- mariadb
|
||||
ports:
|
||||
- "8080:80"
|
||||
networks:
|
||||
- internal-pod
|
||||
- external-pod
|
||||
|
||||
web:
|
||||
build: .
|
||||
environment:
|
||||
|
|
@ -37,13 +23,12 @@ services:
|
|||
PHP_INI_DATE_TIMEZONE: $PHP_INI_DATE_TIMEZONE
|
||||
PHP_INI_MEMORY_LIMIT: $PHP_INI_MEMORY_LIMIT
|
||||
volumes:
|
||||
- ../../htdocs:/var/www/html/
|
||||
- ../../documents:/var/documents
|
||||
- ../../../htdocs:/var/www/html/
|
||||
- ../../../documents:/var/www/documents
|
||||
ports:
|
||||
- "80:80"
|
||||
- "9000:9000"
|
||||
depends_on:
|
||||
- mariadb
|
||||
- mail
|
||||
networks:
|
||||
- internal-pod
|
||||
|
|
|
|||
|
|
@ -1,24 +1,21 @@
|
|||
#!/bin/bash
|
||||
# Script used by the Dockerfile.
|
||||
# See README.md to know how to create a Dolibarr env with docker
|
||||
set -ex
|
||||
|
||||
if [ "${HOST_USER_ID}" == "" ]; then
|
||||
echo "Define HOST_USER_ID to your user ID before starting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
usermod -u "${HOST_USER_ID}" www-data
|
||||
groupmod -g "${HOST_USER_ID}" www-data
|
||||
|
||||
chgrp -hR www-data /var/www/html
|
||||
chmod g+rwx /var/www/html/conf
|
||||
|
||||
if [ ! -d /var/documents ]; then
|
||||
echo "[docker-run] => create volume directory /var/documents ..."
|
||||
mkdir -p /var/documents
|
||||
fi
|
||||
echo "[docker-run] => Set Permission to www-data for /var/documents"
|
||||
chown -R www-data:www-data /var/documents
|
||||
|
||||
echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'"
|
||||
cat <<EOF > "${PHP_INI_DIR}/conf.d/dolibarr-php.ini"
|
||||
date.timezone = ${PHP_INI_DATE_TIMEZONE:-UTC}
|
||||
memory_limit = ${PHP_INI_MEMORY_LIMIT:-256M}
|
||||
display_errors = Off
|
||||
EOF
|
||||
|
||||
exec apache2-foreground
|
||||
|
|
|
|||
34
dev/build/docker-dev/mariadb.yml
Normal file
34
dev/build/docker-dev/mariadb.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
networks:
|
||||
internal-pod:
|
||||
internal: true
|
||||
external-pod:
|
||||
internal: false
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: rootpassfordev
|
||||
MYSQL_DATABASE: dolibarr
|
||||
ports:
|
||||
- "3306:3306"
|
||||
networks:
|
||||
- internal-pod
|
||||
- external-pod
|
||||
web:
|
||||
depends_on:
|
||||
- mariadb
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
environment:
|
||||
PMA_HOST: mariadb
|
||||
depends_on:
|
||||
- mariadb
|
||||
ports:
|
||||
- "8080:80"
|
||||
networks:
|
||||
- internal-pod
|
||||
- external-pod
|
||||
|
||||
|
||||
18
dev/build/docker-dev/postgres.yml
Normal file
18
dev/build/docker-dev/postgres.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
networks:
|
||||
internal-pod:
|
||||
internal: true
|
||||
external-pod:
|
||||
internal: false
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
environment:
|
||||
POSTGRES_PASSWORD: rootpassfordev
|
||||
networks:
|
||||
- internal-pod
|
||||
- external-pod
|
||||
web:
|
||||
depends_on:
|
||||
- postgres
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -267,7 +267,7 @@ return [
|
|||
'linkedObjectBlock' => '\CommonObject[]', // See htdocs/core/class/html.form.class.php
|
||||
'mainmenu' => 'string',
|
||||
'menumanager' => '\MenuManager',
|
||||
'mysoc' => '?\Societe',
|
||||
'mysoc' => '\Societe',
|
||||
'nblines' => '\int',
|
||||
'objectoffield' => '\CommonObject',
|
||||
'objsoc' => '\Societe',
|
||||
|
|
@ -440,7 +440,7 @@ return [
|
|||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences
|
||||
// 'PhanTypeMismatchArgument', // Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before)
|
||||
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
|
||||
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ $config['suppress_issue_types'] = [
|
|||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not showing in cti.dolibarr until low count - Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before)
|
||||
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
|
||||
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*/
|
||||
|
||||
|
|
@ -9,30 +9,42 @@
|
|||
$config = include __DIR__.DIRECTORY_SEPARATOR."config.php";
|
||||
|
||||
|
||||
// Note: When more than one fixer is attached to the same Notice, only the last fix is applied.
|
||||
//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
|
||||
//require_once __DIR__.'/plugins/PriceFormFixer.php';
|
||||
//require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php';
|
||||
require_once __DIR__.'/plugins/SelectDateFixer.php';
|
||||
//require_once __DIR__.'/plugins/SelectDateFixer.php';
|
||||
//require_once __DIR__.'/plugins/setPageOrientationFixer.php';
|
||||
//require_once __DIR__.'/plugins/textwithpictoFixer.php';
|
||||
require_once __DIR__.'/plugins/ifsqlFixer.php';
|
||||
//require_once __DIR__.'/plugins/MultiCellFixer.php';
|
||||
//require_once __DIR__.'/plugins/setAutoPageBreakFixer.php';
|
||||
//require_once __DIR__.'/plugins/CellFixer.php';
|
||||
|
||||
//$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/';
|
||||
|
||||
require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
|
||||
//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
|
||||
|
||||
$config['exclude_file_regex'] = '@^(' // @phpstan-ignore-line
|
||||
.'dummy' // @phpstan-ignore-line
|
||||
//.'|(?!htdocs/modulebuilderrtemplate/core/modules/mymodule/doc/pdf_standard_myobject.modules.php).*' // Only this file for test @php-stan-ignore-line
|
||||
.'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
.'|htdocs/admin/tools/ui/.*' // @phpstan-ignore-line
|
||||
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (better analysis)
|
||||
.'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line
|
||||
// Included as stub (old version + incompatible typing hints)
|
||||
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
|
||||
// Included as stub (did not seem properly analysed by phan without it)
|
||||
// Included as stub (did not seem properly analyzed by phan without it)
|
||||
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
|
||||
//.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line
|
||||
//.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line
|
||||
//.'|htdocs/[^mi](?!.*(pdf_|tcpdf)).*\.php' // @phpstan-ignore-line
|
||||
//.'|htdocs/(?!.*modules.*(pdf_|pdf.lib)).*\.php' // @phpstan-ignore-line
|
||||
.')@'; // @phpstan-ignore-line
|
||||
|
||||
// $config['plugins'][] = __DIR__.'/plugins/ParamMatchRegexPlugin.php';
|
||||
$config['plugins'] = [];
|
||||
$config['plugins'][] = 'DeprecateAliasPlugin';
|
||||
// $config['plugins'][] = __DIR__.'/plugins/GetPostFixerPlugin.php';
|
||||
// $config['plugins'][] = 'PHPDocToRealTypesPlugin';
|
||||
|
|
|
|||
185
dev/tools/phan/plugins/CellFixer.php
Normal file
185
dev/tools/phan/plugins/CellFixer.php
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\TCPDI::Cell()";
|
||||
$expected_functionlike2 = "\\TCPDF::Cell()";
|
||||
$expected_name = "Cell";
|
||||
if ($functionlike !== $expected_functionlike
|
||||
&& $functionlike !== $expected_functionlike2) {
|
||||
print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "false","1" => "true");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
// && $arg->expression instanceof StringLiteral
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
print "Number is '$fieldValue'".PHP_EOL;
|
||||
/*
|
||||
// Get the string value of the StringLiteral
|
||||
$fieldValue = $arg->expression->getStringContentsText();
|
||||
print "String is '$fieldValue'".PHP_EOL;
|
||||
*/
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
185
dev/tools/phan/plugins/MultiCellFixer.php
Normal file
185
dev/tools/phan/plugins/MultiCellFixer.php
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\TCPDI::MultiCell()";
|
||||
$expected_functionlike2 = "\\TCPDF::MultiCell()";
|
||||
$expected_name = "MultiCell";
|
||||
if ($functionlike !== $expected_functionlike
|
||||
&& $functionlike !== $expected_functionlike2) {
|
||||
print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "false","1" => "true");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
// && $arg->expression instanceof StringLiteral
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
print "Number is '$fieldValue'".PHP_EOL;
|
||||
/*
|
||||
// Get the string value of the StringLiteral
|
||||
$fieldValue = $arg->expression->getStringContentsText();
|
||||
print "String is '$fieldValue'".PHP_EOL;
|
||||
*/
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
177
dev/tools/phan/plugins/ifsqlFixer.php
Normal file
177
dev/tools/phan/plugins/ifsqlFixer.php
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\DoliDB::ifsql()";
|
||||
$expected_name = "ifsql";
|
||||
if ($functionlike !== $expected_functionlike) {
|
||||
//print "$functionlike != '$expected_functionlike'".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "'0'","1" => "'1'","-1" => "'-1'");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
(in_array($argument_name, ['resok','resko']) && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
// print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
// print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the string value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
//print "Field is '$fieldValue'".PHP_EOL;
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
// print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
// print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
185
dev/tools/phan/plugins/setAutoPageBreakFixer.php
Normal file
185
dev/tools/phan/plugins/setAutoPageBreakFixer.php
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\TCPDI::setAutoPageBreak()";
|
||||
$expected_functionlike2 = "\\TCPDF::setAutoPageBreak()";
|
||||
$expected_name = "setAutoPageBreak";
|
||||
if ($functionlike !== $expected_functionlike
|
||||
&& $functionlike !== $expected_functionlike2) {
|
||||
//print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "false","1" => "true");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'auto' && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
//print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
//print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
//print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
//print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
//print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
// && $arg->expression instanceof StringLiteral
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
print "Number is '$fieldValue'".PHP_EOL;
|
||||
/*
|
||||
// Get the string value of the StringLiteral
|
||||
$fieldValue = $arg->expression->getStringContentsText();
|
||||
print "String is '$fieldValue'".PHP_EOL;
|
||||
*/
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
177
dev/tools/phan/plugins/setPageOrientationFixer.php
Normal file
177
dev/tools/phan/plugins/setPageOrientationFixer.php
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\TCPDF::setPageOrientation()";
|
||||
$expected_name = "setPageOrientation";
|
||||
if ($functionlike !== $expected_functionlike) {
|
||||
//print "$functionlike != '$expected_functionlike'".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "false","1" => "true");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'autopagebreak' && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
// print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
// print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the string value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
//print "Field is '$fieldValue'".PHP_EOL;
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
// print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
// print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
177
dev/tools/phan/plugins/textwithpictoFixer.php
Normal file
177
dev/tools/phan/plugins/textwithpictoFixer.php
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\NumericLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
// var_dump($instance->getTemplateParameters());
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[4];
|
||||
$functiontype = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\Form::textwithpicto()";
|
||||
$expected_name = "textwithpicto";
|
||||
if ($functionlike !== $expected_functionlike) {
|
||||
//print "$functionlike != '$expected_functionlike'".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
$toBoolReplaceArray = array("0" => "'info'","1" => "'help'");
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'type' && in_array($argument_code, array_keys($toBoolReplaceArray)))
|
||||
//|| ($argument_name === 'm' && $argument_code === "''")
|
||||
//|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = $toBoolReplaceArray[$argument_code];
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = $argument_code;
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
// print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
// print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
&& $arg->expression instanceof NumericLiteral
|
||||
) {
|
||||
// Get the string value of the NumericLiteral
|
||||
$fieldValue = (string) $arg->expression;
|
||||
//print "Field is '$fieldValue'".PHP_EOL;
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldValue = ''; // Fake empty
|
||||
} else {
|
||||
// print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldValue !== $expectedStringValue) {
|
||||
// print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgument',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
|
|
@ -123,10 +123,8 @@ AmountOfTicketsByMonthHT
|
|||
AmountOfinterventions
|
||||
AmountOfinterventionsByMonthHT
|
||||
AnObjectWithThisClassNameAlreadyExists
|
||||
Anciennete
|
||||
AnnualByAccountDueDebtMode
|
||||
AnnualByAccountInputOutputMode
|
||||
Anonymous
|
||||
AnotherField
|
||||
Applications
|
||||
Articles
|
||||
|
|
@ -136,8 +134,6 @@ AuthorityDidntReconizeFingerprintConformity
|
|||
AuthorityReconizeFingerprintConformity
|
||||
Auto
|
||||
AutoGenerateDoc
|
||||
AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation
|
||||
Automatic
|
||||
AvailabilityType
|
||||
BAN
|
||||
BI
|
||||
|
|
@ -178,7 +174,6 @@ CalcModeLT
|
|||
CalculatedFromProductsToConsume
|
||||
CancelReception
|
||||
Candidatures
|
||||
CantBeNullOrPositive
|
||||
CantConvertToReducAnInvoiceOfThisType
|
||||
CardFichinter
|
||||
CardProduct
|
||||
|
|
@ -201,7 +196,6 @@ CloneProgression
|
|||
CloneTimes
|
||||
Close Done
|
||||
Close2
|
||||
CloseShipment
|
||||
CodeTooltipHelp
|
||||
Column
|
||||
Combination
|
||||
|
|
@ -216,7 +210,6 @@ ConfirmActionMyObject
|
|||
ConfirmActionTarget
|
||||
ConfirmCloneMyObject
|
||||
ConfirmCloneTask
|
||||
ConfirmCloseShipment
|
||||
ConfirmCreateAdherent
|
||||
ConfirmDeleteAdherent
|
||||
ConfirmDeleteIndividual
|
||||
|
|
@ -418,18 +411,12 @@ FailedToExecutCommandJob
|
|||
FailedToGetCostPrice
|
||||
FailedToOpenFile
|
||||
FailedToReadFile
|
||||
FailedToSetPaid
|
||||
FailedToSetToCancel
|
||||
FailedToUncompressFile
|
||||
FailedToUpdatePrice
|
||||
FailedtoSetToApprove
|
||||
FailedtoSetToDeny
|
||||
FeatureNotAvailableWithThisDatabaseDriver
|
||||
FieldNotFoundInObject
|
||||
FieldsEdit
|
||||
FieldsInsert
|
||||
FieldsLinked
|
||||
FieldsView
|
||||
File encoding
|
||||
FileDidAlreadyExist
|
||||
FileIsNotCorrect
|
||||
|
|
@ -568,7 +555,6 @@ NbOfOrder
|
|||
NbOfSendingsByMonth
|
||||
NbOfTicket
|
||||
NeedRefresh
|
||||
NetMeasure
|
||||
Network
|
||||
NewAdherent
|
||||
NewAdherentAddress
|
||||
|
|
@ -589,7 +575,6 @@ NoOperations
|
|||
NoPasswordGenerationRuleConfigured
|
||||
NoReader
|
||||
NoRecordedUnpaidInvoices
|
||||
NoRecordfound
|
||||
NoRecords
|
||||
NoRecordsToDisplay
|
||||
NoSenderEmailDefined
|
||||
|
|
@ -1099,7 +1084,6 @@ PDF/A-1b
|
|||
PDF/A-3b
|
||||
PartnershipSentByEMail
|
||||
PdfTitle
|
||||
Privileges
|
||||
ProcessingError
|
||||
PurchaseOrder
|
||||
PurchaseOrders
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ $tablib[32] = "DictionaryAccountancyCategory";
|
|||
|
||||
// Requests to extract data
|
||||
$tabsql = array();
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort = array();
|
||||
|
|
@ -111,11 +111,11 @@ $tabfield[32] = "code,label,range_account,category_type,formula,position,country
|
|||
|
||||
// Name of editing fields for record modification
|
||||
$tabfieldvalue = array();
|
||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
|
||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id,entity";
|
||||
|
||||
// Name of the fields in the table for inserting a record
|
||||
$tabfieldinsert = array();
|
||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
|
||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country,entity";
|
||||
|
||||
// Name of the rowid if the field is not of type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
/* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -133,7 +133,7 @@ if ($result) {
|
|||
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write'));
|
||||
}
|
||||
|
||||
$title = $langs->trans('AccountingPeriods');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* Copyright (C) 2017-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2017 André Schild <a.schild@aarboard.ch>
|
||||
* Copyright (C) 2020 Guillaume Alexandre <guillaume@tag-info.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -109,7 +109,7 @@ class AccountancyImport
|
|||
$amount = (float) price2num($arrayrecord[$credit_index]['val']);
|
||||
}
|
||||
|
||||
return "'" . $this->db->escape(abs($amount)) . "'";
|
||||
return "'" . $this->db->escape((string) abs($amount)) . "'";
|
||||
}
|
||||
|
||||
return "''";
|
||||
|
|
@ -117,12 +117,12 @@ class AccountancyImport
|
|||
|
||||
|
||||
/**
|
||||
* Compute direction
|
||||
* Compute direction
|
||||
*
|
||||
* @param array<array{val:null|int|float|string,type:int<-1,1>}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...
|
||||
* @param array<string,string> $listfields Fields list to add
|
||||
* @param int $record_key Record key
|
||||
* @return string Value
|
||||
* @return string Value D or C or ""
|
||||
*/
|
||||
public function computeDirection(&$arrayrecord, $listfields, $record_key)
|
||||
{
|
||||
|
|
@ -139,7 +139,7 @@ class AccountancyImport
|
|||
return $sens;
|
||||
}
|
||||
|
||||
return "''";
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -429,10 +430,10 @@ if ($resql) {
|
|||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount" title="'.price($row[2*$i - 2]).' - '.$row[2*$i - 1].' lines">';
|
||||
print price($row[2*$i - 2]);
|
||||
print '<td class="right nowraponall amount" title="'.price($row[2 * $i - 2]).' - '.$row[2 * $i - 1].' lines">';
|
||||
print price($row[2 * $i - 2]);
|
||||
// Add link to make binding
|
||||
if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) {
|
||||
if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">';
|
||||
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
|
||||
print '</a>';
|
||||
|
|
@ -672,7 +673,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
|
||||
" (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
|
||||
).")",
|
||||
0
|
||||
'0'
|
||||
).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).",";
|
||||
}
|
||||
$sql .= " SUM(".$db->ifsql(
|
||||
|
|
@ -694,7 +695,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty)))",
|
||||
" (fd.total_ht - (fd.buy_price_ht * fd.qty))"
|
||||
).")",
|
||||
0
|
||||
'0'
|
||||
).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).",";
|
||||
}
|
||||
$sql .= " SUM(".$db->ifsql(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -461,7 +461,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1563,14 +1563,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
$fullname = $object->getFullName($langs);
|
||||
|
||||
if ($object->morphy == 'mor') {
|
||||
$companyname = $object->company;
|
||||
$companyname = (string) $object->company;
|
||||
if (!empty($fullname)) {
|
||||
$companyalias = $fullname;
|
||||
$companyalias = (string) $fullname;
|
||||
}
|
||||
} else {
|
||||
$companyname = $fullname;
|
||||
if (!empty($object->company)) {
|
||||
$companyalias = $object->company;
|
||||
$companyalias = (string) $object->company;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2021 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -317,38 +317,76 @@ class Adherent extends CommonObject
|
|||
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* 'type' field format:
|
||||
* 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',
|
||||
* 'select' (list of values are in 'options'. for integer list of values are in 'arrayofkeyval'),
|
||||
* 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:SortField]]]]]]',
|
||||
* 'chkbxlst:...',
|
||||
* 'varchar(x)',
|
||||
* 'text', 'text:none', 'html',
|
||||
* 'double(24,8)', 'real', 'price', 'stock',
|
||||
* 'date', 'datetime', 'timestamp', 'duration',
|
||||
* 'boolean', 'checkbox', 'radio', 'array',
|
||||
* 'mail', 'phone', 'url', 'password', 'ip'
|
||||
* Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)"
|
||||
* 'length' the length of field. Example: 255, '24,8'
|
||||
* 'label' the translation key.
|
||||
* 'alias' the alias used into some old hard coded SQL requests
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'placeholder' to set the placeholder of a varchar field.
|
||||
* 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code like the constructor of the class.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if you need to validate the field with $this->validateField(). Need MAIN_ACTIVATE_VALIDATION_RESULT.
|
||||
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value)
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => '1', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => 3, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => 3, 'position' => 50),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
|
||||
'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'state_id' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => 1, 'position' => 95),
|
||||
'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115),
|
||||
'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120),
|
||||
'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125),
|
||||
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126),
|
||||
'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 127),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => 3, 'position' => 128),
|
||||
'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132),
|
||||
'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135),
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 145),
|
||||
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150),
|
||||
'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 153),
|
||||
'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
||||
|
|
@ -356,13 +394,13 @@ class Adherent extends CommonObject
|
|||
'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165),
|
||||
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175),
|
||||
'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 180),
|
||||
'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user mod', 'enabled' => 1, 'visible' => -1, 'position' => 185),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 3, 'position' => 180),
|
||||
'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 3, 'position' => 185),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => 3, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => 0, 'position' => 195),
|
||||
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805)
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 1000, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort'))
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -3306,7 +3344,7 @@ class Adherent extends CommonObject
|
|||
* Return clickable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{string,mixed} $arraydata Array of data
|
||||
* @param ?array<string,mixed> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2018-2019 Thibault Foucart <support@ptibogxiv.net>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -299,12 +299,12 @@ class AdherentType extends CommonObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete a language for this member type
|
||||
*
|
||||
* @param string $langtodelete Language code to delete
|
||||
* @param User $user Object user making delete
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
* Delete a language for this member type
|
||||
*
|
||||
* @param string $langtodelete Language code to delete
|
||||
* @param User $user Object user making delete
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delMultiLangs($langtodelete, $user)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||
|
|
@ -1001,7 +1001,7 @@ class AdherentType extends CommonObject
|
|||
* Return clickable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{string,mixed} $arraydata Array of data
|
||||
* @param ?array<string,mixed> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -98,7 +98,7 @@ class Subscription extends CommonObject
|
|||
public $fk_bank;
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
|
|
@ -166,7 +166,7 @@ class Subscription extends CommonObject
|
|||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)";
|
||||
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',";
|
||||
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',";
|
||||
$sql .= " '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " ".((float) $this->amount).",";
|
||||
|
|
@ -543,9 +543,9 @@ class Subscription extends CommonObject
|
|||
/**
|
||||
* Return clickable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{selected:?int,member:?Adherent,bank:?Account} $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param ?array{selected?:int|bool,adherent_type?:AdherentType,member?:Adherent,bank?:Account} $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ $arrayfields = array(
|
|||
'd.company' => array('label' => "Company", 'checked' => 1, 'position' => 70),
|
||||
'd.login' => array('label' => "Login", 'checked' => 1),
|
||||
'd.morphy' => array('label' => "MemberNature", 'checked' => 1),
|
||||
't.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 55),
|
||||
't.libelle' => array('label' => "MemberType", 'checked' => 1, 'position' => 55),
|
||||
'd.address' => array('label' => "Address", 'checked' => 0),
|
||||
'd.zip' => array('label' => "Zip", 'checked' => 0),
|
||||
'd.town' => array('label' => "Town", 'checked' => 0),
|
||||
|
|
@ -199,6 +199,10 @@ $tableprefix = 'd';
|
|||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
// Special case already added
|
||||
if (in_array($key, array('fk_adherent_type', 'state_id', 'country'))) { // Already managed by another field key in arrayfields
|
||||
continue;
|
||||
}
|
||||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
|
|
@ -222,7 +226,6 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||
// Security check
|
||||
$result = restrictedArea($user, 'adherent');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -102,20 +102,20 @@ $fieldstosearchall = array(
|
|||
'c.note' => "Label",
|
||||
);
|
||||
$arrayfields = array(
|
||||
'd.ref' => array('label' => "Ref", 'checked' => 1),
|
||||
'd.fk_type' => array('label' => "Type", 'checked' => 1),
|
||||
'd.lastname' => array('label' => "Lastname", 'checked' => 1),
|
||||
'd.firstname' => array('label' => "Firstname", 'checked' => 1),
|
||||
'd.login' => array('label' => "Login", 'checked' => 1),
|
||||
'c.note' => array('label' => "Label", 'checked' => 1),
|
||||
'd.bank' => array('label' => "BankAccount", 'checked' => 1, 'enabled' => (isModEnabled('bank'))),
|
||||
'd.ref' => array('label' => "Ref", 'checked' => '1'),
|
||||
'd.fk_type' => array('label' => "Type", 'checked' => '1'),
|
||||
'd.lastname' => array('label' => "Lastname", 'checked' => '1'),
|
||||
'd.firstname' => array('label' => "Firstname", 'checked' => '1'),
|
||||
'd.login' => array('label' => "Login", 'checked' => '1'),
|
||||
'c.note' => array('label' => "Label", 'checked' => '1'),
|
||||
'd.bank' => array('label' => "BankAccount", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('bank'))),
|
||||
/*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0),
|
||||
'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/
|
||||
'c.dateadh' => array('label' => "DateSubscription", 'checked' => 1, 'position' => 100),
|
||||
'c.datef' => array('label' => "EndSubscription", 'checked' => 1, 'position' => 101),
|
||||
'd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 102),
|
||||
'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
|
||||
'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
|
||||
'c.dateadh' => array('label' => "DateSubscription", 'checked' => '1', 'position' => 100),
|
||||
'c.datef' => array('label' => "EndSubscription", 'checked' => '1', 'position' => 101),
|
||||
'd.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 102),
|
||||
'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500),
|
||||
'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500),
|
||||
// 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
|
||||
);
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ if ($search_ref) {
|
|||
}
|
||||
}
|
||||
if ($search_type > 0) {
|
||||
$sql .= natural_search(array('c.fk_type'), $search_type);
|
||||
$sql .= natural_search(array('c.fk_type'), (string) $search_type);
|
||||
}
|
||||
if ($search_lastname) {
|
||||
$sql .= natural_search(array('d.lastname', 'd.societe'), $search_lastname);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
|
|
@ -136,6 +136,9 @@ $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type');
|
|||
*/
|
||||
$error = 0;
|
||||
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
$search_ref = "";
|
||||
$search_lastname = "";
|
||||
|
|
@ -283,6 +286,9 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
|||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type');
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
$totalarray = [
|
||||
'nbfield' => 0,
|
||||
];
|
||||
|
||||
// List of members type
|
||||
if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
|
|
@ -329,8 +335,14 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
// $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
|
@ -341,19 +353,48 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<th> </th>';
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.rowid']['checked'])) {
|
||||
print '<th>'.$langs->trans("Ref").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<th>'.$langs->trans($arrayfields['t.libelle']['label']).'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.morphy']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("MembersNature").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.duration']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("MembershipDuration").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.subscription']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("Amount").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.vote']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.statut']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("Status").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<th>'.$langs->trans("Ref").'</th>';
|
||||
print '<th>'.$langs->trans("Label").'</th>';
|
||||
print '<th class="center">'.$langs->trans("MembersNature").'</th>';
|
||||
print '<th class="center">'.$langs->trans("MembershipDuration").'</th>';
|
||||
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||
print '<th class="center">'.$langs->trans("Amount").'</th>';
|
||||
print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
|
||||
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||
print '<th class="center">'.$langs->trans("Status").'</th>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<th> </th>';
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
|
@ -397,47 +438,55 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '<td class="center"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="nowraponall">';
|
||||
print $membertype->getNomUrl(1);
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') {
|
||||
print $langs->trans("Physical");
|
||||
} elseif ($objp->morphy == 'mor') {
|
||||
print $langs->trans("Moral");
|
||||
} else {
|
||||
print $langs->trans("MorAndPhy");
|
||||
if (!empty($arrayfields['t.rowid']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
print $membertype->getNomUrl(1);
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center nowrap">';
|
||||
if ($objp->duration) {
|
||||
$duration_value = intval($objp->duration);
|
||||
if ($duration_value > 1) {
|
||||
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.morphy']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') {
|
||||
print $langs->trans("Physical");
|
||||
} elseif ($objp->morphy == 'mor') {
|
||||
print $langs->trans("Moral");
|
||||
} else {
|
||||
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
|
||||
print $langs->trans("MorAndPhy");
|
||||
}
|
||||
$unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
|
||||
print max(1, $duration_value).' '.$dur[$unit];
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.duration']['checked'])) {
|
||||
print '<td class="center nowrap">';
|
||||
if ($objp->duration) {
|
||||
$duration_value = intval($objp->duration);
|
||||
if ($duration_value > 1) {
|
||||
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
|
||||
} else {
|
||||
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
|
||||
}
|
||||
$unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
|
||||
print max(1, $duration_value).' '.$dur[$unit];
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.subscription']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.vote']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.statut']['checked'])) {
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -320,7 +320,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
|||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -413,7 +413,7 @@ foreach ($dirmodels as $reldir) {
|
|||
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -471,7 +471,7 @@ print '</tr>';
|
|||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print $form->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
|
||||
print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');
|
||||
|
||||
print '</form>';
|
||||
print "\n".'<!-- End Other Const -->'."\n";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -226,7 +226,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
|
||||
if (getDolGlobalString('CHEQUERECEIPTS_ADDON').'.php' == $file) { // If module is the one used, we show existing errors
|
||||
if (!empty($module->error)) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -316,7 +316,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -456,7 +456,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -328,7 +328,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -456,7 +456,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
|
|||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -2540,7 +2540,7 @@ if ($id > 0) {
|
|||
} elseif ($value == 'block_if_negative') {
|
||||
$valuetoshow = yn($obj->{$value});
|
||||
} elseif ($value == 'icon') {
|
||||
$valuetoshow = $obj->{$value}." ".img_picto("", $obj->{$value});
|
||||
$valuetoshow = $obj->{$value}." ".img_picto("", preg_replace('/^fa-/', '', $obj->{$value}));
|
||||
} elseif ($value == 'type_duration') {
|
||||
$TDurationTypes = array('y' => $langs->trans('Years'), 'm' => $langs->trans('Month'), 'w' => $langs->trans('Weeks'), 'd' => $langs->trans('Days'), 'h' => $langs->trans('Hours'), 'i' => $langs->trans('Minutes'));
|
||||
if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
|
||||
|
|
@ -2561,7 +2561,7 @@ if ($id > 0) {
|
|||
if (in_array($value, array('nbjour', 'decalage', 'pos', 'position', 'deposit_percent'))) {
|
||||
$class .= ' right';
|
||||
}
|
||||
if (in_array($value, array('type_vat', 'localtax1_type', 'localtax2_type'))) {
|
||||
if (in_array($value, array('icon', 'type_vat', 'localtax1_type', 'localtax2_type'))) {
|
||||
$class .= ' nowraponall';
|
||||
}
|
||||
if (in_array($value, array('use_default', 'fk_parent', 'sortorder'))) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -272,7 +272,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -408,7 +408,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, -1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, -1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/faitdivers.php
|
||||
* \ingroup faitdivers
|
||||
* \brief Page to setupe module Socialnetworks
|
||||
* \file htdocs/admin/fediverse.php
|
||||
* \ingroup fedivers
|
||||
* \brief Page to setup fedivers in module Socialnetworks
|
||||
*/
|
||||
|
||||
//load Dolibarr environment
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
}
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -503,7 +503,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, -1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, -1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -419,7 +419,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* 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>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -331,7 +331,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -471,7 +471,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ if ($mode == 'other') {
|
|||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Language");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td><td>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Default language
|
||||
|
|
@ -435,7 +435,7 @@ if ($mode == 'other') {
|
|||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Miscellaneous");
|
||||
print '</td>';
|
||||
print '<td class="titlefieldmiddle"></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
|
|
@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
|
||||
if (getDolGlobalString('FACTURE_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors
|
||||
if (!empty($module->error)) {
|
||||
|
|
@ -608,7 +608,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -450,7 +450,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ if ($action == 'edit') {
|
|||
clearstatcache();
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -613,11 +614,11 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -664,6 +665,7 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
|
@ -868,7 +870,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO');
|
||||
if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) {
|
||||
if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')));
|
||||
} else {
|
||||
print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
|
||||
}
|
||||
|
|
@ -892,7 +894,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO');
|
||||
if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) {
|
||||
if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')));
|
||||
} else {
|
||||
print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
|
||||
}
|
||||
|
|
@ -910,7 +912,7 @@ if ($action == 'edit') {
|
|||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) {
|
||||
print img_warning($langs->trans("Mandatory"));
|
||||
} elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -958,7 +960,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
print '<td>'.(getDolGlobalString('MAIN_MAIL_ERRORS_TO'));
|
||||
if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) {
|
|||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) {
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
|
|
@ -349,6 +353,7 @@ if ($action == 'edit') {
|
|||
|
||||
clearstatcache();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -553,6 +558,26 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
// From
|
||||
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
|
||||
print '<tr class="oddeven"><td class="">';
|
||||
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
|
||||
print ' '.$help;
|
||||
print '</td>';
|
||||
print '<td><input class="flat minwidth300" name="MAIN_MAIL_EMAIL_FROM_PASSWORDRESET" value="'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET');
|
||||
print '"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
|
@ -685,6 +710,36 @@ if ($action == 'edit') {
|
|||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
// From
|
||||
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
|
||||
print ' '.$help;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) {
|
||||
print '<span class="opacitymedium">'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'</span>';
|
||||
} else {
|
||||
print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET');
|
||||
}
|
||||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) {
|
||||
print img_warning($langs->trans("Mandatory"));
|
||||
} elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -30,12 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
|
@ -263,13 +263,15 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
$mrp = new Mo($db);
|
||||
$mrp->initAsSpecimen();
|
||||
$product = new Product($db);
|
||||
$product->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$mrp->type = 0;
|
||||
$nextval = $module->getNextValue($mysoc, $mrp);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$nextval = $module->getNextValue($product, $mrp);
|
||||
if ((string) $nextval != $langs->trans("NotAvailable")) {
|
||||
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||
|
|
@ -282,7 +284,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -396,7 +398,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
if ($conf->global->MRP_MO_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString("MRP_MO_ADDON_PDF") == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
|
@ -417,7 +419,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -139,9 +139,9 @@ if ($action == 'add_currency') {
|
|||
}
|
||||
} elseif ($action == 'setapilayer') {
|
||||
if (GETPOSTISSET('modify_apilayer')) {
|
||||
dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha'));
|
||||
dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'));
|
||||
//dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'));
|
||||
dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
//dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$multiurrency = new MultiCurrency($db);
|
||||
$result = $multiurrency->syncRates(getDolGlobalString('MULTICURRENCY_APP_ID'));
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -509,7 +509,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
|
||||
if (getDolGlobalString('PAYMENT_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors
|
||||
if (!empty($module->error)) {
|
||||
|
|
|
|||
|
|
@ -224,11 +224,33 @@ if (isModEnabled('propal')) {
|
|||
print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -236,18 +258,7 @@ if (isModEnabled('propal')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -261,7 +272,31 @@ if (isModEnabled('order')) {
|
|||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -269,18 +304,18 @@ if (isModEnabled('order')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS);
|
||||
print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -289,74 +324,6 @@ if (isModEnabled('order')) {
|
|||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_proposal')) {
|
||||
$langs->load("supplier_proposal");
|
||||
print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_order')) {
|
||||
$langs->load("supplier_order");
|
||||
print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (isModEnabled('invoice')) {
|
||||
print load_fiche_titre($langs->trans("Invoices"), '', 'bill');
|
||||
|
|
@ -365,6 +332,28 @@ if (isModEnabled('invoice')) {
|
|||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -372,9 +361,10 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
|
||||
print '</td><td>';
|
||||
|
|
@ -430,7 +420,7 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS);
|
||||
print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -466,7 +456,77 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, $conf->global->INVOICE_HIDE_LINKED_OBJECT);
|
||||
print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_proposal')) {
|
||||
$langs->load("supplier_proposal");
|
||||
print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_order')) {
|
||||
$langs->load("supplier_order");
|
||||
print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -495,7 +555,6 @@ if (isModEnabled('shipping')) {
|
|||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('reception')) {
|
||||
print load_fiche_titre($langs->trans("Receptions"), '', 'reception');
|
||||
|
||||
|
|
@ -572,7 +631,7 @@ $maxfilesizearray = getMaxFileSizeArray();
|
|||
$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
|
||||
$documenturl = DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
|
||||
$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
|
||||
$documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP');
|
||||
}
|
||||
$modulepart = 'mycompany';
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -346,7 +346,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -486,7 +486,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
209
htdocs/admin/propal_pdf.php
Normal file
209
htdocs/admin/propal_pdf.php
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.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 htdocs/admin/propal.php
|
||||
* \ingroup propale
|
||||
* \brief Setup page for commercial proposal module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "errors", "propal"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'propal';
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$error = 0;
|
||||
if ($action == "update") {
|
||||
if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
|
||||
dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_PROPAL", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
// Terms of sale
|
||||
if ($_FILES['termsofsale']["name"]) {
|
||||
if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported.
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors');
|
||||
} else {
|
||||
$dirforterms = $conf->propal->dir_output.'/';
|
||||
$original_file = $_FILES['termsofsale']["name"];
|
||||
$result = dol_move_uploaded_file($_FILES['termsofsale']["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES['termsofsale']['error']);
|
||||
if ($result) {
|
||||
dolibarr_set_const($db, 'MAIN_INFO_PROPAL_TERMSOFSALE', $original_file, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Terms of sale
|
||||
if ($action == 'removetermsofsale') {
|
||||
$filename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE');
|
||||
$file = $conf->propal->dir_output.'/'.$filename;
|
||||
|
||||
if ($filename != '') {
|
||||
dol_delete_file($file);
|
||||
}
|
||||
dolibarr_del_const($db, 'MAIN_INFO_PROPAL_TERMSOFSALE', $conf->entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader('', $langs->trans("PropalSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-propal');
|
||||
|
||||
//if ($mesg) print $mesg;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = propal_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'pdf', $langs->trans("Proposals"), -1, 'propal');
|
||||
|
||||
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print load_fiche_titre($langs->trans("Files"), '', 'file');
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
// Terms of sale
|
||||
$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
|
||||
$documenturl = DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
|
||||
$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
|
||||
}
|
||||
$modulepart = 'propal';
|
||||
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("TERMSOFSALE"), $tooltiptermsofsale).'</label></td><td>';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
|
||||
|
||||
if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) {
|
||||
$termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE");
|
||||
if (file_exists($conf->propal->dir_output.'/'.$termofsale)) {
|
||||
$file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale);
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '');
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<center><input type="submit" class="button button-edit reposition" value="'.$langs->trans("Modify").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -656,7 +656,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 SuperAdmin
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -337,7 +337,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -473,7 +473,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -303,7 +303,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -441,7 +441,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
|
@ -446,7 +446,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -307,7 +307,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
|
||||
if (getDolGlobalString("PAYMENT_ADDON").'.php' == $file) { // If module is the one used, we show existing errors
|
||||
if (!empty($module->error)) {
|
||||
|
|
@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) {
|
|||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -336,7 +336,7 @@ foreach ($dirmodels as $reldir) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -475,7 +475,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ if ($mode == 'searchkey') {
|
|||
$transvalue = GETPOST('transvalue', 'restricthtml');
|
||||
}
|
||||
|
||||
$entity = $conf->entity;
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
$entity = GETPOST('entity', 'int');
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
|
|
@ -128,10 +133,19 @@ if ($action == 'update') {
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($entity == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Entity")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".(GETPOSTINT('rowid'));
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "overwrite_trans set transkey = '" . $db->escape(
|
||||
$transkey
|
||||
) . "', transvalue = '" . $db->escape($transvalue) . "', entity = '" . $db->escape(
|
||||
$entity
|
||||
) . "' WHERE rowid = " . ((int) GETPOST('rowid', 'int'));
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$db->commit();
|
||||
|
|
@ -368,7 +382,9 @@ if ($mode == 'overwrite') {
|
|||
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("TranslationKey", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("NewTranslationStringToShow", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
||||
//if (isModEnabled('multicompany') && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'Entity', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
|
@ -376,21 +392,36 @@ if ($mode == 'overwrite') {
|
|||
// Line to add new record
|
||||
print "\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Lang
|
||||
print '<td>';
|
||||
print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0, 'maxwidth250', 1);
|
||||
print '</td>'."\n";
|
||||
|
||||
// Trans key
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey : "").'">';
|
||||
print '</td><td>';
|
||||
print '</td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" class="quatrevingtpercent"'.$disablededit.' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue : "").'">';
|
||||
print '</td>';
|
||||
|
||||
// Multi company
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print '<td>';
|
||||
print '<input type="text" class="quatrevingtpercent"' . $disablededit . ' name="entity" id="entity" value="' . (!empty($entity) ? $entity : "") . '">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add" title="'.dol_escape_htmltag($langs->trans("YouMustEnableTranslationOverwriteBefore")).'">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Show constants
|
||||
$sql = "SELECT rowid, entity, lang, transkey, transvalue";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
|
||||
|
|
@ -411,7 +442,10 @@ if ($mode == 'overwrite') {
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Lang
|
||||
print '<td>'.dol_escape_htmltag($obj->lang).'</td>'."\n";
|
||||
|
||||
// Trans key
|
||||
print '<td>';
|
||||
if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) {
|
||||
print '<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).'">';
|
||||
|
|
@ -441,6 +475,19 @@ if ($mode == 'overwrite') {
|
|||
}
|
||||
print '</td>';
|
||||
|
||||
// Entity limit to superadmin
|
||||
if (isModEnabled('multicompany') && empty($user->entity)) {
|
||||
print '<td>';
|
||||
if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) {
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="' . ((int) $obj->entity) . '">';
|
||||
} else {
|
||||
print dol_escape_htmltag($obj->entity);
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<input type="hidden" name="const[' . $i . '][entity]" value="' . ((int) $obj->entity) . '">';
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) {
|
||||
print '<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.'">';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -317,7 +317,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -236,7 +236,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -281,7 +281,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -415,7 +415,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -301,7 +301,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -439,7 +439,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Jose MARTINEZ <jose.martinez@pichinov.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -84,23 +84,23 @@ class Asset extends CommonObject
|
|||
*/
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object"),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,),
|
||||
'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1,),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object", "css" => "maxwidth150"),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125', 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,),
|
||||
'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1, 'csslist' => 'tdoverflowmax75', 'css' => 'maxwidth300'),
|
||||
'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'validate' => 1,),
|
||||
'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,),
|
||||
'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1,),
|
||||
'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,),
|
||||
'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1, 'csslist' => 'tdoverflowmax75'),
|
||||
'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1, 'csslist' => 'tdoverflowmax75'),
|
||||
'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1, 'csslist' => 'maxwidth50 tdoverflowmax50', 'css' => 'maxwidth50imp'),
|
||||
'date_acquisition' => array('type' => 'date', 'label' => 'AssetDateAcquisition', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1,),
|
||||
'date_start' => array('type' => 'date', 'label' => 'AssetDateStart', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1,),
|
||||
'acquisition_value_ht' => array('type' => 'price', 'label' => 'AssetAcquisitionValueHT', 'enabled' => 1, 'position' => 110, 'notnull' => 1, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,),
|
||||
'recovered_vat' => array('type' => 'price', 'label' => 'AssetRecoveredVAT', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,),
|
||||
'reversal_date' => array('type' => 'date', 'label' => 'AssetReversalDate', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => 1,),
|
||||
'reversal_amount_ht' => array('type' => 'price', 'label' => 'AssetReversalAmountHT', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,),
|
||||
'reversal_amount_ht' => array('type' => 'price', 'label' => 'AssetReversalAmountHT', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1, 'csslist' => 'maxwidth50'),
|
||||
'disposal_date' => array('type' => 'date', 'label' => 'AssetDisposalDate', 'enabled' => 1, 'position' => 200, 'notnull' => 0, 'visible' => -2,),
|
||||
'disposal_amount_ht' => array('type' => 'price', 'label' => 'AssetDisposalAmount', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -2, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
|
||||
'fk_disposal_type' => array('type' => 'sellist:c_asset_disposal_type:label:rowid::active=1', 'label' => 'AssetDisposalType', 'enabled' => 1, 'position' => 220, 'notnull' => 0, 'visible' => -2, 'index' => 1, 'validate' => 1,),
|
||||
|
|
@ -713,7 +713,7 @@ class Asset extends CommonObject
|
|||
*/
|
||||
|
||||
$sql = "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht";
|
||||
$sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', 1, 0) . " AS bookkeeping";
|
||||
$sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', '1', '0') . " AS bookkeeping";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
|
||||
$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
|
||||
$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class AssetDepreciationOptions extends CommonObject
|
|||
*/
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array();
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class AssetModel extends CommonObject
|
|||
*/
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
|
||||
|
|
|
|||
|
|
@ -53,26 +53,29 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected
|
|||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'assetlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$mode = GETPOST('mode', 'alpha'); // mode view (kanban or common)
|
||||
$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
|
||||
$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize a technical objects
|
||||
// Initialize technical objects
|
||||
$object = new Asset($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
@ -90,7 +93,7 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
// Initialize array of search criteria
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search_all = trim(GETPOST('search_all', 'alphanohtml'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
|
|
@ -111,12 +114,13 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$tableprefix = 't';
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? 0 : 1),
|
||||
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
|
|
@ -171,7 +175,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
|||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$parameters = array('arrayfields' => &$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -190,6 +194,7 @@ if (empty($reshook)) {
|
|||
$search[$key.'_dtend'] = '';
|
||||
}
|
||||
}
|
||||
$search_all = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
}
|
||||
|
|
@ -202,6 +207,8 @@ if (empty($reshook)) {
|
|||
$objectclass = 'Asset';
|
||||
$objectlabel = 'Asset';
|
||||
$uploaddir = $conf->asset->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
|
|
@ -223,17 +230,17 @@ $morecss = array();
|
|||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
$sql .= $object->getFieldList('t');
|
||||
$sql = "SELECT";
|
||||
$sql .= " ".$object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : "");
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
||||
|
|
@ -245,10 +252,10 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array
|
|||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
|
|
@ -264,18 +271,24 @@ foreach ($search as $key => $val) {
|
|||
}
|
||||
$mode_search = 2;
|
||||
}
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
if (empty($object->fields[$key]['searchmulti'])) {
|
||||
if (!is_array($search[$key]) && $search[$key] != '') {
|
||||
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
} else {
|
||||
if (is_array($search[$key]) && !empty($search[$key])) {
|
||||
$sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
||||
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
||||
if (preg_match('/_dtstart$/', $key)) {
|
||||
$sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'";
|
||||
$sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
if (preg_match('/_dtend$/', $key)) {
|
||||
$sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
|
||||
$sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -289,13 +302,13 @@ if ($search_all) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required
|
||||
$sql .= " GROUP BY ";
|
||||
foreach($object->fields as $key => $val) {
|
||||
$sql .= "t.".$key.", ";
|
||||
$sql .= "t.".$db->sanitize($key).", ";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
|
|
@ -303,9 +316,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add where from hooks
|
||||
// Add groupby from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
*/
|
||||
|
|
@ -313,8 +326,8 @@ $sql = preg_replace('/,\s*$/', '', $sql);
|
|||
// Add HAVING from hooks
|
||||
/*
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrint) : "";
|
||||
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
|
||||
*/
|
||||
|
||||
// Count total nb of records
|
||||
|
|
@ -331,7 +344,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
|||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
|
|
@ -354,10 +367,10 @@ $num = $db->num_rows($resql);
|
|||
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/asset/card.php?id='.$id);
|
||||
header("Location: ".DOL_URL_ROOT.'/asset/card.php?id='.((int) $id));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -365,36 +378,46 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
|
|||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-asset page-list');
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-list bodyforlist');
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
if ($groupby != '') {
|
||||
$param .= '&groupby='.urlencode($groupby);
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
if (is_array($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
|
||||
$param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
|
||||
$param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
|
||||
$param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array('param' => &$param);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
|
|
@ -404,7 +427,7 @@ $arrayofmassactions = array(
|
|||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
|
|
@ -423,6 +446,9 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/asset/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||
|
|
@ -437,10 +463,14 @@ $trackid = 'asset'.$object->id;
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all) {
|
||||
$setupstring = '';
|
||||
// @phan-suppress-next-line PhanEmptyForeach
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
$setupstring .= $key."=".$val.";";
|
||||
}
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
|
||||
print '<!-- Search done like if ASSET_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
@ -455,6 +485,9 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
$parameters = array(
|
||||
'arrayfields' => &$arrayfields,
|
||||
);
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
|
|
@ -463,7 +496,8 @@ if (!empty($moreforfilter)) {
|
|||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
|
|
@ -472,8 +506,16 @@ print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
|
|||
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
//$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
|
|
@ -481,15 +523,19 @@ foreach ($object->fields as $key => $val) {
|
|||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
if (empty($val['searchmulti'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
} else {
|
||||
print $form->multiselectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 0, 0, 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
}
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
|
|
@ -500,9 +546,9 @@ foreach ($object->fields as $key => $val) {
|
|||
} elseif ($key == 'lang') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
print '<input type="text" class="flat maxwidth'.(in_array($val['type'], array('integer', 'price')) ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -512,19 +558,28 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!$conf->main_checkbox_left_column) {
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
|
|
@ -533,21 +588,26 @@ foreach ($object->fields as $key => $val) {
|
|||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
if (!$conf->main_checkbox_left_column) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
|
|
@ -565,9 +625,11 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
|
|||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
|
|
@ -576,8 +638,26 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
// Store properties in $object
|
||||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
// Show here line of result
|
||||
print '<tr class="oddeven">';
|
||||
// Show line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Fields
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
|
|
@ -587,18 +667,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
}
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
} elseif ($key == 'ref') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key) && !in_array($key, array('ref'))) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
|
|
@ -628,20 +712,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
if (empty($conf->main_checkbox_left_column)) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
|
@ -667,7 +753,7 @@ if ($num == 0) {
|
|||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -51,6 +51,8 @@ if (!defined('NOREQUIREAJAX')) {
|
|||
/**
|
||||
* Empty header
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $head Optional head lines
|
||||
* @param string $title HTML title
|
||||
* @param string $help_url Url links to help page
|
||||
|
|
@ -68,7 +70,7 @@ if (!defined('NOREQUIREAJAX')) {
|
|||
* @param int $disablenoindex Disable the "noindex" on meta robot header
|
||||
* @return void
|
||||
*/
|
||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0)
|
||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print '<html>'."\n";
|
||||
print '<head>'."\n";
|
||||
|
|
@ -79,12 +81,14 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab
|
|||
/**
|
||||
* Empty footer
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $comment A text to add as HTML comment into HTML generated page
|
||||
* @param string $zone 'private' (for private pages) or 'public' (for public pages)
|
||||
* @param int $disabledoutputofmessages Clear all messages stored into session without displaying them
|
||||
* @return void
|
||||
*/
|
||||
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0)
|
||||
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print "\n".'</html>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -353,7 +353,7 @@ $help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Ina
|
|||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-blockedlog page-admin_blockedlog_list');
|
||||
|
||||
$blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
|
||||
$blocks = $block_static->getLog('all', (int) $search_id, $MAXLINES, $sortfield, $sortorder, (int) $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
|
||||
if (!is_array($blocks)) {
|
||||
if ($blocks == -2) {
|
||||
setEventMessages($langs->trans("TooManyRecordToScanRestrictFilters", $MAXLINES), null, 'errors');
|
||||
|
|
@ -440,7 +440,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||
print '<div class="right">';
|
||||
print $langs->trans("RestrictYearToExport").': ';
|
||||
// Month
|
||||
print $formother->select_month(GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
|
||||
print $formother->select_month((string) GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
|
||||
print '<input type="text" name="yeartoexport" class="valignmiddle maxwidth50imp" value="'.GETPOST('yeartoexport').'" placeholder="'.$langs->trans("Year").'">';
|
||||
print '<input type="hidden" name="withtab" value="'.GETPOST('withtab', 'alpha').'">';
|
||||
print '<input type="submit" name="downloadcsv" class="button" value="'.$langs->trans('DownloadLogCSV').'">';
|
||||
|
|
@ -491,7 +491,7 @@ print '</td>';
|
|||
|
||||
// User
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150');
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150');
|
||||
print '</td>';
|
||||
|
||||
// Actions code
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2020 Laurent Destailleur <eldy@destailleur.fr>
|
||||
* Copyright (C) 2022 charlene benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -102,12 +102,12 @@ class BlockedLog
|
|||
public $fk_user = 0;
|
||||
|
||||
/**
|
||||
* @var int|string date_creation
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_creation;
|
||||
|
||||
/**
|
||||
* @var int|string $date_modification;
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_modification;
|
||||
|
||||
|
|
@ -395,11 +395,11 @@ class BlockedLog
|
|||
/**
|
||||
* Populate properties of log from object data
|
||||
*
|
||||
* @param CommonObject $object object to store
|
||||
* @param string $action action
|
||||
* @param float|int $amounts amounts
|
||||
* @param ?User $fuser User object (forced)
|
||||
* @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO
|
||||
* @param CommonObject|stdClass $object object to store
|
||||
* @param string $action action
|
||||
* @param float|int $amounts amounts
|
||||
* @param ?User $fuser User object (forced)
|
||||
* @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO
|
||||
*/
|
||||
public function setObjectData(&$object, $action, $amounts, $fuser = null)
|
||||
{
|
||||
|
|
@ -1115,7 +1115,7 @@ class BlockedLog
|
|||
if (empty($previoussignature)) {
|
||||
$sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog";
|
||||
if ($beforeid) {
|
||||
$sql.= $this->db->hintindex('entity_rowid', 1);
|
||||
$sql .= $this->db->hintindex('entity_rowid', 1);
|
||||
}
|
||||
$sql .= " WHERE entity = ".((int) $conf->entity);
|
||||
if ($beforeid) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -135,7 +136,7 @@ $form = new Form($db);
|
|||
$formfile = new FormFile($db);
|
||||
|
||||
$title = $langs->trans('BOM');
|
||||
$help_url ='EN:Module_BOM';
|
||||
$help_url = 'EN:Module_BOM';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bom page-net_needs');
|
||||
|
||||
|
|
@ -330,7 +331,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($useunit) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
|
||||
$unit = new CUnits($db);
|
||||
$unit->fetch($elem['fk_unit']);
|
||||
$unit->fetch((int) $elem['fk_unit']);
|
||||
print(isset($unit->label) ? " ".$langs->trans(ucwords($unit->label))." " : '');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class BOM extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",),
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class BOMLine extends CommonObjectLine
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -153,7 +153,7 @@ print '</td>';
|
|||
if ($filtertype != 1) { // Product
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { // For product, unit is shown only if option PRODUCT_USE_UNITS is on
|
||||
print '<td class="linecoluseunit nowrap">';
|
||||
$label = measuringUnitString($line->fk_unit, '', '', 1);
|
||||
$label = measuringUnitString((int) $line->fk_unit, '', null, 1);
|
||||
if ($label !== '') {
|
||||
print $langs->trans($label);
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ if ($resql) {
|
|||
$total_cost += $sub_bom->total_cost * $sub_bom_line->qty * (float) $line->qty;
|
||||
} elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) {
|
||||
//Convert qty to hour
|
||||
$unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1);
|
||||
$unit = measuringUnitString($sub_bom_line->fk_unit, '', null, 1);
|
||||
$qty = convertDurationtoHour($sub_bom_line->qty, $unit);
|
||||
$workstation = new Workstation($this->db);
|
||||
$res = $workstation->fetch($sub_bom_product->fk_default_workstation);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -101,7 +101,7 @@ class Availabilities extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
|
||||
|
|
@ -831,7 +831,7 @@ class Availabilities extends CommonObject
|
|||
* Return a thumb for kanban views
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{string,mixed} $arraydata Array of data
|
||||
* @param ?array<string,mixed> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -101,7 +101,7 @@ class Calendar extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"),
|
||||
|
|
@ -816,8 +816,8 @@ class Calendar extends CommonObject
|
|||
/**
|
||||
* Return a thumb for kanban views
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{string,mixed} $arraydata Array of data
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param ?array<string,mixed> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ class Categorie extends CommonObject
|
|||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => '1', 'notnull' => 1, 'index' => 1, 'position' => 5),
|
||||
'fk_parent' => array('type' => 'integer', 'label' => 'Fkparent', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',),
|
||||
'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
|
||||
'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150', 'showoncombobox' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,),
|
||||
'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
|
||||
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
|
||||
|
|
@ -1833,7 +1833,7 @@ class Categorie extends CommonObject
|
|||
}
|
||||
|
||||
// Check contrast with background and correct text color
|
||||
$forced_color = 'categtextwhite'; // We want color white because the background is dark (grey or other)
|
||||
$forced_color = 'categtextwhite'; // We want color white because the getNomUrl of a tag is always called inside a dark background like '<span color="bbb"></span>' to show it as a tag. TODO Add this in param to force when called outside of span.
|
||||
if ($this->color) {
|
||||
if (colorIsLight($this->color)) { // If color is light, we force color to dark
|
||||
$forced_color = 'categtextblack';
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $permissiontoadd)
|
|||
if ($forcelangprod == $current_lang) {
|
||||
$object->label = $libelle;
|
||||
$object->description = dol_htmlcleanlastbr($desc);
|
||||
|
||||
$object->update($user);
|
||||
} else {
|
||||
$object->multilangs[$forcelangprod]["label"] = $libelle;
|
||||
$object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc);
|
||||
|
|
|
|||
|
|
@ -298,9 +298,9 @@ dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'la
|
|||
// Confirmation of deletion
|
||||
if ($action == 'delete') {
|
||||
if ($backtopage) {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type).'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2);
|
||||
} else {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -349,11 +349,11 @@ if ($reshook < 0) {
|
|||
if (empty($reshook)) {
|
||||
if ($user->hasRight('categorie', 'creer')) {
|
||||
$socid = ($object->socid ? "&socid=".$object->socid : "");
|
||||
print '<a class="butAction" href="edit.php?id='.$object->id.$socid.'&type='.$type.'">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="edit.php?id='.$object->id.$socid.'&type='.urlencode($type).'">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
if ($user->hasRight('categorie', 'supprimer')) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -363,8 +363,8 @@ $newcardbutton = '';
|
|||
if ($user->hasRight('categorie', 'creer')) {
|
||||
$link = DOL_URL_ROOT.'/categories/card.php';
|
||||
$link .= '?action=create';
|
||||
$link .= '&type='.$type;
|
||||
$link .= '&catorigin='.$object->id;
|
||||
$link .= '&type='.urlencode($type);
|
||||
$link .= '&catorigin='.((int) $object->id);
|
||||
$link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id);
|
||||
|
||||
$newcardbutton = '<div class="right">';
|
||||
|
|
@ -462,13 +462,13 @@ if ($cats < 0) {
|
|||
$entry .= $counter;
|
||||
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_view().'</a>';
|
||||
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.urlencode($type).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.urlencode($type)).'">'.img_view().'</a>';
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_edit().'</a>';
|
||||
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.urlencode($type).'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.urlencode($type)).'">'.img_edit().'</a>';
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_delete().'</a>';
|
||||
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.urlencode($type).'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.urlencode($type)).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.urlencode($type)).'">'.img_delete().'</a>';
|
||||
$entry .= '</td>';
|
||||
|
||||
$entry .= '</tr>';
|
||||
|
|
@ -517,7 +517,7 @@ $arrayofmassactions = array(
|
|||
);
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$typeid = $type;
|
||||
$typeid = $type; // warning, typeid can be a string
|
||||
|
||||
|
||||
// List of products or services (type is type of category)
|
||||
|
|
@ -579,7 +579,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print '<a class="reposition" href= "'.$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".((int) $object->id)."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".$prod->id.'">';
|
||||
print '<a class="reposition" href= "'.$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".((int) $object->id)."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $prod->id).($limit ? '&limit='.$limit : '').'">';
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -659,7 +659,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$soc->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $soc->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -740,7 +740,7 @@ if ($type == Categorie::TYPE_SUPPLIER) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$soc->id.($limit ? '&limit='.$limit : '').'">';
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $soc->id).($limit ? '&limit='.$limit : '').'">';
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -825,7 +825,7 @@ if ($type == Categorie::TYPE_MEMBER) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$member->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $member->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -911,7 +911,7 @@ if ($type == Categorie::TYPE_CONTACT) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$contact->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $contact->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -994,7 +994,7 @@ if ($type == Categorie::TYPE_ACCOUNT) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$account->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $account->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -1076,7 +1076,7 @@ if ($type == Categorie::TYPE_PROJECT) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$project->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $project->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -1154,7 +1154,7 @@ if ($type == Categorie::TYPE_USER) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($user->hasRight('user', 'user', 'creer')) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$userentry->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $userentry->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -1225,7 +1225,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$warehouse->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $warehouse->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -1305,7 +1305,7 @@ if ($type == Categorie::TYPE_TICKET) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$ticket->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $ticket->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
//print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
@ -1391,7 +1391,7 @@ if ($type == Categorie::TYPE_FICHINTER) {
|
|||
// Link to delete from category
|
||||
print '<td class="right">';
|
||||
if ($permission) {
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$fichinter->id."'>";
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".((int) $object->id)."&type=".urlencode($typeid)."&action=unlink&token=".newToken()."&removeelem=".((int) $fichinter->id).($limit ? '&limit='.$limit : '')."'>";
|
||||
print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1682,7 +1682,7 @@ if ($action == 'create') {
|
|||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td id="project-input-container">';
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"');
|
||||
print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx maxwidth500');
|
||||
print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx maxwidth500');
|
||||
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.(empty($societe->id) ? '' : $societe->id).'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">';
|
||||
print '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
|
|
@ -1708,14 +1708,14 @@ if ($action == 'create') {
|
|||
// Task
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Task").'</td><td id="project-task-input-container" >';
|
||||
print img_picto('', 'projecttask', 'class="paddingrightonly"');
|
||||
$projectsListId = false;
|
||||
$projectsListId = '';
|
||||
if (!empty($projectid)) {
|
||||
$projectsListId = $projectid;
|
||||
}
|
||||
|
||||
$tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : '');
|
||||
|
||||
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', $projectsListId);
|
||||
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
@ -2144,8 +2144,8 @@ if ($id > 0) {
|
|||
'type' => 'user',
|
||||
//'transparency'=>$object->userassigned[$user->id]['transparency'],
|
||||
'transparency' => $object->transparency, // Force transparency on ownerfrom event
|
||||
'answer_status' => (isset($object->userassigned[$object->userownerid]['answer_status']) ? $object->userassigned[$object->userownerid]['answer_status']: null),
|
||||
'mandatory' => (isset($object->userassigned[$object->userownerid]['mandatory']) ? $object->userassigned[$object->userownerid]['mandatory']:null)
|
||||
'answer_status' => (isset($object->userassigned[$object->userownerid]['answer_status']) ? $object->userassigned[$object->userownerid]['answer_status'] : null),
|
||||
'mandatory' => (isset($object->userassigned[$object->userownerid]['mandatory']) ? $object->userassigned[$object->userownerid]['mandatory'] : null)
|
||||
);
|
||||
}
|
||||
if (!empty($object->userassigned)) { // Now concat assigned users
|
||||
|
|
@ -2255,7 +2255,7 @@ if ($id > 0) {
|
|||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>';
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"');
|
||||
$numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx');
|
||||
$numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), (string) $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx');
|
||||
if ($numprojet == 0) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
}
|
||||
|
|
@ -2294,7 +2294,7 @@ if ($id > 0) {
|
|||
})';
|
||||
print '</script>'."\n";
|
||||
|
||||
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, 0, 1, 0, 0, 'maxwidth500', $object->fk_project);
|
||||
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project);
|
||||
print '<input type="hidden" name="elementtype" value="'.$object->elementtype.'">';
|
||||
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class ActionCommReminder extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -96,7 +97,16 @@ class ICal
|
|||
$file_text = '';
|
||||
|
||||
//$tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], 2, 0); // To test with any URL
|
||||
$tmpresult = getURLContent($file, 'GET');
|
||||
$localip = 0;
|
||||
$sslverify = -1;
|
||||
if (getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')) {
|
||||
$localip = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE'));
|
||||
}
|
||||
if (getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')) {
|
||||
$sslverify = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE'));
|
||||
}
|
||||
// See documentation of getURLContent function for $localip and $sslverify possible values
|
||||
$tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], $localip, $sslverify);
|
||||
if ($tmpresult['http_code'] != 200) {
|
||||
$file_text = null;
|
||||
$this->error = 'Error: '.$tmpresult['http_code'].' '.$tmpresult['content'];
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ if ($mode == 'show_day') {
|
|||
$picto = 'calendarday';
|
||||
}
|
||||
if (empty($conf->dol_optimize_smallscreen)) {
|
||||
$nav .= ' <a href="?year='.$nowyear.'&month='.$nowmonth.'&day='.$nowday.$param.'" class="datenowlink">'.$langs->trans("Today").'</a> ';
|
||||
$nav .= ' <a href="?year='.$nowyear.'&month='.$nowmonth.'&day='.$nowday.$param.'" class="datenowlink marginleftonly marginrightonly">'.$langs->trans("Today").'</a> ';
|
||||
}
|
||||
$nav .= '</div>';
|
||||
|
||||
|
|
@ -581,7 +581,6 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda'
|
|||
|
||||
// Define the legend/list of calendard to show
|
||||
$s = '';
|
||||
$link = '';
|
||||
|
||||
|
||||
$showextcals = $listofextcals;
|
||||
|
|
@ -726,14 +725,14 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
|||
if (!preg_match('/showbirthday=/i', $newparam)) {
|
||||
$newparam .= '&showbirthday=1';
|
||||
}
|
||||
$link = '<a href="'.$_SERVER['PHP_SELF'].'?'.dol_escape_htmltag($newparam);
|
||||
$link .= '">';
|
||||
$s = '<a href="'.$_SERVER['PHP_SELF'].'?'.dol_escape_htmltag($newparam);
|
||||
$s .= '">';
|
||||
if (empty($showbirthday)) {
|
||||
$link .= $langs->trans("AgendaShowBirthdayEvents");
|
||||
$s .= $langs->trans("AgendaShowBirthdayEvents");
|
||||
} else {
|
||||
$link .= $langs->trans("AgendaHideBirthdayEvents");
|
||||
$s .= $langs->trans("AgendaHideBirthdayEvents");
|
||||
}
|
||||
$link .= '</a>';
|
||||
$s .= '</a>';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -469,6 +469,12 @@ if ($filtert > 0 || $usergroup > 0) {
|
|||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
|
||||
}
|
||||
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||
// Condition on actioncode
|
||||
if (!empty($actioncode)) {
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ $nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_mo
|
|||
$nav .= " </span>\n";
|
||||
$nav .= " <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
|
||||
if (empty($conf->dol_optimize_smallscreen)) {
|
||||
$nav .= ' <a href="?year='.$nowyear.'&month='.$nowmonth.'&day='.$nowday.$param.'" class="datenowlink">'.$langs->trans("Today").'</a> ';
|
||||
$nav .= ' <a href="?year='.$nowyear.'&month='.$nowmonth.'&day='.$nowday.$param.'" class="datenowlink marginleftonly marginrightonly">'.$langs->trans("Today").'</a> ';
|
||||
}
|
||||
$nav .= '</div>';
|
||||
$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -238,7 +238,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTINT('update_prices') ? true : false), (GETPOSTINT('update_desc') ? true : false));
|
||||
$result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOST('update_prices') == 'on'), (GETPOST('update_desc') == 'on'));
|
||||
if ($result > 0) {
|
||||
$warningMsgLineList = array();
|
||||
// check all product lines are to sell otherwise add a warning message for each product line is not to sell
|
||||
|
|
@ -2164,7 +2164,7 @@ if ($action == 'create') {
|
|||
$sday = date("d", $tmpdte);
|
||||
print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
|
||||
} else {
|
||||
$tmp_date_delivery = GETPOST('date_delivery') ? : -1;
|
||||
$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
|
||||
print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -2174,7 +2174,7 @@ if ($action == 'create') {
|
|||
$langs->load("projects");
|
||||
print '<tr class="field_projectid">';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">';
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
@ -2387,7 +2387,7 @@ if ($action == 'create') {
|
|||
$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
|
||||
}
|
||||
// Incomplete payment. We ask if reason = discount or other
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
|
||||
}
|
||||
|
||||
if ($action == 'closeas') {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -356,7 +356,7 @@ class Propal extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
|
|
@ -827,17 +827,22 @@ class Propal extends CommonObject
|
|||
|
||||
$result = $this->line->insert();
|
||||
if ($result > 0) {
|
||||
// Reorder if child line
|
||||
if (!empty($fk_parent_line)) {
|
||||
$this->line_order(true, 'DESC');
|
||||
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines
|
||||
$linecount = count($this->lines);
|
||||
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
|
||||
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
|
||||
if (!isset($this->context['createfromclone'])) {
|
||||
if (!empty($fk_parent_line)) {
|
||||
// Always reorder if child line
|
||||
$this->line_order(true, 'DESC');
|
||||
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) {
|
||||
// Update all rank of all other lines starting from the same $ranktouse
|
||||
$linecount = count($this->lines);
|
||||
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
|
||||
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
|
||||
}
|
||||
}
|
||||
|
||||
$this->lines[] = $this->line;
|
||||
}
|
||||
|
||||
// Mise a jour information denormalisees au niveau de la propale meme
|
||||
// Update denormalized fields at the order level
|
||||
if (empty($noupdateafterinsertline)) {
|
||||
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
|
||||
}
|
||||
|
|
@ -3771,7 +3776,7 @@ class Propal extends CommonObject
|
|||
if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
|
||||
$res = $this->fetchProject();
|
||||
if ($res > 0 && $this->project instanceof Project) {
|
||||
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, 1);
|
||||
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, '1');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4014,7 +4019,7 @@ class Propal extends CommonObject
|
|||
* Return clickable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array{string,mixed} $arraydata Array of data
|
||||
* @param ?array<string,mixed> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023-2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -103,6 +104,9 @@ $origin = GETPOST('origin', 'alpha');
|
|||
$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility
|
||||
$rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1;
|
||||
|
||||
// Type Contact default
|
||||
$type_contact_code = (getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') ? getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') : 'CUSTOMER');
|
||||
|
||||
// PDF
|
||||
$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0));
|
||||
$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0));
|
||||
|
|
@ -218,10 +222,10 @@ if (empty($reshook)) {
|
|||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('IdThirdParty')), null, 'errors');
|
||||
} else {
|
||||
if ($object->id > 0) {
|
||||
// Because createFromClone modifies the object, we must clone it so that we can restore it later
|
||||
$orig = clone $object;
|
||||
// We clone object to avoid to denaturate loaded object when setting some properties for clone or if createFromClone modifies the object.
|
||||
$objectutil = dol_clone($object, 1);
|
||||
|
||||
$result = $object->createFromClone($user, $socid);
|
||||
$result = $objectutil->createFromClone($user, $socid);
|
||||
if ($result > 0) {
|
||||
$warningMsgLineList = array();
|
||||
// check all product lines are to sell otherwise add a warning message for each product line is not to sell
|
||||
|
|
@ -243,7 +247,6 @@ if (empty($reshook)) {
|
|||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$object = $orig;
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +552,8 @@ if (empty($reshook)) {
|
|||
// Insert default contacts if defined
|
||||
if ($object_id > 0) {
|
||||
if (GETPOSTINT('contactid')) {
|
||||
$result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external');
|
||||
// $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external');
|
||||
$result = $object->add_contact(GETPOSTINT('contactid'), $type_contact_code, 'external');
|
||||
if ($result < 0) {
|
||||
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
|
||||
$error++;
|
||||
|
|
@ -1995,7 +1999,10 @@ if ($action == 'create' && $usercancreate) {
|
|||
// Contact of order
|
||||
if ($socid > 0) {
|
||||
// Contacts (ask contact only if thirdparty already defined).
|
||||
print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
|
||||
// print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
|
||||
print "<tr><td>";
|
||||
print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code));
|
||||
print '</td><td>';
|
||||
print img_picto('', 'contact', 'class="pictofixedwidth"');
|
||||
//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx');
|
||||
print $form->select_contact($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx', true);
|
||||
|
|
|
|||
|
|
@ -113,9 +113,16 @@ class Commande extends CommonOrder
|
|||
/**
|
||||
* Status of the order
|
||||
* @var int
|
||||
* @deprecated Use status
|
||||
*/
|
||||
public $statut;
|
||||
|
||||
/**
|
||||
* Status of the order
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* @var int Status Billed or not
|
||||
*/
|
||||
|
|
@ -304,7 +311,7 @@ class Commande extends CommonOrder
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
|
|
@ -793,12 +800,10 @@ class Commande extends CommonOrder
|
|||
*
|
||||
* @param User $user Object user that close
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
|
||||
*/
|
||||
public function cloture($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'creer'))
|
||||
|
|
@ -1098,6 +1103,7 @@ class Commande extends CommonOrder
|
|||
$line->ref_ext,
|
||||
1
|
||||
);
|
||||
|
||||
if ($result < 0) {
|
||||
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER) {
|
||||
$this->error = $this->db->lasterror();
|
||||
|
|
@ -1541,7 +1547,7 @@ class Commande extends CommonOrder
|
|||
|
||||
$logtext = "::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent";
|
||||
$logtext .= ", info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start";
|
||||
$logtext .= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise, ref_ext=$ref_ext";
|
||||
$logtext .= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise, ref_ext=$ref_ext rang=$rang";
|
||||
dol_syslog(get_class($this).$logtext, LOG_DEBUG);
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT) {
|
||||
|
|
@ -1681,6 +1687,7 @@ class Commande extends CommonOrder
|
|||
|
||||
// Rang to use
|
||||
$ranktouse = $rang;
|
||||
|
||||
if ($ranktouse == -1) {
|
||||
$rangmax = $this->line_max($fk_parent_line);
|
||||
$ranktouse = $rangmax + 1;
|
||||
|
|
@ -1753,24 +1760,28 @@ class Commande extends CommonOrder
|
|||
|
||||
$result = $this->line->insert($user);
|
||||
if ($result > 0) {
|
||||
// Reorder if child line
|
||||
if (!empty($fk_parent_line)) {
|
||||
$this->line_order(true, 'DESC');
|
||||
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines
|
||||
$linecount = count($this->lines);
|
||||
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
|
||||
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Mise a jour information denormalisees au niveau de la commande meme
|
||||
// Update denormalized fields at the order level
|
||||
if (empty($noupdateafterinsertline)) {
|
||||
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
if (!isset($this->context['createfromclone'])) {
|
||||
if (!empty($fk_parent_line)) {
|
||||
// Always reorder if child line
|
||||
$this->line_order(true, 'DESC');
|
||||
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) {
|
||||
// Update all rank of all other lines starting from the same $ranktouse
|
||||
$linecount = count($this->lines);
|
||||
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
|
||||
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
|
||||
}
|
||||
}
|
||||
|
||||
$this->lines[] = $this->line;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
$this->lines[] = $this->line;
|
||||
return $this->line->id;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
|
|
@ -1899,7 +1910,7 @@ class Commande extends CommonOrder
|
|||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut';
|
||||
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut as status';
|
||||
$sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.deposit_percent, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
|
||||
$sql .= ', c.fk_account';
|
||||
$sql .= ', c.date_commande, c.date_valid, c.tms';
|
||||
|
|
@ -1955,8 +1966,8 @@ class Commande extends CommonOrder
|
|||
$this->fk_project = $obj->fk_project;
|
||||
$this->project = null; // Clear if another value was already set by fetch_projet
|
||||
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->status = $obj->fk_statut;
|
||||
$this->statut = $obj->status;
|
||||
$this->status = $obj->status;
|
||||
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->user_creation_id = $obj->fk_user_author;
|
||||
|
|
@ -2120,8 +2131,6 @@ class Commande extends CommonOrder
|
|||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx, l.ref_ext,';
|
||||
|
|
@ -3730,7 +3739,7 @@ class Commande extends CommonOrder
|
|||
if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
|
||||
$res = $this->fetchProject();
|
||||
if ($res > 0 && $this->project instanceof Project) {
|
||||
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, 1);
|
||||
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, '1');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4073,7 +4082,7 @@ class Commande extends CommonOrder
|
|||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$langs->load("orders");
|
||||
$outputlangs->load("products");
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ class OrderLine extends CommonOrderLine
|
|||
}
|
||||
|
||||
/**
|
||||
* Insert line into database
|
||||
* Insert line into database. This also set $this->id.
|
||||
*
|
||||
* @param User $user User that modify
|
||||
* @param int $notrigger 1 = disable triggers
|
||||
|
|
@ -487,7 +487,7 @@ class OrderLine extends CommonOrderLine
|
|||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
foreach ($this->errors as $errmsg) {
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ $search_deliveryyear = '';
|
|||
|
||||
$search_import_key = trim(GETPOST("search_import_key", "alpha"));
|
||||
|
||||
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = $conf->order->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
|
|
@ -376,7 +376,7 @@ if (empty($reshook)) {
|
|||
$permissiontocancel = $user->hasRight("commande", "creer");
|
||||
$permissiontosendbymail = $user->hasRight("commande", "creer");
|
||||
}
|
||||
$uploaddir = $conf->commande->multidir_output[$conf->entity];
|
||||
$uploaddir = $conf->order->multidir_output[$conf->entity];
|
||||
$triggersendname = 'ORDER_SENTBYMAIL';
|
||||
$year = "";
|
||||
$month = "";
|
||||
|
|
@ -766,14 +766,16 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'validate' && $permissiontoadd && $objectclass !== null) {
|
||||
if (GETPOST('confirm') == 'yes') {
|
||||
/** @var Commande $objecttmp */
|
||||
$objecttmp = new $objectclass($db);
|
||||
$db->begin();
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($objecttmp->fetch($checked)) {
|
||||
if ($objecttmp->statut == 0) {
|
||||
if ($objecttmp->status == $objecttmp::STATUS_DRAFT) {
|
||||
if (!empty($objecttmp->fk_warehouse)) {
|
||||
$idwarehouse = $objecttmp->fk_warehouse;
|
||||
} else {
|
||||
|
|
@ -804,21 +806,23 @@ if ($action == 'validate' && $permissiontoadd && $objectclass !== null) {
|
|||
}
|
||||
if ($action == 'shipped' && $permissiontoadd && $objectclass !== null) {
|
||||
if (GETPOST('confirm') == 'yes') {
|
||||
/** @var Commande $objecttmp */
|
||||
$objecttmp = new $objectclass($db);
|
||||
$db->begin();
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($objecttmp->fetch($checked)) {
|
||||
if ($objecttmp->statut == 1 || $objecttmp->statut == 2) {
|
||||
if ($objecttmp->cloture($user)) {
|
||||
if ($objecttmp->status == $objecttmp::STATUS_VALIDATED || $objecttmp->status == $objecttmp::STATUS_SHIPMENTONPROCESS || $objecttmp->status == $objecttmp::STATUS_CLOSED) {
|
||||
$result = $objecttmp->cloture($user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('StatusOrderDelivered', $objecttmp->ref), null, 'mesgs');
|
||||
} else {
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($langs->trans('ErrorOrderStatusCantBeSetToDelivered'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorIsNotADraft', $objecttmp->ref), null, 'errors');
|
||||
setEventMessages($langs->trans('ErrorObjectHasWrongStatus', $objecttmp->ref), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -997,7 +1001,7 @@ if ($search_status != '') {
|
|||
}
|
||||
}
|
||||
if ($search_option == 'late') {
|
||||
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'";
|
||||
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'";
|
||||
}
|
||||
if ($search_datecloture_start) {
|
||||
$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
|
||||
|
|
@ -2294,7 +2298,7 @@ while ($i < $imaxinloop) {
|
|||
print $generic_commande->getNomUrl(1, $getNomUrlOption, 0, 0, 0, 1, 1);
|
||||
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->order->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
||||
|
||||
|
|
@ -2882,8 +2886,10 @@ while ($i < $imaxinloop) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($nbprod) {
|
||||
if ($nbprod) { // If there is at least one product to ship, we show the shippable icon
|
||||
print '<a href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.((int) $obj->rowid).'">';
|
||||
print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2);
|
||||
print '</a>';
|
||||
}
|
||||
if ($warning) { // Always false in default mode
|
||||
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'<br>'.$text_warning, 2, 1, img_picto('', 'error'), '', 2);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user