commit
948ec49b38
@ -9,8 +9,6 @@ charset = utf-8
|
|||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
# PHP PSR-2 Coding Standards
|
|
||||||
# http://www.php-fig.org/psr/psr-2/
|
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|||||||
@ -195,22 +195,6 @@ tools:
|
|||||||
- 'htdocs/includes/*'
|
- 'htdocs/includes/*'
|
||||||
paths: { }
|
paths: { }
|
||||||
|
|
||||||
php_changetracking:
|
|
||||||
enabled: false
|
|
||||||
bug_patterns:
|
|
||||||
- '\bfix(?:es|ed)?\b'
|
|
||||||
feature_patterns:
|
|
||||||
- '\badd(?:s|ed)?\b'
|
|
||||||
- '\bimplement(?:s|ed)?\b'
|
|
||||||
filter:
|
|
||||||
excluded_paths:
|
|
||||||
- 'build/*'
|
|
||||||
- 'dev/*'
|
|
||||||
- 'doc/*'
|
|
||||||
- 'test/*'
|
|
||||||
- 'htdocs/includes/*'
|
|
||||||
paths: { }
|
|
||||||
|
|
||||||
# Coding-Style / Bug Detection
|
# Coding-Style / Bug Detection
|
||||||
js_hint:
|
js_hint:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
|||||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
|
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
|
||||||
|
|
||||||
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)
|
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)
|
||||||
- DoliDeb for Debian or Ubuntu
|
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian
|
||||||
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
|
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
|
||||||
|
|
||||||
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||||
|
|||||||
@ -23,13 +23,12 @@
|
|||||||
|
|
||||||
<!-- Rules from Internal Standard -->
|
<!-- Rules from Internal Standard -->
|
||||||
|
|
||||||
<rule ref="Internal.NoCodeFound">
|
<rule ref="Internal.NoCodeFound" />
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Rules from Generic Standard -->
|
<!-- Rules from Generic Standard -->
|
||||||
|
|
||||||
|
<!-- We want to allow empty statement: It allows to put some code comments into the else for examples -->
|
||||||
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
||||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
|
||||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
|
||||||
@ -38,8 +37,7 @@
|
|||||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
|
||||||
|
|
||||||
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
|
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
|
||||||
|
|
||||||
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
|
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
|
||||||
@ -69,19 +67,11 @@
|
|||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!-- Warnings on TODO -->
|
||||||
|
<!-- Disabled: We want to keep TODO as normal
|
||||||
<rule ref="Generic.Commenting.Todo" />
|
<rule ref="Generic.Commenting.Todo" />
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Warning if action on same line than if -->
|
|
||||||
<!--
|
|
||||||
<rule ref="Generic.ControlStructures.InlineControlStructure">
|
|
||||||
<properties>
|
|
||||||
<property name="error" value="false"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- PHP code MUST use only UTF-8 without BOM. -->
|
<!-- PHP code MUST use only UTF-8 without BOM. -->
|
||||||
<rule ref="Generic.Files.ByteOrderMark"/>
|
<rule ref="Generic.Files.ByteOrderMark"/>
|
||||||
@ -101,17 +91,31 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
<!-- Disallow several statements on same line -->
|
<!-- Disallow several statements on same line -->
|
||||||
|
|
||||||
|
<!-- Warning if action on same line than if -->
|
||||||
|
<!-- Disabled: We want to allow this for better code compacity and readability
|
||||||
|
<rule ref="Generic.ControlStructures.InlineControlStructure">
|
||||||
|
<properties>
|
||||||
|
<property name="error" value="false"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
-->
|
||||||
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
|
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
|
||||||
<rule ref="Generic.Formatting.DisallowMultipleStatements">
|
<rule ref="Generic.Formatting.DisallowMultipleStatements">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Have 2 chars padding maximum and always show as errors -->
|
|
||||||
<!--
|
<!-- Check assignement have the = align on each line. Have 20 chars padding maximum and always show as errors -->
|
||||||
|
<!-- Disabled: Report some false warning
|
||||||
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
||||||
<properties> <property name="maxPadding" value="2"/> <property
|
<properties>
|
||||||
name="ignoreMultiLine" value="true"/> </properties> </rule>
|
<property name="maxPadding" value="20"/>
|
||||||
|
<property name="ignoreMultiLine" value="true"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
||||||
@ -129,7 +133,7 @@
|
|||||||
<!-- Tweaks to metrics -->
|
<!-- Tweaks to metrics -->
|
||||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="complexity" value="150" />
|
<property name="complexity" value="250" />
|
||||||
<property name="absoluteComplexity" value="300" />
|
<property name="absoluteComplexity" value="300" />
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
@ -183,6 +187,13 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
<!-- Check for duplicate class names -->
|
||||||
|
<!-- Disabled: We need this for dependency injection.
|
||||||
|
<rule ref="Generic.Classes.DuplicateClassName" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Rules from Squiz Standard -->
|
||||||
|
|
||||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
||||||
|
|
||||||
@ -192,12 +203,9 @@
|
|||||||
<property name="ignoreBlankLines" value="false"/>
|
<property name="ignoreBlankLines" value="false"/>
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
|
||||||
<severity>0</severity>
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
|
||||||
</rule>
|
<!-- Disabled: We want to have 2 empty line as separator sometimes -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
@ -210,7 +218,6 @@
|
|||||||
|
|
||||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||||
<properties>
|
<properties>
|
||||||
@ -222,23 +229,16 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule ref="Squiz.Scope.MethodScope.Missing" />
|
<rule ref="Squiz.Scope.MethodScope.Missing" />
|
||||||
|
|
||||||
|
|
||||||
<!-- Rules from PEAR Standard -->
|
<!-- Rules from PEAR Standard -->
|
||||||
|
|
||||||
<rule ref="PEAR.Classes.ClassDeclaration" />
|
<rule ref="PEAR.Classes.ClassDeclaration" />
|
||||||
|
|
||||||
<!-- Check for duplicate class names -->
|
|
||||||
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment" />
|
<rule ref="PEAR.Commenting.ClassComment" />
|
||||||
|
|
||||||
<!-- TODO Remove this and fix reported errors -->
|
<rule ref="PEAR.Commenting.ClassComment.Missing" />
|
||||||
<rule ref="PEAR.Commenting.ClassComment.Missing">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
@ -247,67 +247,38 @@
|
|||||||
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<rule ref="PEAR.Commenting.FileComment" />
|
|
||||||
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
<rule ref="PEAR.Commenting.FileComment.MissingVersion">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
<rule ref="PEAR.Commenting.FileComment.MissingTag">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment" />
|
<rule ref="PEAR.Commenting.FunctionComment" />
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.Empty">
|
<rule ref="PEAR.Commenting.FunctionComment.Empty" />
|
||||||
<severity>5</severity>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>-->
|
|
||||||
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>-->
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
|
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
|
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
|
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
|
||||||
<severity>0</severity>
|
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
@ -344,6 +315,7 @@
|
|||||||
<rule ref="PEAR.Files.IncludingFile.UseInclude">
|
<rule ref="PEAR.Files.IncludingFile.UseInclude">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
|
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
|
||||||
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
|
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta name="robots" content="noindex,nofollow" />
|
|
||||||
<meta name="author" content="Dolibarr Development Team">
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/dolibarrnew/theme/eldy/img/favicon.ico"/>
|
|
||||||
<title>Login Dolibarr 3.4.0-alpha</title>
|
|
||||||
<!-- Includes for JQuery (Ajax library) -->
|
|
||||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/includes/jquery/css/smoothness/jquery-ui.custom.css" />
|
|
||||||
<link rel="stylesheet" type="text/css" title="default" href="/dolibarrnew/custom/filemanager/css/filemanager.css.php"><!-- Added by module filemanager-->
|
|
||||||
<!-- Includes JS for JQuery -->
|
|
||||||
<script type="text/javascript" src="/dolibarrnew/includes/jquery/js/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/dolibarrnew/core/js/dst.js"></script>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/theme/eldy/style.css.php?lang=fr_FR" />
|
|
||||||
<!-- HTTP_USER_AGENT = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22 -->
|
|
||||||
</head>
|
|
||||||
<body class="body">
|
|
||||||
|
|
||||||
<div class="center">
|
|
||||||
|
|
||||||
<div class="login_table center">
|
|
||||||
|
|
||||||
<!-- <tr><td colspan="2" valign="middle"> -->
|
|
||||||
<div id="login_line1" class="center">
|
|
||||||
|
|
||||||
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><div class="center">
|
|
||||||
|
|
||||||
<table class="none center" summary="Login pass" cellpadding="2">
|
|
||||||
|
|
||||||
<!-- Login -->
|
|
||||||
<tr>
|
|
||||||
<td valign="bottom"> <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r </td>
|
|
||||||
<td valign="bottom" class="nowrap">
|
|
||||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="" tabindex="1" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- Password -->
|
|
||||||
<tr><td class="tdtop nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
|
||||||
<td class="tdtop nowrap">
|
|
||||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div> <!-- end div left -->
|
|
||||||
|
|
||||||
<!-- </td>
|
|
||||||
<td class="center" valign="middle">-->
|
|
||||||
<div id="login_right" style="display: inline-block; min-width: 250px; margin: 0 auto;">
|
|
||||||
|
|
||||||
<img alt="Logo" title="" src="/dolibarrnew/theme/dolibarr_logo.png" id="img_logo" />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div> <!-- end div line1 -->
|
|
||||||
<!--</td>
|
|
||||||
|
|
||||||
</tr>-->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<!-- END PHP TEMPLATE -->
|
|
||||||
BIN
doc/images/background_dolibarr.jpg
Normal file
BIN
doc/images/background_dolibarr.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -27,10 +27,11 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
|
|||||||
$account_parent = GETPOST('account_parent');
|
$account_parent = GETPOST('account_parent');
|
||||||
$changeaccount = GETPOST('changeaccount');
|
$changeaccount = GETPOST('changeaccount');
|
||||||
// Search Getpost
|
// Search Getpost
|
||||||
|
$search_societe = GETPOST('search_societe', 'alpha');
|
||||||
$search_lineid = GETPOST('search_lineid', 'int');
|
$search_lineid = GETPOST('search_lineid', 'int');
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||||
@ -89,6 +91,7 @@ $formaccounting = new FormAccounting($db);
|
|||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
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
|
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_societe='';
|
||||||
$search_lineid = '';
|
$search_lineid = '';
|
||||||
$search_ref = '';
|
$search_ref = '';
|
||||||
$search_invoice = '';
|
$search_invoice = '';
|
||||||
@ -175,7 +178,7 @@ $sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
|||||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||||
$sql .= " fd.situation_percent,";
|
$sql .= " fd.situation_percent,";
|
||||||
$sql .= " co.code as country_code, co.label as country,";
|
$sql .= " co.code as country_code, co.label as country,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -193,6 +196,10 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|||||||
} else {
|
} else {
|
||||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||||
}
|
}
|
||||||
|
// Add search filter like
|
||||||
|
if ($search_societe) {
|
||||||
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
|
}
|
||||||
if ($search_lineid) {
|
if ($search_lineid) {
|
||||||
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
@ -262,6 +269,7 @@ if ($result) {
|
|||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
if ($search_societe) $param .= "&search_societe=".urlencode($search_societe);
|
||||||
if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
|
if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
|
||||||
if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
|
if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
|
||||||
if ($search_label) $param .= "&search_label=".urlencode($search_label);
|
if ($search_label) $param .= "&search_label=".urlencode($search_label);
|
||||||
@ -296,7 +304,7 @@ if ($result) {
|
|||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
||||||
print '<td class="liste_titre center nowraponall">';
|
print '<td class="liste_titre center nowraponall">';
|
||||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||||
@ -310,6 +318,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||||
@ -330,6 +339,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||||
@ -337,6 +347,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$thirdpartystatic=new Societe($db);
|
||||||
$facture_static = new Facture($db);
|
$facture_static = new Facture($db);
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
@ -347,6 +358,17 @@ if ($result) {
|
|||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
$facture_static->type = $objp->ftype;
|
$facture_static->type = $objp->ftype;
|
||||||
|
|
||||||
|
$thirdpartystatic->id = $objp->socid;
|
||||||
|
$thirdpartystatic->name = $objp->name;
|
||||||
|
$thirdpartystatic->client = $objp->client;
|
||||||
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
$thirdpartystatic->code_client = $objp->code_client;
|
||||||
|
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||||
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
|
$thirdpartystatic->email = $objp->email;
|
||||||
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->label = $objp->product_label;
|
$product_static->label = $objp->product_label;
|
||||||
@ -380,6 +402,9 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||||
|
|
||||||
|
// Thirdparty
|
||||||
|
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'customer') . '</td>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($objp->country_code)
|
if ($objp->country_code)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -27,12 +27,13 @@
|
|||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array');
|
|||||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||||
|
|
||||||
// Search Getpost
|
// Search Getpost
|
||||||
|
$search_societe = GETPOST('search_societe', 'alpha');
|
||||||
$search_lineid = GETPOST('search_lineid', 'int');
|
$search_lineid = GETPOST('search_lineid', 'int');
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||||
@ -112,6 +114,7 @@ if (empty($reshook))
|
|||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
|
$search_societe='';
|
||||||
$search_lineid = '';
|
$search_lineid = '';
|
||||||
$search_ref = '';
|
$search_ref = '';
|
||||||
$search_invoice = '';
|
$search_invoice = '';
|
||||||
@ -212,7 +215,7 @@ $sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as co
|
|||||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -227,6 +230,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy
|
|||||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND l.product_type <= 2";
|
$sql .= " AND l.product_type <= 2";
|
||||||
// Add search filter like
|
// Add search filter like
|
||||||
|
if ($search_societe) {
|
||||||
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
|
}
|
||||||
if ($search_lineid) {
|
if ($search_lineid) {
|
||||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
@ -314,6 +320,7 @@ if ($result) {
|
|||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
if ($search_societe) $param .= '&search_societe='.urlencode($search_societe);
|
||||||
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
||||||
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
||||||
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
||||||
@ -363,7 +370,7 @@ if ($result) {
|
|||||||
|
|
||||||
// We add search filter
|
// We add search filter
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
||||||
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
||||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||||
@ -377,6 +384,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||||
@ -399,6 +407,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||||
@ -408,6 +417,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$thirdpartystatic = new Societe($db);
|
||||||
$facture_static = new Facture($db);
|
$facture_static = new Facture($db);
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
@ -421,6 +431,17 @@ if ($result) {
|
|||||||
$objp->code_sell_l = '';
|
$objp->code_sell_l = '';
|
||||||
$objp->code_sell_p = '';
|
$objp->code_sell_p = '';
|
||||||
|
|
||||||
|
$thirdpartystatic->id = $objp->socid;
|
||||||
|
$thirdpartystatic->name = $objp->name;
|
||||||
|
$thirdpartystatic->client = $objp->client;
|
||||||
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
$thirdpartystatic->code_client = $objp->code_client;
|
||||||
|
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||||
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
|
$thirdpartystatic->email = $objp->email;
|
||||||
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->type = $objp->type;
|
$product_static->type = $objp->type;
|
||||||
@ -558,6 +579,9 @@ if ($result) {
|
|||||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Thirdparty
|
||||||
|
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'customer') . '</td>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||||
|
|||||||
@ -252,6 +252,9 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
|
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
|
||||||
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||||
@ -272,7 +275,10 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
}
|
||||||
|
print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
@ -299,6 +305,11 @@ if ($result) {
|
|||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
|
print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
|
||||||
|
|
||||||
|
// Date validation
|
||||||
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';
|
print '<td class="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';
|
||||||
|
|||||||
@ -42,6 +42,9 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
|
||||||
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
|
||||||
|
|
||||||
// Select Box
|
// Select Box
|
||||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||||
@ -183,7 +186,7 @@ if (empty($chartaccountcode))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expense report lines
|
// Expense report lines
|
||||||
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut,";
|
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut, er.date_valid,";
|
||||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
|
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
|
||||||
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
||||||
$sql .= " aa.rowid as aarowid";
|
$sql .= " aa.rowid as aarowid";
|
||||||
@ -240,8 +243,8 @@ if ($result) {
|
|||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
||||||
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
||||||
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
||||||
@ -288,6 +291,9 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
|
||||||
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
||||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||||
@ -308,7 +314,10 @@ if ($result) {
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
}
|
||||||
|
print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||||
@ -341,6 +350,11 @@ if ($result) {
|
|||||||
// Ref Expense report
|
// Ref Expense report
|
||||||
print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
|
print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
|
||||||
|
|
||||||
|
// Date validation
|
||||||
|
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
|
||||||
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -27,12 +27,13 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
@ -44,6 +45,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
|
|||||||
$account_parent = GETPOST('account_parent');
|
$account_parent = GETPOST('account_parent');
|
||||||
$changeaccount = GETPOST('changeaccount');
|
$changeaccount = GETPOST('changeaccount');
|
||||||
// Search Getpost
|
// Search Getpost
|
||||||
|
$search_societe = GETPOST('search_societe', 'alpha');
|
||||||
$search_lineid = GETPOST('search_lineid', 'int');
|
$search_lineid = GETPOST('search_lineid', 'int');
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||||
@ -91,6 +93,7 @@ $formaccounting = new FormAccounting($db);
|
|||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
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
|
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_societe = '';
|
||||||
$search_lineid = '';
|
$search_lineid = '';
|
||||||
$search_ref = '';
|
$search_ref = '';
|
||||||
$search_invoice = '';
|
$search_invoice = '';
|
||||||
@ -177,7 +180,7 @@ $sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.t
|
|||||||
$sql .= " aa.label, aa.account_number, ";
|
$sql .= " aa.label, aa.account_number, ";
|
||||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
||||||
$sql .= " co.code as country_code, co.label as country,";
|
$sql .= " co.code as country_code, co.label as country,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -188,6 +191,10 @@ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_fact
|
|||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||||
|
// Add search filter like
|
||||||
|
if ($search_societe) {
|
||||||
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
|
}
|
||||||
if ($search_lineid) {
|
if ($search_lineid) {
|
||||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
@ -264,6 +271,7 @@ if ($result) {
|
|||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
if ($search_societe) $param .= "&search_societe=" . urlencode($search_societe);
|
||||||
if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
|
if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
|
||||||
if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
|
if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
|
||||||
if ($search_label) $param .= "&search_label=".urlencode($search_label);
|
if ($search_label) $param .= "&search_label=".urlencode($search_label);
|
||||||
@ -300,7 +308,7 @@ if ($result) {
|
|||||||
|
|
||||||
// We add search filter
|
// We add search filter
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||||
print '<td class="liste_titre center nowraponall">';
|
print '<td class="liste_titre center nowraponall">';
|
||||||
@ -312,6 +320,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||||
// print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
// print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||||
@ -334,6 +343,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||||
@ -341,6 +351,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$thirdpartystatic = new Societe($db);
|
||||||
$facturefournisseur_static = new FactureFournisseur($db);
|
$facturefournisseur_static = new FactureFournisseur($db);
|
||||||
$product_static = new ProductFournisseur($db);
|
$product_static = new ProductFournisseur($db);
|
||||||
|
|
||||||
@ -352,6 +363,17 @@ if ($result) {
|
|||||||
$facturefournisseur_static->ref = $objp->ref;
|
$facturefournisseur_static->ref = $objp->ref;
|
||||||
$facturefournisseur_static->id = $objp->facid;
|
$facturefournisseur_static->id = $objp->facid;
|
||||||
|
|
||||||
|
$thirdpartystatic->id = $objp->socid;
|
||||||
|
$thirdpartystatic->name = $objp->name;
|
||||||
|
$thirdpartystatic->client = $objp->client;
|
||||||
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
$thirdpartystatic->code_client = $objp->code_client;
|
||||||
|
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||||
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
|
$thirdpartystatic->email = $objp->email;
|
||||||
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->label = $objp->product_label;
|
$product_static->label = $objp->product_label;
|
||||||
@ -390,6 +412,10 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||||
|
|
||||||
|
// Thirdparty
|
||||||
|
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'supplier') . '</td>';
|
||||||
|
|
||||||
|
// Country
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($objp->country_code)
|
if ($objp->country_code)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,12 +27,13 @@
|
|||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array');
|
|||||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||||
|
|
||||||
// Search Getpost
|
// Search Getpost
|
||||||
|
$search_societe = GETPOST('search_societe', 'alpha');
|
||||||
$search_lineid = GETPOST('search_lineid', 'int');
|
$search_lineid = GETPOST('search_lineid', 'int');
|
||||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
@ -116,6 +118,7 @@ if (empty($reshook))
|
|||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
|
$search_societe='';
|
||||||
$search_lineid = '';
|
$search_lineid = '';
|
||||||
$search_ref = '';
|
$search_ref = '';
|
||||||
$search_invoice = '';
|
$search_invoice = '';
|
||||||
@ -216,7 +219,7 @@ $sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as co
|
|||||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
@ -231,6 +234,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy
|
|||||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND l.product_type <= 2";
|
$sql .= " AND l.product_type <= 2";
|
||||||
// Add search filter like
|
// Add search filter like
|
||||||
|
if ($search_societe) {
|
||||||
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
|
}
|
||||||
if ($search_lineid) {
|
if ($search_lineid) {
|
||||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
@ -314,6 +320,7 @@ if ($result) {
|
|||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
|
||||||
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
|
||||||
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
||||||
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
||||||
@ -364,7 +371,7 @@ if ($result) {
|
|||||||
|
|
||||||
// We add search filter
|
// We add search filter
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'""></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||||
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
||||||
@ -376,6 +383,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||||
@ -399,6 +407,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||||
@ -408,6 +417,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$thirdpartystatic=new Societe($db);
|
||||||
$facturefourn_static = new FactureFournisseur($db);
|
$facturefourn_static = new FactureFournisseur($db);
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
@ -424,6 +434,17 @@ if ($result) {
|
|||||||
$objp->code_buy_l = '';
|
$objp->code_buy_l = '';
|
||||||
$objp->code_buy_p = '';
|
$objp->code_buy_p = '';
|
||||||
|
|
||||||
|
$thirdpartystatic->id = $objp->socid;
|
||||||
|
$thirdpartystatic->name = $objp->name;
|
||||||
|
$thirdpartystatic->client = $objp->client;
|
||||||
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
$thirdpartystatic->code_client = $objp->code_client;
|
||||||
|
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||||
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
|
$thirdpartystatic->email = $objp->email;
|
||||||
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->type = $objp->type;
|
$product_static->type = $objp->type;
|
||||||
@ -543,6 +564,9 @@ if ($result) {
|
|||||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Thirdparty
|
||||||
|
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'supplier') . '</td>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||||
|
|||||||
@ -693,7 +693,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
// Sales taxes (VAT, IRPF, ...)
|
// Sales taxes (VAT, IRPF, ...)
|
||||||
print load_fiche_titre($langs->trans("TypeOfSaleTaxes"));
|
print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment');
|
||||||
|
|
||||||
print '<table class="noborder centpercent editmode">';
|
print '<table class="noborder centpercent editmode">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -328,10 +328,10 @@ if ($conf->use_javascript_ajax)
|
|||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div id="updateconst" class="right">';
|
print '<div id="updateconst" class="right">';
|
||||||
print '<input type="submit" name="update" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" name="update" class="button marginbottomonly" value="'.$langs->trans("Modify").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div id="delconst" class="right">';
|
print '<div id="delconst" class="right">';
|
||||||
print '<input type="submit" name="delete" class="button" value="'.$langs->trans("Delete").'">';
|
print '<input type="submit" name="delete" class="button marginbottomonly" value="'.$langs->trans("Delete").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -503,7 +503,7 @@ $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
|||||||
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[35] = array();
|
$tabhelp[35] = array();
|
||||||
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
||||||
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('MeasuringUnitTypeDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'));
|
||||||
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
||||||
|
|
||||||
// List of check for fields (NOT USED YET)
|
// List of check for fields (NOT USED YET)
|
||||||
|
|||||||
@ -122,6 +122,10 @@ if ($action == 'update')
|
|||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array()))));
|
||||||
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity);
|
||||||
|
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
|
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
|
||||||
|
|||||||
@ -277,8 +277,8 @@ print '<table class="noborder centpercent">';
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TreeMenuPersonalized").'</td>';
|
print '<td>'.$langs->trans("TreeMenuPersonalized").'</td>';
|
||||||
print '<td class="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'object_category').' '.$langs->trans("UndoExpandAll").'</a>';
|
print '<td class="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>';
|
||||||
print ' | <a href="#">'.img_picto('', 'object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td>';
|
print ' | <a href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a></div></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|||||||
@ -412,11 +412,13 @@ foreach ($modulesdir as $dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$familyposition = $familyinfo[$familykey]['position'];
|
$familyposition = $familyinfo[$familykey]['position'];
|
||||||
if ($external)
|
$listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other');
|
||||||
|
if ($external && ! in_array($familykey, $listOfOfficialModuleGroups))
|
||||||
{
|
{
|
||||||
// TODO Find a solution so modules with their own family are always at end
|
// If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups).
|
||||||
//var_dump($familyposition);
|
if (is_numeric($familyposition)) {
|
||||||
//$familyposition += 100;
|
$familyposition = sprintf("%03d", (int) $familyposition + 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
$orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
||||||
|
|||||||
@ -34,10 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Noti
|
|||||||
$langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails'));
|
$langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->admin)
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -45,27 +47,48 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Action to update or add a constant
|
// Action to update or add a constant
|
||||||
if ($action == 'update' || $action == 'add')
|
if ($action == 'settemplates')
|
||||||
{
|
{
|
||||||
$constlineid = GETPOST('rowid', 'int');
|
$db->begin();
|
||||||
$constname = GETPOST('constname', 'alpha');
|
|
||||||
|
|
||||||
$constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
|
if (!$error && is_array($_POST))
|
||||||
$consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
|
{
|
||||||
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
$reg = array();
|
||||||
|
foreach ($_POST as $key => $val)
|
||||||
|
{
|
||||||
|
if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) continue;
|
||||||
|
|
||||||
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
|
$triggername = $reg[1];
|
||||||
|
$constvalue = GETPOST($key, 'alpha');
|
||||||
|
$consttype = 'emailtemplate:xxx';
|
||||||
|
$tmparray=explode(':', $constvalue);
|
||||||
|
if (! empty($tmparray[0]) && ! empty($tmparray[1])) {
|
||||||
|
$constvalue = $tmparray[0];
|
||||||
|
$consttype = 'emailtemplate:'.$tmparray[1];
|
||||||
|
//var_dump($constvalue);
|
||||||
|
//var_dump($consttype);
|
||||||
|
$res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity);
|
||||||
|
if ($res < 0) {
|
||||||
|
$error++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
|
||||||
|
|
||||||
if (!$res > 0) $error++;
|
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$db->rollback();
|
||||||
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,12 +97,31 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "none"), 'chaine', 0, '', $conf->entity);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
|
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'setfixednotif' && $user->admin)
|
||||||
|
{
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
if (!$error && is_array($_POST))
|
if (!$error && is_array($_POST))
|
||||||
{
|
{
|
||||||
//var_dump($_POST);
|
|
||||||
$reg = array();
|
$reg = array();
|
||||||
foreach ($_POST as $key => $val)
|
foreach ($_POST as $key => $val)
|
||||||
{
|
{
|
||||||
@ -168,9 +210,18 @@ print '</td>';
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="settemplates">';
|
||||||
|
|
||||||
// Notification per contacts
|
// Notification per contacts
|
||||||
$title = $langs->trans("ListOfNotificationsPerUser");
|
$title = $langs->trans("ListOfNotificationsPerUser");
|
||||||
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
|
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
|
||||||
@ -211,7 +262,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$helptext = '';
|
$helptext = '';
|
||||||
form_constantes($constantes, 0, $helptext);
|
form_constantes($constantes, 2, $helptext);
|
||||||
} else {
|
} else {
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -248,14 +299,18 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="opacitymedium">';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
|
||||||
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="setfixednotif">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
|
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -333,6 +388,12 @@ foreach ($listofnotifiedevents as $notifiedevent)
|
|||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="opacitymedium">';
|
||||||
|
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||||
|
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
|
|||||||
@ -200,7 +200,6 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||||||
print '<div class="formelementrow">';
|
print '<div class="formelementrow">';
|
||||||
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" />';
|
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" />';
|
||||||
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
||||||
|
|||||||
@ -78,7 +78,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("Purge"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("Purge"), '', 'title_setup');
|
||||||
|
|
||||||
print $langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1429,7 +1429,7 @@ class Setup extends DolibarrApi
|
|||||||
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
||||||
throw new RestException(500, 'Error Bad or unknown value for constantname');
|
throw new RestException(500, 'Error Bad or unknown value for constantname');
|
||||||
}
|
}
|
||||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) {
|
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) {
|
||||||
throw new RestException(403, 'Forbidden');
|
throw new RestException(403, 'Forbidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -979,7 +979,6 @@ class BOM extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
*/
|
*/
|
||||||
//public function doScheduledJob($param1, $param2, ...)
|
|
||||||
public function doScheduledJob()
|
public function doScheduledJob()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@ -570,7 +570,8 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
$elementtype = Societe::$table_element;
|
$socstatic = new Societe($this->db);
|
||||||
|
$elementtype = $socstatic->table_element;
|
||||||
|
|
||||||
$extrafields->fetch_name_optionals_label($elementtype);
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
@ -707,7 +708,8 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
$elementtype = Contact::$table_element;
|
$contactstatic = new Contact($this->db);
|
||||||
|
$elementtype = $contactstatic->table_element;
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
dol_include_once('/core/class/extrafields.class.php');
|
dol_include_once('/core/class/extrafields.class.php');
|
||||||
@ -809,7 +811,8 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
|
|
||||||
//Standard Extrafield feature
|
//Standard Extrafield feature
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||||
$elementtype = Societe::$table_element;
|
$socstatic = new Societe($this->db);
|
||||||
|
$elementtype = $socstatic->table_element;
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
dol_include_once('/core/class/extrafields.class.php');
|
dol_include_once('/core/class/extrafields.class.php');
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (c) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (c) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -46,6 +47,7 @@ class PropaleStats extends Stats
|
|||||||
public $from;
|
public $from;
|
||||||
public $field;
|
public $field;
|
||||||
public $where;
|
public $where;
|
||||||
|
public $join;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,14 +57,17 @@ class PropaleStats extends Stats
|
|||||||
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
||||||
* @param int $userid Id user for filter (creation user)
|
* @param int $userid Id user for filter (creation user)
|
||||||
* @param string $mode Option ('customer', 'supplier')
|
* @param string $mode Option ('customer', 'supplier')
|
||||||
|
* @param int $typentid Id typent of thirdpary for filter
|
||||||
|
* @param int $categid Id category of thirdpary for filter
|
||||||
*/
|
*/
|
||||||
public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer')
|
public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer', $typentid = 0, $categid = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->socid = ($socid > 0 ? $socid : 0);
|
$this->socid = ($socid > 0 ? $socid : 0);
|
||||||
$this->userid = $userid;
|
$this->userid = $userid;
|
||||||
|
$this->join = '';
|
||||||
|
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
@ -96,6 +101,19 @@ class PropaleStats extends Stats
|
|||||||
$this->where .= " AND p.fk_soc = ".$this->socid;
|
$this->where .= " AND p.fk_soc = ".$this->socid;
|
||||||
}
|
}
|
||||||
if ($this->userid > 0) $this->where .= ' AND fk_user_author = '.$this->userid;
|
if ($this->userid > 0) $this->where .= ' AND fk_user_author = '.$this->userid;
|
||||||
|
|
||||||
|
if ($typentid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc';
|
||||||
|
$this->where .= ' AND s.fk_typent = '.$typentid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($categid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc';
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie';
|
||||||
|
$this->where .= ' AND c.rowid = '.$categid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -113,6 +131,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, COUNT(*) as nb";
|
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, COUNT(*) as nb";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -135,6 +154,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT date_format(".$this->field_date.",'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")";
|
$sql = "SELECT date_format(".$this->field_date.",'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
$sql .= $this->db->order('dm', 'DESC');
|
$sql .= $this->db->order('dm', 'DESC');
|
||||||
@ -156,6 +176,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, SUM(p.".$this->field.")";
|
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, SUM(p.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -178,6 +199,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, AVG(p.".$this->field.")";
|
$sql = "SELECT date_format(".$this->field_date.",'%m') as dm, AVG(p.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -198,6 +220,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT date_format(".$this->field_date.",'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg";
|
$sql = "SELECT date_format(".$this->field_date.",'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY year";
|
$sql .= " GROUP BY year";
|
||||||
$sql .= $this->db->order('year', 'DESC');
|
$sql .= $this->db->order('year', 'DESC');
|
||||||
@ -221,6 +244,7 @@ class PropaleStats extends Stats
|
|||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
|
$sql .= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
|
||||||
$sql .= " AND ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
$sql .= " AND ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -28,7 +29,10 @@
|
|||||||
require '../../../main.inc.php';
|
require '../../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||||
@ -38,6 +42,8 @@ if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
|
|||||||
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
||||||
|
|
||||||
$object_status = GETPOST('object_status');
|
$object_status = GETPOST('object_status');
|
||||||
|
$typent_id = GETPOST('typent_id', 'int');
|
||||||
|
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||||
|
|
||||||
$userid = GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -64,17 +70,26 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formpropal = new FormPropal($db);
|
$formpropal = new FormPropal($db);
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
$langs->loadLangs(array('propal', 'other', 'companies'));
|
$langs->loadLangs(array('propal', 'other', 'companies'));
|
||||||
|
|
||||||
|
if ($mode == 'customer')
|
||||||
|
{
|
||||||
$picto = 'propal';
|
$picto = 'propal';
|
||||||
$title = $langs->trans("ProposalsStatistics");
|
$title = $langs->trans("ProposalsStatistics");
|
||||||
$dir = $conf->propale->dir_temp;
|
$dir = $conf->propale->dir_temp;
|
||||||
|
$cat_type = Categorie::TYPE_CUSTOMER;
|
||||||
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
|
||||||
|
}
|
||||||
if ($mode == 'supplier')
|
if ($mode == 'supplier')
|
||||||
{
|
{
|
||||||
$picto = 'supplier_proposal';
|
$picto = 'supplier_proposal';
|
||||||
$title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
|
$title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
|
||||||
$dir = $conf->supplier_proposal->dir_temp;
|
$dir = $conf->supplier_proposal->dir_temp;
|
||||||
|
$cat_type = Categorie::TYPE_SUPPLIER;
|
||||||
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
@ -85,7 +100,7 @@ print load_fiche_titre($title, '', $picto);
|
|||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
|
|
||||||
|
|
||||||
$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode);
|
$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode, ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
|
||||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')';
|
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')';
|
||||||
|
|
||||||
// Build graphic number of object
|
// Build graphic number of object
|
||||||
@ -250,6 +265,16 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||||
$filter = 's.client IN (1,2,3)';
|
$filter = 's.client IN (1,2,3)';
|
||||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||||
|
print '</td></tr>';
|
||||||
|
// ThirdParty Type
|
||||||
|
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
|
||||||
|
$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
|
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent);
|
||||||
|
if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
// Category
|
||||||
|
print '<tr><td>'.$cat_label.'</td><td>';
|
||||||
|
print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -45,6 +46,7 @@ class CommandeStats extends Stats
|
|||||||
public $from;
|
public $from;
|
||||||
public $field;
|
public $field;
|
||||||
public $where;
|
public $where;
|
||||||
|
public $join;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,8 +56,10 @@ class CommandeStats extends Stats
|
|||||||
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
||||||
* @param string $mode Option ('customer', 'supplier')
|
* @param string $mode Option ('customer', 'supplier')
|
||||||
* @param int $userid Id user for filter (creation user)
|
* @param int $userid Id user for filter (creation user)
|
||||||
|
* @param int $typentid Id typent of thirdpary for filter
|
||||||
|
* @param int $categid Id category of thirdpary for filter
|
||||||
*/
|
*/
|
||||||
public function __construct($db, $socid, $mode, $userid = 0)
|
public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
@ -64,6 +68,7 @@ class CommandeStats extends Stats
|
|||||||
$this->socid = ($socid > 0 ? $socid : 0);
|
$this->socid = ($socid > 0 ? $socid : 0);
|
||||||
$this->userid = $userid;
|
$this->userid = $userid;
|
||||||
$this->cachefilesuffix = $mode;
|
$this->cachefilesuffix = $mode;
|
||||||
|
$this->join = '';
|
||||||
|
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
@ -92,6 +97,19 @@ class CommandeStats extends Stats
|
|||||||
$this->where .= " AND c.fk_soc = ".$this->socid;
|
$this->where .= " AND c.fk_soc = ".$this->socid;
|
||||||
}
|
}
|
||||||
if ($this->userid > 0) $this->where .= ' AND c.fk_user_author = '.$this->userid;
|
if ($this->userid > 0) $this->where .= ' AND c.fk_user_author = '.$this->userid;
|
||||||
|
|
||||||
|
if ($typentid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = c.fk_soc';
|
||||||
|
$this->where .= ' AND s.fk_typent = '.$typentid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($categid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc';
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie';
|
||||||
|
$this->where .= ' AND cat.rowid = '.$categid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,6 +126,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb";
|
$sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -130,6 +149,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")";
|
$sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
$sql .= $this->db->order('dm', 'DESC');
|
$sql .= $this->db->order('dm', 'DESC');
|
||||||
@ -151,6 +171,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")";
|
$sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -173,6 +194,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")";
|
$sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -193,6 +215,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg";
|
$sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY year";
|
$sql .= " GROUP BY year";
|
||||||
$sql .= $this->db->order('year', 'DESC');
|
$sql .= $this->db->order('year', 'DESC');
|
||||||
@ -214,6 +237,7 @@ class CommandeStats extends Stats
|
|||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
|
$sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
|
||||||
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -28,7 +29,10 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
|
||||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||||
@ -39,6 +43,8 @@ if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
|
|||||||
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
||||||
|
|
||||||
$object_status = GETPOST('object_status');
|
$object_status = GETPOST('object_status');
|
||||||
|
$typent_id = GETPOST('typent_id', 'int');
|
||||||
|
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||||
|
|
||||||
$userid = GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -65,6 +71,8 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers'));
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formorder = new FormOrder($db);
|
$formorder = new FormOrder($db);
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
$picto = 'order';
|
$picto = 'order';
|
||||||
$title = $langs->trans("OrdersStatistics");
|
$title = $langs->trans("OrdersStatistics");
|
||||||
@ -83,7 +91,7 @@ print load_fiche_titre($title, '', $picto);
|
|||||||
|
|
||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
|
|
||||||
$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0));
|
$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||||
@ -266,6 +274,26 @@ if ($mode == 'customer') $filter = 's.client IN (1,2,3)';
|
|||||||
if ($mode == 'supplier') $filter = 's.fournisseur = 1';
|
if ($mode == 'supplier') $filter = 's.fournisseur = 1';
|
||||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
// ThirdParty Type
|
||||||
|
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
|
||||||
|
$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
|
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent);
|
||||||
|
if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
// Category
|
||||||
|
if ($mode == 'customer')
|
||||||
|
{
|
||||||
|
$cat_type = Categorie::TYPE_CUSTOMER;
|
||||||
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
|
||||||
|
}
|
||||||
|
if ($mode == 'supplier')
|
||||||
|
{
|
||||||
|
$cat_type = Categorie::TYPE_SUPPLIER;
|
||||||
|
$cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer"));
|
||||||
|
}
|
||||||
|
print '<tr><td>'.$cat_label.'</td><td>';
|
||||||
|
print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||||
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
|
|||||||
@ -556,6 +556,12 @@ foreach ($accounts as $key=>$type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
|
if (is_array($objecttmp->array_options)) {
|
||||||
|
$obj = new stdClass();
|
||||||
|
foreach ($objecttmp->array_options as $k => $v) {
|
||||||
|
$obj->$k = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$parameters = array('arrayfields'=>$arrayfields);
|
||||||
|
|||||||
@ -4633,7 +4633,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
|
|
||||||
$current_situation_counter = array();
|
$current_situation_counter = array();
|
||||||
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
||||||
$totalpaye_prev = $prev_invoice->getSommePaiement();
|
$tmptotalpaidforthisinvoice = $prev_invoice->getSommePaiement();
|
||||||
$total_prev_ht += $prev_invoice->total_ht;
|
$total_prev_ht += $prev_invoice->total_ht;
|
||||||
$total_prev_ttc += $prev_invoice->total_ttc;
|
$total_prev_ttc += $prev_invoice->total_ttc;
|
||||||
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ?-1 : 1) * $prev_invoice->situation_counter;
|
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ?-1 : 1) * $prev_invoice->situation_counter;
|
||||||
@ -4644,7 +4644,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
if (!empty($conf->banque->enabled)) print '<td class="right"></td>';
|
if (!empty($conf->banque->enabled)) print '<td class="right"></td>';
|
||||||
print '<td class="right">'.price($prev_invoice->total_ht).'</td>';
|
print '<td class="right">'.price($prev_invoice->total_ht).'</td>';
|
||||||
print '<td class="right">'.price($prev_invoice->total_ttc).'</td>';
|
print '<td class="right">'.price($prev_invoice->total_ttc).'</td>';
|
||||||
print '<td class="right">'.$prev_invoice->getLibStatut(3, $totalpaye_prev).'</td>';
|
print '<td class="right">'.$prev_invoice->getLibStatut(3, $tmptotalpaidforthisinvoice).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -43,6 +44,7 @@ class FactureStats extends Stats
|
|||||||
public $from;
|
public $from;
|
||||||
public $field;
|
public $field;
|
||||||
public $where;
|
public $where;
|
||||||
|
public $join;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,8 +54,10 @@ class FactureStats extends Stats
|
|||||||
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
|
||||||
* @param string $mode Option ('customer', 'supplier')
|
* @param string $mode Option ('customer', 'supplier')
|
||||||
* @param int $userid Id user for filter (creation user)
|
* @param int $userid Id user for filter (creation user)
|
||||||
|
* @param int $typentid Id typent of thirdpary for filter
|
||||||
|
* @param int $categid Id category of thirdpary for filter
|
||||||
*/
|
*/
|
||||||
public function __construct($db, $socid, $mode, $userid = 0)
|
public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
@ -61,6 +65,7 @@ class FactureStats extends Stats
|
|||||||
$this->socid = ($socid > 0 ? $socid : 0);
|
$this->socid = ($socid > 0 ? $socid : 0);
|
||||||
$this->userid = $userid;
|
$this->userid = $userid;
|
||||||
$this->cachefilesuffix = $mode;
|
$this->cachefilesuffix = $mode;
|
||||||
|
$this->join = '';
|
||||||
|
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
@ -79,6 +84,7 @@ class FactureStats extends Stats
|
|||||||
$this->field_line = 'total_ht';
|
$this->field_line = 'total_ht';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->where = " f.fk_statut >= 0";
|
$this->where = " f.fk_statut >= 0";
|
||||||
$this->where .= " AND f.entity IN (".getEntity('invoice').")";
|
$this->where .= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
@ -90,6 +96,19 @@ class FactureStats extends Stats
|
|||||||
if ($this->userid > 0) $this->where .= ' AND f.fk_user_author = '.$this->userid;
|
if ($this->userid > 0) $this->where .= ' AND f.fk_user_author = '.$this->userid;
|
||||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where .= " AND f.type IN (0,1,2,5)";
|
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where .= " AND f.type IN (0,1,2,5)";
|
||||||
else $this->where .= " AND f.type IN (0,1,2,3,5)";
|
else $this->where .= " AND f.type IN (0,1,2,3,5)";
|
||||||
|
|
||||||
|
if ($typentid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = f.fk_soc';
|
||||||
|
$this->where .= ' AND s.fk_typent = '.$typentid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($categid)
|
||||||
|
{
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc';
|
||||||
|
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie';
|
||||||
|
$this->where .= ' AND c.rowid = '.$categid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +126,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb";
|
$sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -130,6 +150,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")";
|
$sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
$sql .= $this->db->order('dm', 'DESC');
|
$sql .= $this->db->order('dm', 'DESC');
|
||||||
@ -152,6 +173,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")";
|
$sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -175,6 +197,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
|
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql .= " AND ".$this->where;
|
$sql .= " AND ".$this->where;
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -195,6 +218,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
|
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
|
||||||
$sql .= " FROM ".$this->from;
|
$sql .= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " GROUP BY year";
|
$sql .= " GROUP BY year";
|
||||||
$sql .= $this->db->order('year', 'DESC');
|
$sql .= $this->db->order('year', 'DESC');
|
||||||
@ -216,6 +240,7 @@ class FactureStats extends Stats
|
|||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid";
|
$sql .= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid";
|
||||||
$sql .= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
$sql .= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
||||||
|
|||||||
@ -297,7 +297,15 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($massaction == 'withdrawrequest')
|
if ($massaction == 'makepayment'){
|
||||||
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
|
$loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected);
|
||||||
|
|
||||||
|
header('Location: '.$loc);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
elseif ($massaction == 'withdrawrequest')
|
||||||
{
|
{
|
||||||
$langs->load("withdrawals");
|
$langs->load("withdrawals");
|
||||||
|
|
||||||
@ -657,6 +665,7 @@ if ($resql)
|
|||||||
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
|
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this
|
||||||
);
|
);
|
||||||
if ($conf->prelevement->enabled) {
|
if ($conf->prelevement->enabled) {
|
||||||
$langs->load("withdrawals");
|
$langs->load("withdrawals");
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,6 +28,9 @@
|
|||||||
|
|
||||||
require '../../../main.inc.php';
|
require '../../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
||||||
|
|
||||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||||
@ -40,6 +44,8 @@ if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden();
|
|||||||
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
|
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
|
||||||
|
|
||||||
$object_status = GETPOST('object_status');
|
$object_status = GETPOST('object_status');
|
||||||
|
$typent_id = GETPOST('typent_id', 'int');
|
||||||
|
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||||
|
|
||||||
$userid = GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -62,6 +68,8 @@ $endyear = $year;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
@ -81,7 +89,7 @@ print load_fiche_titre($title, '', $picto);
|
|||||||
|
|
||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
|
|
||||||
$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0));
|
$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||||
@ -248,6 +256,26 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)';
|
|||||||
if ($mode == 'supplier') $filter = 's.fournisseur = 1';
|
if ($mode == 'supplier') $filter = 's.fournisseur = 1';
|
||||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
// ThirdParty Type
|
||||||
|
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
|
||||||
|
$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
|
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent);
|
||||||
|
if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
// Category
|
||||||
|
if ($mode == 'customer')
|
||||||
|
{
|
||||||
|
$cat_type = Categorie::TYPE_CUSTOMER;
|
||||||
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
|
||||||
|
}
|
||||||
|
if ($mode == 'supplier')
|
||||||
|
{
|
||||||
|
$cat_type = Categorie::TYPE_SUPPLIER;
|
||||||
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||||
|
}
|
||||||
|
print '<tr><td>'.$cat_label.'</td><td>';
|
||||||
|
print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||||
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
||||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
@ -256,7 +284,7 @@ print '</td></tr>';
|
|||||||
print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
|
print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
$liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled"));
|
$liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '1,2'=>$langs->trans("BillStatusNotPaid").' / '.$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled"));
|
||||||
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
||||||
}
|
}
|
||||||
if ($mode == 'supplier')
|
if ($mode == 'supplier')
|
||||||
|
|||||||
@ -521,7 +521,9 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$fk_unit = $prod->fk_unit;
|
$fk_unit = $prod->fk_unit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1642,13 +1644,13 @@ else
|
|||||||
}
|
}
|
||||||
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print '<a class="reposition" style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'">';
|
print '<a class="reposition marginrightonly editfielda" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=deleteline&rowid='.$objp->rowid.'">';
|
print '<a class="reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=deleteline&rowid='.$objp->rowid.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -360,7 +360,7 @@ if ($result)
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td width="110" class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
|
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
|
||||||
$staticcontrat->id = $obj->cid;
|
$staticcontrat->id = $obj->cid;
|
||||||
print $staticcontrat->getNomUrl(1, 16);
|
print $staticcontrat->getNomUrl(1, 16);
|
||||||
@ -425,7 +425,7 @@ if ($resql)
|
|||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td width="110" class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
||||||
$staticcontrat->id = $obj->fk_contrat;
|
$staticcontrat->id = $obj->fk_contrat;
|
||||||
print $staticcontrat->getNomUrl(1, 16);
|
print $staticcontrat->getNomUrl(1, 16);
|
||||||
@ -506,7 +506,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td width="110" class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
||||||
$staticcontrat->id = $obj->fk_contrat;
|
$staticcontrat->id = $obj->fk_contrat;
|
||||||
print $staticcontrat->getNomUrl(1, 16);
|
print $staticcontrat->getNomUrl(1, 16);
|
||||||
@ -586,7 +586,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td width="110" class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
|
||||||
$staticcontrat->id = $obj->fk_contrat;
|
$staticcontrat->id = $obj->fk_contrat;
|
||||||
print $staticcontrat->getNomUrl(1, 16);
|
print $staticcontrat->getNomUrl(1, 16);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -612,9 +612,11 @@ while ($i < min($num, $limit))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
if (!empty($arrayfields['c.ref']['checked']))
|
if (!empty($arrayfields['c.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
print $contracttmp->getNomUrl(1);
|
print $contracttmp->getNomUrl(1);
|
||||||
if ($obj->nb_late) print img_warning($langs->trans("Late"));
|
if ($obj->nb_late) print img_warning($langs->trans("Late"));
|
||||||
if (!empty($obj->note_private) || !empty($obj->note_public)) {
|
if (!empty($obj->note_private) || !empty($obj->note_public)) {
|
||||||
@ -631,6 +633,7 @@ while ($i < min($num, $limit))
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['c.ref_customer']['checked']))
|
if (!empty($arrayfields['c.ref_customer']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';
|
print '<td>'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';
|
||||||
|
|||||||
@ -247,22 +247,31 @@ if ($search_name) $sql .= " AND s.nom LIKE '%".$db->escape($search_name)."%'
|
|||||||
if ($search_contract) $sql .= " AND c.ref LIKE '%".$db->escape($search_contract)."%' ";
|
if ($search_contract) $sql .= " AND c.ref LIKE '%".$db->escape($search_contract)."%' ";
|
||||||
if ($search_service) $sql .= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
if ($search_service) $sql .= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
||||||
if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
|
if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
|
||||||
$filter_dateouvertureprevue = dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
|
|
||||||
if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '=';
|
|
||||||
|
|
||||||
$filter_date1 = dol_mktime(0, 0, 0, $op1month, $op1day, $op1year);
|
$filter_dateouvertureprevue_start=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
|
||||||
if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '=';
|
$filter_dateouvertureprevue_end=dol_mktime(23, 59, 59, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
|
||||||
|
if ($filter_dateouvertureprevue_start != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = ' BETWEEN ';
|
||||||
|
|
||||||
$filter_date2 = dol_mktime(0, 0, 0, $op2month, $op2day, $op2year);
|
$filter_date1_start =dol_mktime(0, 0, 0, $op1month, $op1day, $op1year);
|
||||||
if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '=';
|
$filter_date1_end =dol_mktime(23, 59, 59, $op1month, $op1day, $op1year);
|
||||||
|
if ($filter_date1_start != '' && $filter_op1 == -1) $filter_op1 = ' BETWEEN ';
|
||||||
|
|
||||||
$filter_datecloture = dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear);
|
$filter_date2_start=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year);
|
||||||
if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '=';
|
$filter_date2_end=dol_mktime(23, 59, 59, $op2month, $op2day, $op2year);
|
||||||
|
if ($filter_date2_start != '' && $filter_op2 == -1) $filter_op2 = ' BETWEEN ';
|
||||||
|
|
||||||
if (!empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql .= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'";
|
$filter_datecloture_start=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear);
|
||||||
if (!empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql .= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'";
|
$filter_datecloture_end=dol_mktime(23, 59, 59, $opcloturemonth, $opclotureday, $opclotureyear);
|
||||||
if (!empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql .= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'";
|
if ($filter_datecloture_start != '' && $filter_opcloture == -1) $filter_opcloture = ' BETWEEN ';
|
||||||
if (!empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql .= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
|
|
||||||
|
if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_opouvertureprevue != ' BETWEEN ' && $filter_dateouvertureprevue_start != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue_start)."'";
|
||||||
|
if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue == ' BETWEEN ') $sql.= " AND '".$db->idate($filter_dateouvertureprevue_end)."'";
|
||||||
|
if (! empty($filter_op1) && $filter_op1 != -1 && $filter_op1 != ' BETWEEN ' && $filter_date1_start != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1_start)."'";
|
||||||
|
if (! empty($filter_op1) && $filter_op1==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date1_end)."'";
|
||||||
|
if (! empty($filter_op2) && $filter_op2 != -1 && $filter_op2 != ' BETWEEN ' && $filter_date2_start != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2_start)."'";
|
||||||
|
if (! empty($filter_op2) && $filter_op2==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date2_end)."'";
|
||||||
|
if (! empty($filter_opcloture) && $filter_opcloture != ' BETWEEN ' && $filter_opcloture != -1 && $filter_datecloture_start != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture_start)."'";
|
||||||
|
if (! empty($filter_opcloture) && $filter_opcloture==' BETWEEN ') $sql.= " AND '".$db->idate($filter_datecloture_end)."'";
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $arrayresult = array();
|
|||||||
|
|
||||||
if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
||||||
@ -75,13 +75,18 @@ if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empt
|
|||||||
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED))
|
||||||
|
{
|
||||||
|
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire)
|
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
|
if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
|
||||||
@ -103,15 +108,15 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
|
|||||||
|
|
||||||
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
|
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
||||||
@ -122,6 +127,10 @@ if (!empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_F
|
|||||||
{
|
{
|
||||||
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
||||||
|
}
|
||||||
|
|
||||||
// HR
|
// HR
|
||||||
if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
|
if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
|
||||||
@ -136,10 +145,6 @@ if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLI
|
|||||||
{
|
{
|
||||||
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read)
|
|
||||||
{
|
|
||||||
$arrayresult['searchintotickets'] = array('position'=>220, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
||||||
|
|||||||
@ -325,7 +325,7 @@ abstract class CommonDocGenerator
|
|||||||
|
|
||||||
foreach ($conf->global as $key => $val)
|
foreach ($conf->global as $key => $val)
|
||||||
{
|
{
|
||||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
|
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
|
||||||
else $newval = $val;
|
else $newval = $val;
|
||||||
$array_other['__['.$key.']__'] = $newval;
|
$array_other['__['.$key.']__'] = $newval;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -386,4 +386,77 @@ class CUnits // extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get unit from code
|
||||||
|
* @param string $code code of unit
|
||||||
|
* @param string $mode 0= id , short_label=Use short label as value, code=use code
|
||||||
|
* @return int <0 if KO, Id of code if OK
|
||||||
|
*/
|
||||||
|
public function getUnitFromCode($code, $mode = 'code')
|
||||||
|
{
|
||||||
|
|
||||||
|
if($mode == 'short_label'){
|
||||||
|
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid');
|
||||||
|
}
|
||||||
|
elseif($mode == 'code'){
|
||||||
|
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit converter
|
||||||
|
* @param double $value value to convert
|
||||||
|
* @param int $fk_unit current unit id of value
|
||||||
|
* @param int $fk_new_unit the id of unit to convert in
|
||||||
|
* @return double
|
||||||
|
*/
|
||||||
|
public function unitConverter($value, $fk_unit, $fk_new_unit = 0)
|
||||||
|
{
|
||||||
|
$value = doubleval(price2num($value));
|
||||||
|
$fk_unit = intval($fk_unit);
|
||||||
|
|
||||||
|
// Calcul en unité de base
|
||||||
|
$scaleUnitPow = $this->scaleOfUnitPow($fk_unit);
|
||||||
|
|
||||||
|
// convert to standard unit
|
||||||
|
$value = $value * $scaleUnitPow;
|
||||||
|
if($fk_new_unit !=0 ){
|
||||||
|
// Calcul en unité de base
|
||||||
|
$scaleUnitPow = $this->scaleOfUnitPow($fk_new_unit);
|
||||||
|
if(!empty($scaleUnitPow))
|
||||||
|
{
|
||||||
|
// convert to new unit
|
||||||
|
$value = $value / $scaleUnitPow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return round($value, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get scale of unit factor
|
||||||
|
* @param $id int id of unit in dictionary
|
||||||
|
* @return float|int
|
||||||
|
*/
|
||||||
|
public function scaleOfUnitPow($id)
|
||||||
|
{
|
||||||
|
$base = 10;
|
||||||
|
// TODO : add base col into unit dictionary table
|
||||||
|
$unit = $this->db->getRow('SELECT scale, unit_type from '.MAIN_DB_PREFIX.'c_units WHERE rowid = '.intval($id));
|
||||||
|
if($unit){
|
||||||
|
// TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
|
||||||
|
if($unit->unit_type == 'time'){
|
||||||
|
return doubleval($unit->scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pow($base, doubleval($unit->scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1298,11 +1298,11 @@ class Form
|
|||||||
// Construct $out and $outarray
|
// Construct $out and $outarray
|
||||||
$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
|
$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
|
||||||
|
|
||||||
$textifempty = '';
|
$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
|
||||||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
||||||
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
||||||
if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
||||||
{
|
{
|
||||||
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||||
|
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||||
else $textifempty .= $langs->trans("All");
|
else $textifempty .= $langs->trans("All");
|
||||||
}
|
}
|
||||||
@ -1554,7 +1554,7 @@ class Form
|
|||||||
|
|
||||||
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
|
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
|
||||||
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>';
|
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>';
|
||||||
if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>'.$langs->trans("Internal").'</option>';
|
if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
|
||||||
|
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -1674,7 +1674,7 @@ class Form
|
|||||||
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list
|
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list
|
||||||
* @param array $exclude Array list of users id to exclude
|
* @param array $exclude Array list of users id to exclude
|
||||||
* @param int $disabled If select list must be disabled
|
* @param int $disabled If select list must be disabled
|
||||||
* @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
|
* @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
|
||||||
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
|
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
|
||||||
* @param string $force_entity '0' or Ids of environment to force
|
* @param string $force_entity '0' or Ids of environment to force
|
||||||
* @param int $maxlength Maximum length of string into list (0=no limit)
|
* @param int $maxlength Maximum length of string into list (0=no limit)
|
||||||
@ -2507,7 +2507,7 @@ class Form
|
|||||||
|
|
||||||
$label = $objp->label;
|
$label = $objp->label;
|
||||||
if (!empty($objp->label_translated)) $label = $objp->label_translated;
|
if (!empty($objp->label_translated)) $label = $objp->label_translated;
|
||||||
if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1);
|
if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
|
||||||
|
|
||||||
$outkey = $objp->rowid;
|
$outkey = $objp->rowid;
|
||||||
$outref = $objp->ref;
|
$outref = $objp->ref;
|
||||||
@ -2579,7 +2579,7 @@ class Form
|
|||||||
if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')';
|
if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')';
|
||||||
|
|
||||||
$objRef = $objp->ref;
|
$objRef = $objp->ref;
|
||||||
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
|
||||||
$outval .= $objRef;
|
$outval .= $objRef;
|
||||||
if ($outbarcode) $outval .= ' ('.$outbarcode.')';
|
if ($outbarcode) $outval .= ' ('.$outbarcode.')';
|
||||||
$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
|
$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
|
||||||
@ -2948,11 +2948,11 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$objRef = $objp->ref;
|
$objRef = $objp->ref;
|
||||||
if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
|
||||||
$objRefFourn = $objp->ref_fourn;
|
$objRefFourn = $objp->ref_fourn;
|
||||||
if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRefFourn, 1);
|
if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
|
||||||
$label = $objp->label;
|
$label = $objp->label;
|
||||||
if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1);
|
if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
|
||||||
|
|
||||||
$optlabel = $objp->ref;
|
$optlabel = $objp->ref;
|
||||||
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
|
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
|
||||||
@ -6634,11 +6634,11 @@ class Form
|
|||||||
// Add code for jquery to use multiselect
|
// Add code for jquery to use multiselect
|
||||||
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||||
{
|
{
|
||||||
$out .= "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
|
||||||
<script>'."\n";
|
|
||||||
if ($addjscombo == 1)
|
if ($addjscombo == 1)
|
||||||
{
|
{
|
||||||
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||||
|
$out .= "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->'."\n";
|
||||||
|
$out .= '<script>'."\n";
|
||||||
$out .= 'function formatResult(record) {'."\n";
|
$out .= 'function formatResult(record) {'."\n";
|
||||||
if ($elemtype == 'category')
|
if ($elemtype == 'category')
|
||||||
{
|
{
|
||||||
@ -6676,6 +6676,8 @@ class Form
|
|||||||
// Add other js lib
|
// Add other js lib
|
||||||
// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
|
// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
|
||||||
// ...
|
// ...
|
||||||
|
$out .= "\n".'<!-- JS CODE TO ENABLE external lib for id '.$htmlname.' -->'."\n";
|
||||||
|
$out .= '<script>'."\n";
|
||||||
$out .= '$(document).ready(function () {
|
$out .= '$(document).ready(function () {
|
||||||
$(\'#'.$htmlname.'\').multiSelect({
|
$(\'#'.$htmlname.'\').multiSelect({
|
||||||
containerHTML: \'<div class="multi-select-container">\',
|
containerHTML: \'<div class="multi-select-container">\',
|
||||||
|
|||||||
@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to manage forms for categories
|
||||||
|
*/
|
||||||
class FormCategory extends Form
|
class FormCategory extends Form
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -32,6 +32,10 @@
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class of forms component to manage companies
|
||||||
|
*/
|
||||||
class FormCompany extends Form
|
class FormCompany extends Form
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -1393,7 +1393,7 @@ class FormFile
|
|||||||
if ($permtoeditline)
|
if ($permtoeditline)
|
||||||
{
|
{
|
||||||
$paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : '');
|
$paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : '');
|
||||||
print '<a class="editfielda" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
print '<a class="editfielda reposition" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($permonobject)
|
if ($permonobject)
|
||||||
|
|||||||
@ -314,6 +314,7 @@ class Notify
|
|||||||
global $user, $conf, $langs, $mysoc;
|
global $user, $conf, $langs, $mysoc;
|
||||||
global $hookmanager;
|
global $hookmanager;
|
||||||
global $dolibarr_main_url_root;
|
global $dolibarr_main_url_root;
|
||||||
|
global $action;
|
||||||
|
|
||||||
if (!in_array($notifcode, $this->arrayofnotifsupported)) return 0;
|
if (!in_array($notifcode, $this->arrayofnotifsupported)) return 0;
|
||||||
|
|
||||||
@ -482,26 +483,31 @@ class Notify
|
|||||||
$mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
|
$mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||||
break;
|
break;
|
||||||
case 'SHIPPING_VALIDATE':
|
case 'SHIPPING_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'expedition';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'EXPENSE_REPORT_VALIDATE':
|
case 'EXPENSE_REPORT_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expensereport->dir_output;
|
$dir_output = $conf->expensereport->dir_output;
|
||||||
$object_type = 'expensereport';
|
$object_type = 'expensereport';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'EXPENSE_REPORT_APPROVE':
|
case 'EXPENSE_REPORT_APPROVE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expensereport->dir_output;
|
$dir_output = $conf->expensereport->dir_output;
|
||||||
$object_type = 'expensereport';
|
$object_type = 'expensereport';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
||||||
break;
|
break;
|
||||||
case 'HOLIDAY_VALIDATE':
|
case 'HOLIDAY_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->holiday->dir_output;
|
$dir_output = $conf->holiday->dir_output;
|
||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'HOLIDAY_APPROVE':
|
case 'HOLIDAY_APPROVE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->holiday->dir_output;
|
$dir_output = $conf->holiday->dir_output;
|
||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
||||||
@ -526,6 +532,8 @@ class Notify
|
|||||||
if ($link) $message .= "\n".$urlwithroot.$link;
|
if ($link) $message .= "\n".$urlwithroot.$link;
|
||||||
|
|
||||||
$parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
|
$parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
|
||||||
|
if (!isset($action)) $action = '';
|
||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('formatNotificationMessage', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('formatNotificationMessage', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
@ -695,26 +703,31 @@ class Notify
|
|||||||
$mesg .= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
$mesg .= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||||
break;
|
break;
|
||||||
case 'SHIPPING_VALIDATE':
|
case 'SHIPPING_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'EXPENSE_REPORT_VALIDATE':
|
case 'EXPENSE_REPORT_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expensereport->dir_output;
|
$dir_output = $conf->expensereport->dir_output;
|
||||||
$object_type = 'expensereport';
|
$object_type = 'expensereport';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'EXPENSE_REPORT_APPROVE':
|
case 'EXPENSE_REPORT_APPROVE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->expensereport->dir_output;
|
$dir_output = $conf->expensereport->dir_output;
|
||||||
$object_type = 'expensereport';
|
$object_type = 'expensereport';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
||||||
break;
|
break;
|
||||||
case 'HOLIDAY_VALIDATE':
|
case 'HOLIDAY_VALIDATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->holiday->dir_output;
|
$dir_output = $conf->holiday->dir_output;
|
||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
||||||
break;
|
break;
|
||||||
case 'HOLIDAY_APPROVE':
|
case 'HOLIDAY_APPROVE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
$dir_output = $conf->holiday->dir_output;
|
$dir_output = $conf->holiday->dir_output;
|
||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
||||||
|
|||||||
@ -297,4 +297,48 @@ abstract class DoliDB implements Database
|
|||||||
{
|
{
|
||||||
return $this->lastqueryerror;
|
return $this->lastqueryerror;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return first result from query as object
|
||||||
|
* Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries
|
||||||
|
* Dont add LIMIT to your query, it will be added by this method
|
||||||
|
* @param string $sql the sql query string
|
||||||
|
* @return bool| object
|
||||||
|
*/
|
||||||
|
public function getRow($sql)
|
||||||
|
{
|
||||||
|
$sql .= ' LIMIT 1;';
|
||||||
|
|
||||||
|
$res = $this->query($sql);
|
||||||
|
if ($res)
|
||||||
|
{
|
||||||
|
return $this->fetch_object($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return all results from query as an array of objects
|
||||||
|
* Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries
|
||||||
|
* be carefull with this method use it only with some limit of results to avoid performences loss
|
||||||
|
* @param string $sql the sql query string
|
||||||
|
* @return bool| array
|
||||||
|
*/
|
||||||
|
public function getRows($sql)
|
||||||
|
{
|
||||||
|
$res = $this->query($sql);
|
||||||
|
if ($res)
|
||||||
|
{
|
||||||
|
$results = array();
|
||||||
|
if($this->num_rows($res) > 0){
|
||||||
|
while ($obj = $this->fetch_object($res)){
|
||||||
|
$results[] = $obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $results;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,8 +236,11 @@ function GetRootPath()
|
|||||||
return substr($sRealPath, 0, $position);
|
return substr($sRealPath, 0, $position);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emulate the asp Server.mapPath function.
|
/**
|
||||||
// given an url path return the physical directory that it corresponds to
|
* Emulate the asp Server.mapPath function.
|
||||||
|
* @param string $path given an url path return the physical directory that it corresponds to
|
||||||
|
* @return string Path
|
||||||
|
*/
|
||||||
function Server_MapPath($path)
|
function Server_MapPath($path)
|
||||||
{
|
{
|
||||||
// This function is available only for Apache
|
// This function is available only for Apache
|
||||||
@ -338,7 +341,12 @@ function GetCurrentFolder()
|
|||||||
return $sCurrentFolder;
|
return $sCurrentFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do a cleanup of the folder name to avoid possible problems
|
/**
|
||||||
|
* Do a cleanup of the folder name to avoid possible problems
|
||||||
|
*
|
||||||
|
* @param string $sNewFolderName Folder
|
||||||
|
* @return string Folder sanitized
|
||||||
|
*/
|
||||||
function SanitizeFolderName($sNewFolderName)
|
function SanitizeFolderName($sNewFolderName)
|
||||||
{
|
{
|
||||||
$sNewFolderName = stripslashes($sNewFolderName);
|
$sNewFolderName = stripslashes($sNewFolderName);
|
||||||
@ -349,7 +357,12 @@ function SanitizeFolderName($sNewFolderName)
|
|||||||
return $sNewFolderName;
|
return $sNewFolderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do a cleanup of the file name to avoid possible problems
|
/**
|
||||||
|
* Do a cleanup of the file name to avoid possible problems
|
||||||
|
*
|
||||||
|
* @param string $sNewFileName Folder
|
||||||
|
* @return string Folder sanitized
|
||||||
|
*/
|
||||||
function SanitizeFileName($sNewFileName)
|
function SanitizeFileName($sNewFileName)
|
||||||
{
|
{
|
||||||
global $Config;
|
global $Config;
|
||||||
@ -366,7 +379,15 @@ function SanitizeFileName($sNewFileName)
|
|||||||
return $sNewFileName;
|
return $sNewFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the function that sends the results of the uploading process.
|
/**
|
||||||
|
* This is the function that sends the results of the uploading process.
|
||||||
|
*
|
||||||
|
* @param string $errorNumber errorNumber
|
||||||
|
* @param string $fileUrl fileUrl
|
||||||
|
* @param string $fileName fileName
|
||||||
|
* @param string $customMsg customMsg
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function SendUploadResults($errorNumber, $fileUrl = '', $fileName = '', $customMsg = '')
|
function SendUploadResults($errorNumber, $fileUrl = '', $fileName = '', $customMsg = '')
|
||||||
{
|
{
|
||||||
// Minified version of the document.domain automatic fix script (#1919).
|
// Minified version of the document.domain automatic fix script (#1919).
|
||||||
|
|||||||
@ -185,7 +185,7 @@ else // If external user
|
|||||||
|
|
||||||
// Load the menu manager (only if not already done)
|
// Load the menu manager (only if not already done)
|
||||||
$file_menu = $conf->standard_menu;
|
$file_menu = $conf->standard_menu;
|
||||||
if (GETPOST('menu')) $file_menu = GETPOST('menu'); // example: menu=eldy_menu.php
|
if (GETPOST('menu', 'aZ09')) $file_menu = GETPOST('menu', 'aZ09'); // example: menu=eldy_menu.php
|
||||||
if (!class_exists('MenuManager'))
|
if (!class_exists('MenuManager'))
|
||||||
{
|
{
|
||||||
$menufound = 0;
|
$menufound = 0;
|
||||||
|
|||||||
@ -37,8 +37,9 @@ if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP
|
|||||||
top_httphead('text/javascript; charset=UTF-8');
|
top_httphead('text/javascript; charset=UTF-8');
|
||||||
|
|
||||||
print 'var login = \''.$_SESSION['dol_login'].'\';'."\n";
|
print 'var login = \''.$_SESSION['dol_login'].'\';'."\n";
|
||||||
|
print 'var nowtime = Date.now();';
|
||||||
print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined
|
print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined
|
||||||
print 'var time_js_next_test = (Date.now() + time_auto_update);'."\n";
|
print 'var time_js_next_test = (nowtime + time_auto_update);'."\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
/* Check if permission ok */
|
/* Check if permission ok */
|
||||||
|
|||||||
@ -1409,7 +1409,7 @@ function complete_elementList_with_modules(&$elementList)
|
|||||||
*
|
*
|
||||||
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
|
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
|
||||||
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
||||||
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all (form is output by caller, recommanded)
|
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all (form is output by caller, recommended)
|
||||||
* @param string $helptext Help
|
* @param string $helptext Help
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -1420,6 +1420,9 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if (empty($strictw3c)) {
|
||||||
|
dol_syslog("Warning: Function form_constantes is calle with parameter strictw3c = 0, this is deprecated. Value must be 2 now.", LOG_DEBUG);
|
||||||
|
}
|
||||||
if (!empty($strictw3c) && $strictw3c == 1)
|
if (!empty($strictw3c) && $strictw3c == 1)
|
||||||
{
|
{
|
||||||
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
@ -1584,12 +1587,13 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
|||||||
//var_dump($modelmail);
|
//var_dump($modelmail);
|
||||||
$moreonlabel = '';
|
$moreonlabel = '';
|
||||||
if (!empty($arrayofmessagename[$modelmail->label])) $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
|
if (!empty($arrayofmessagename[$modelmail->label])) $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
|
||||||
$arrayofmessagename[$modelmail->label] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
|
// The 'label' is the key that is unique if we exclude the language
|
||||||
|
$arrayofmessagename[$modelmail->label.':'.$tmp[1]] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($arraydefaultmessage);
|
//var_dump($arraydefaultmessage);
|
||||||
//var_dump($arrayofmessagename);
|
//var_dump($arrayofmessagename);
|
||||||
print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
}
|
}
|
||||||
else // type = 'string' ou 'chaine'
|
else // type = 'string' ou 'chaine'
|
||||||
{
|
{
|
||||||
|
|||||||
@ -720,10 +720,11 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1)
|
|||||||
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
||||||
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
||||||
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
|
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
|
||||||
|
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
|
||||||
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
|
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
|
||||||
* @see dol_copy()
|
* @see dol_copy()
|
||||||
*/
|
*/
|
||||||
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null)
|
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -759,8 +760,19 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
|
|||||||
{
|
{
|
||||||
if (is_dir($ossrcfile."/".$file))
|
if (is_dir($ossrcfile."/".$file))
|
||||||
{
|
{
|
||||||
|
if (empty($excludesubdir) || ($excludesubdir == 2 && strlen($file) == 2)) {
|
||||||
|
$newfile = $file;
|
||||||
|
// Replace destination filename with a new one
|
||||||
|
if (is_array($arrayreplacement))
|
||||||
|
{
|
||||||
|
foreach ($arrayreplacement as $key => $val)
|
||||||
|
{
|
||||||
|
$newfile = str_replace($key, $val, $newfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
//var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists");
|
//var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists");
|
||||||
$tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement);
|
$tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$newfile, $newmask, $overwriteifexists, $arrayreplacement, $excludesubdir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -960,7 +972,7 @@ function dol_unescapefile($filename)
|
|||||||
*/
|
*/
|
||||||
function dolCheckVirus($src_file)
|
function dolCheckVirus($src_file)
|
||||||
{
|
{
|
||||||
global $conf, $db;
|
global $conf;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
|
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
|
||||||
{
|
{
|
||||||
@ -1853,6 +1865,7 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = ''
|
|||||||
if (empty($fileoutput)) $fileoutput = $fileinput.".".$ext;
|
if (empty($fileoutput)) $fileoutput = $fileinput.".".$ext;
|
||||||
|
|
||||||
$count = $image->getNumberImages();
|
$count = $image->getNumberImages();
|
||||||
|
|
||||||
if (!dol_is_file($fileoutput) || is_writeable($fileoutput))
|
if (!dol_is_file($fileoutput) || is_writeable($fileoutput))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1078,6 +1078,13 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||||||
// If syslog module enabled
|
// If syslog module enabled
|
||||||
if (empty($conf->syslog->enabled)) return;
|
if (empty($conf->syslog->enabled)) return;
|
||||||
|
|
||||||
|
// Check if we are into execution of code of a website
|
||||||
|
if (defined('USEEXTERNALSERVER') && ! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {
|
||||||
|
global $website, $websitekey;
|
||||||
|
if (is_object($website) && ! empty($website->ref)) $suffixinfilename.='_website_'.$website->ref;
|
||||||
|
elseif (! empty($websitekey)) $suffixinfilename.='_website_'.$websitekey;
|
||||||
|
}
|
||||||
|
|
||||||
if ($ident < 0)
|
if ($ident < 0)
|
||||||
{
|
{
|
||||||
foreach ($conf->loghandlers as $loghandlerinstance)
|
foreach ($conf->loghandlers as $loghandlerinstance)
|
||||||
@ -3145,13 +3152,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes',
|
'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes',
|
||||||
'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
|
'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
|
||||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help',
|
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help',
|
||||||
'intervention', 'language', 'list', 'listlight', 'lot',
|
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
|
||||||
'map-marker-alt', 'money-bill-alt', 'mrp', 'note',
|
'map-marker-alt', 'money-bill-alt', 'mrp', 'note',
|
||||||
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
|
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
|
||||||
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
||||||
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
||||||
'object_holiday', 'object_hrm', 'object_intervention', 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
|
||||||
|
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
||||||
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
|
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
|
||||||
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
|
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
|
||||||
'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
|
'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
|
||||||
@ -3188,12 +3196,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
|
'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
|
||||||
'email'=>'at',
|
'email'=>'at',
|
||||||
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
|
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
|
||||||
'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users',
|
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group',
|
||||||
|
'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users',
|
||||||
'sign-out'=>'sign-out-alt',
|
'sign-out'=>'sign-out-alt',
|
||||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||||
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||||
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
||||||
'intervention'=>'ambulance', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
||||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||||
'other'=>'square',
|
'other'=>'square',
|
||||||
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
||||||
@ -3262,10 +3271,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'order'=>'bg-infobox-commande',
|
'order'=>'bg-infobox-commande',
|
||||||
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
|
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
|
||||||
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
|
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
|
||||||
'holiday'=>'bg-infobox-holiday',
|
'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande',
|
||||||
'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
|
'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
|
||||||
'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
|
'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
|
||||||
'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
|
'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
|
||||||
|
//'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action',
|
||||||
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
|
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
|
||||||
);
|
);
|
||||||
if (!empty($arrayconvpictotomorcess[$pictowithouttext])) {
|
if (!empty($arrayconvpictotomorcess[$pictowithouttext])) {
|
||||||
@ -6520,7 +6530,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null)
|
|||||||
if (dol_textishtml($text, 1)) $msgishtml = 1;
|
if (dol_textishtml($text, 1)) $msgishtml = 1;
|
||||||
|
|
||||||
$keyfound = $reg[1];
|
$keyfound = $reg[1];
|
||||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
|
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
|
||||||
else $newval = empty($conf->global->$keyfound) ? '' : $conf->global->$keyfound;
|
else $newval = empty($conf->global->$keyfound) ? '' : $conf->global->$keyfound;
|
||||||
$text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ?dol_htmlentitiesbr($newval) : $newval, $text);
|
$text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ?dol_htmlentitiesbr($newval) : $newval, $text);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -353,6 +353,24 @@ function show_stats_for_company($product, $socid)
|
|||||||
print '<td class="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
print '<td class="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// MO
|
||||||
|
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read)
|
||||||
|
{
|
||||||
|
$nblines++;
|
||||||
|
//$ret = $product->load_stats_mo($socid);
|
||||||
|
if ($ret < 0) dol_print_error($db);
|
||||||
|
$langs->load("orders");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("MO").'</a>';
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $product->stats_mo['suppliers'];
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $product->stats_mo['nb'];
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print $product->stats_mo['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
// Customer proposals
|
// Customer proposals
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
@ -379,7 +397,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'propal').' '.$langs->trans("SupplierProposals").'</a>';
|
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'supplier_proposal').' '.$langs->trans("SupplierProposals").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_proposal_supplier['suppliers'];
|
print $product->stats_proposal_supplier['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -415,7 +433,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'order').' '.$langs->trans("SuppliersOrders").'</a>';
|
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_order').' '.$langs->trans("SuppliersOrders").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_commande_fournisseur['suppliers'];
|
print $product->stats_commande_fournisseur['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -425,24 +443,6 @@ function show_stats_for_company($product, $socid)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
// MO
|
|
||||||
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read)
|
|
||||||
{
|
|
||||||
$nblines++;
|
|
||||||
//$ret = $product->load_stats_mo($socid);
|
|
||||||
if ($ret < 0) dol_print_error($db);
|
|
||||||
$langs->load("orders");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("MO").'</a>';
|
|
||||||
print '</td><td class="right">';
|
|
||||||
print $product->stats_mo['suppliers'];
|
|
||||||
print '</td><td class="right">';
|
|
||||||
print $product->stats_mo['nb'];
|
|
||||||
print '</td><td class="right">';
|
|
||||||
print $product->stats_mo['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Customer invoices
|
// Customer invoices
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
@ -469,7 +469,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'bill').' '.$langs->trans("SuppliersInvoices").'</a>';
|
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_invoice').' '.$langs->trans("SuppliersInvoices").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_facture_fournisseur['suppliers'];
|
print $product->stats_facture_fournisseur['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
|
|||||||
@ -415,7 +415,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
|
|||||||
//var_dump($expedition->linkedObjects);
|
//var_dump($expedition->linkedObjects);
|
||||||
|
|
||||||
$receiving = '';
|
$receiving = '';
|
||||||
if (count($expedition->linkedObjects['delivery']) > 0) $receiving = reset($expedition->linkedObjects['delivery']); // Take first link
|
if (!empty($expedition->linkedObjects['delivery'])) $receiving = reset($expedition->linkedObjects['delivery']); // Take first link
|
||||||
|
|
||||||
if (!empty($receiving))
|
if (!empty($receiving))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,6 +43,14 @@ function takepos_prepare_head()
|
|||||||
$head[$h][2] = 'receipt';
|
$head[$h][2] = 'receipt';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
|
||||||
|
$head[$h][1] = $langs->trans("BarRestaurant");
|
||||||
|
$head[$h][2] = 'bar';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
|
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
|
||||||
for ($i = 1; $i <= $numterminals; $i++)
|
for ($i = 1; $i <= $numterminals; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -359,7 +359,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
|
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">';
|
print '<th class="right">';
|
||||||
$url = 'https://www.dolistore.com/4-skins';
|
$url = 'https://www.dolistore.com/9-skins';
|
||||||
print '<a href="'.$url.'" target="_blank">';
|
print '<a href="'.$url.'" target="_blank">';
|
||||||
print $langs->trans('DownloadMoreSkins');
|
print $langs->trans('DownloadMoreSkins');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
@ -726,6 +726,33 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TextTitleLinkColor
|
||||||
|
if ($foruserprofile)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$default=(empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink)));
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>';
|
||||||
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
|
if ($edit)
|
||||||
|
{
|
||||||
|
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLELINK, array()), ''), 'THEME_ELDY_TEXTTITLELINK', 'formcolor', 1).' ';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default"));
|
||||||
|
}
|
||||||
|
print ' <span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong><span style="color: #'.$default.'">'.$default.'</span></strong> ';
|
||||||
|
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||||
|
print '</span>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// BackgroundTableLineOddColor
|
// BackgroundTableLineOddColor
|
||||||
if ($foruserprofile)
|
if ($foruserprofile)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,7 +39,10 @@ function dolSaveMasterFile($filemaster)
|
|||||||
|
|
||||||
$mastercontent = '<?php'."\n";
|
$mastercontent = '<?php'."\n";
|
||||||
$mastercontent .= '// File generated to link to the master file - DO NOT MODIFY - It is just an include'."\n";
|
$mastercontent .= '// File generated to link to the master file - DO NOT MODIFY - It is just an include'."\n";
|
||||||
$mastercontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) require_once '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
|
$mastercontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
|
||||||
|
$mastercontent .= " if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1);\n";
|
||||||
|
$mastercontent .= " require_once '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
|
||||||
|
$mastercontent .= "}\n";
|
||||||
$mastercontent .= '?>'."\n";
|
$mastercontent .= '?>'."\n";
|
||||||
$result = file_put_contents($filemaster, $mastercontent);
|
$result = file_put_contents($filemaster, $mastercontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
if (!empty($conf->global->MAIN_UMASK))
|
||||||
|
|||||||
@ -2279,7 +2279,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ? ' info-box-module-disabled' : ' ').'">
|
<div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ? ' info-box-module-disabled' : '').($this->isCoreOrExternalModule() == 'external' ? ' info-box-module-external' : '').'">
|
||||||
<div class="info-box info-box-sm info-box-module">
|
<div class="info-box info-box-sm info-box-module">
|
||||||
<div class="info-box-icon">';
|
<div class="info-box-icon">';
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
|
|||||||
$this->numero = 310;
|
$this->numero = 310;
|
||||||
|
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
$this->module_position = '55';
|
$this->module_position = '06';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Management of members of a foundation or association";
|
$this->description = "Management of members of a foundation or association";
|
||||||
|
|||||||
@ -143,6 +143,7 @@ class modBanque extends DolibarrModules
|
|||||||
//--------
|
//--------
|
||||||
$r = 0;
|
$r = 0;
|
||||||
|
|
||||||
|
// Bank lines
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r] = 'Ecritures bancaires et releves';
|
$this->export_label[$r] = 'Ecritures bancaires et releves';
|
||||||
@ -174,6 +175,7 @@ class modBanque extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' AND ba.entity IN ('.getEntity('bank_account').')';
|
$this->export_sql_end[$r] .= ' AND ba.entity IN ('.getEntity('bank_account').')';
|
||||||
$this->export_sql_order[$r] = ' ORDER BY b.datev, b.num_releve';
|
$this->export_sql_order[$r] = ' ORDER BY b.datev, b.num_releve';
|
||||||
|
|
||||||
|
//
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r] = 'Bordereaux remise Chq/Fact';
|
$this->export_label[$r] = 'Bordereaux remise Chq/Fact';
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class modCommande extends DolibarrModules
|
|||||||
$this->numero = 25;
|
$this->numero = 25;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '23';
|
$this->module_position = '11';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des commandes clients";
|
$this->description = "Gestion des commandes clients";
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class modContrat extends DolibarrModules
|
|||||||
$this->numero = 54;
|
$this->numero = 54;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '35';
|
$this->module_position = '41';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des contrats de services";
|
$this->description = "Gestion des contrats de services";
|
||||||
|
|||||||
@ -282,7 +282,8 @@ class modEmailCollector extends DolibarrModules
|
|||||||
$tmpresql = $this->db->query($tmpsql);
|
$tmpresql = $this->db->query($tmpsql);
|
||||||
if ($tmpresql) {
|
if ($tmpresql) {
|
||||||
if ($this->db->num_rows($tmpresql) == 0) {
|
if ($this->db->num_rows($tmpresql) == 0) {
|
||||||
$descriptionA1 = 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.';
|
$descriptionA1 = 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated.';
|
||||||
|
$descriptionA1 .= ' If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.';
|
||||||
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
||||||
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Requets', 'Example to collect ticket requests', '".$this->db->escape($descriptionA1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Requets', 'Example to collect ticket requests', '".$this->db->escape($descriptionA1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
||||||
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
@ -319,7 +320,9 @@ class modEmailCollector extends DolibarrModules
|
|||||||
$tmpresql = $this->db->query($tmpsql);
|
$tmpresql = $this->db->query($tmpsql);
|
||||||
if ($tmpresql) {
|
if ($tmpresql) {
|
||||||
if ($this->db->num_rows($tmpresql) == 0) {
|
if ($this->db->num_rows($tmpresql) == 0) {
|
||||||
$descriptionC1 = "This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1.";
|
$descriptionC1 = "This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated.";
|
||||||
|
$descriptionC1 .= " If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>";
|
||||||
|
$descriptionC1 .= "Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1.";
|
||||||
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
||||||
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Leads', 'Example to collect leads', '".$this->db->escape($descriptionC1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Leads', 'Example to collect leads', '".$this->db->escape($descriptionC1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
||||||
$sqlforexampleC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
$sqlforexampleC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class modFacture extends DolibarrModules
|
|||||||
$this->numero = 30;
|
$this->numero = 30;
|
||||||
|
|
||||||
$this->family = "financial";
|
$this->family = "financial";
|
||||||
$this->module_position = '10';
|
$this->module_position = '11';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des factures";
|
$this->description = "Gestion des factures";
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class modPropale extends DolibarrModules
|
|||||||
$this->numero = 20;
|
$this->numero = 20;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '22';
|
$this->module_position = '10';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des propositions commerciales";
|
$this->description = "Gestion des propositions commerciales";
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class modStock extends DolibarrModules
|
|||||||
$this->numero = 52;
|
$this->numero = 52;
|
||||||
|
|
||||||
$this->family = "products";
|
$this->family = "products";
|
||||||
$this->module_position = '40';
|
$this->module_position = '39';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des stocks";
|
$this->description = "Gestion des stocks";
|
||||||
|
|||||||
@ -61,6 +61,9 @@ abstract class ModelePDFProduct extends CommonDocGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class template for classes of numbering product
|
||||||
|
*/
|
||||||
abstract class ModeleProductCode
|
abstract class ModeleProductCode
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -97,7 +100,6 @@ abstract class ModeleProductCode
|
|||||||
*/
|
*/
|
||||||
public function getExample($langs)
|
public function getExample($langs)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
|
||||||
return $langs->trans("NoExample");
|
return $langs->trans("NoExample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
|||||||
elseif ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0') && (!in_array($typ, array('link')) || $crit != '-1'))
|
elseif ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0') && (!in_array($typ, array('link')) || $crit != '-1'))
|
||||||
{
|
{
|
||||||
$mode_search = 0;
|
$mode_search = 0;
|
||||||
if (in_array($typ, array('int', 'double', 'real'))) $mode_search = 1; // Search on a numeric
|
if (in_array($typ, array('int', 'double', 'real', 'price'))) $mode_search = 1; // Search on a numeric
|
||||||
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1') $mode_search = 2; // Search on a foreign key int
|
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1') $mode_search = 2; // Search on a foreign key int
|
||||||
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
|
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
|
||||||
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
|
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/core/website.inc.php
|
* \file htdocs/core/website.inc.php
|
||||||
* \brief Common file loaded by all website pages (after master.inc.php). It set the new object $weblangs, using parameter 'l'.
|
* \brief Common file loaded by all website pages (after master.inc.php). It set the new object $weblangs, using parameter 'l'.
|
||||||
* This file is included in top of all container pages.
|
* This file is included in top of all container pages and is run only when a web page is called.
|
||||||
* The global variable $websitekey must be defined.
|
* The global variable $websitekey must be defined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -922,7 +922,7 @@ class Don extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
|
|||||||
@ -55,11 +55,17 @@ class PaymentDonation extends CommonObject
|
|||||||
public $fk_donation;
|
public $fk_donation;
|
||||||
|
|
||||||
public $datec = '';
|
public $datec = '';
|
||||||
|
|
||||||
public $tms = '';
|
public $tms = '';
|
||||||
|
|
||||||
public $datep = '';
|
public $datep = '';
|
||||||
|
|
||||||
public $amount; // Total amount of payment
|
public $amount; // Total amount of payment
|
||||||
|
|
||||||
public $amounts = array(); // Array of amounts
|
public $amounts = array(); // Array of amounts
|
||||||
|
|
||||||
public $typepayment;
|
public $typepayment;
|
||||||
|
|
||||||
public $num_payment;
|
public $num_payment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -772,7 +772,6 @@ class EcmFiles extends CommonObject
|
|||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$companylink = '';
|
|
||||||
|
|
||||||
$label = '<u>'.$langs->trans("MyModule").'</u>';
|
$label = '<u>'.$langs->trans("MyModule").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
@ -867,6 +866,9 @@ class EcmFiles extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class of an index line of a document
|
||||||
|
*/
|
||||||
class EcmfilesLine
|
class EcmfilesLine
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1049,7 +1049,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$deplig = new ExpenseReportLine($this->db);
|
$deplig = new ExpenseReportLine($this->db);
|
||||||
|
|
||||||
$deplig->rowid = $objp->rowid;
|
$deplig->rowid = $objp->rowid;
|
||||||
$deplig->id = $objp->id;
|
$deplig->id = $objp->rowid;
|
||||||
$deplig->comments = $objp->comments;
|
$deplig->comments = $objp->comments;
|
||||||
$deplig->qty = $objp->qty;
|
$deplig->qty = $objp->qty;
|
||||||
$deplig->value_unit = $objp->value_unit;
|
$deplig->value_unit = $objp->value_unit;
|
||||||
|
|||||||
@ -207,7 +207,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
'suppliers' => 'Fournisseur',
|
'suppliers' => 'Fournisseur',
|
||||||
'contacts' => 'Contact',
|
'contacts' => 'Contact',
|
||||||
'products' => 'Product',
|
'products' => 'Product',
|
||||||
'services' => 'Service',
|
'services' => 'ProductService',
|
||||||
'proposals' => 'Propal',
|
'proposals' => 'Propal',
|
||||||
'orders' => 'Commande',
|
'orders' => 'Commande',
|
||||||
'invoices' => 'Facture',
|
'invoices' => 'Facture',
|
||||||
|
|||||||
@ -30,6 +30,9 @@
|
|||||||
|
|
||||||
-- Missing in v11
|
-- Missing in v11
|
||||||
|
|
||||||
|
UPDATE llx_c_units set scale = 3600 where code = 'H' and unit_type = 'time';
|
||||||
|
UPDATE llx_c_units set scale = 86400 where code = 'D' and unit_type = 'time';
|
||||||
|
|
||||||
create table llx_commande_fournisseur_dispatch_extrafields
|
create table llx_commande_fournisseur_dispatch_extrafields
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -271,3 +274,5 @@ ALTER TABLE llx_prelevement_facture_demande ADD COLUMN fk_facture_fourn INTEGER
|
|||||||
ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL;
|
ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
|
ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Sabre\VObject\Recur\EventIterator\HandleRDateExpandTest;
|
||||||
|
|
||||||
/* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
/* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
@ -1185,8 +1187,13 @@ function migrate_contracts_date1($db, $langs, $conf)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Mise a jour date contrat avec date min effective mise en service si inferieur
|
* Update contracts with date min real if service date is lower
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param Translate $langs Language
|
||||||
|
* @param Conf $conf Conf
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function migrate_contracts_date2($db, $langs, $conf)
|
function migrate_contracts_date2($db, $langs, $conf)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1803,6 +1803,7 @@ TopMenuDisableImages=Hide images in Top menu
|
|||||||
LeftMenuBackgroundColor=Background color for Left menu
|
LeftMenuBackgroundColor=Background color for Left menu
|
||||||
BackgroundTableTitleColor=Background color for Table title line
|
BackgroundTableTitleColor=Background color for Table title line
|
||||||
BackgroundTableTitleTextColor=Text color for Table title line
|
BackgroundTableTitleTextColor=Text color for Table title line
|
||||||
|
BackgroundTableTitleTextlinkColor=Text color for Table title link line
|
||||||
BackgroundTableLineOddColor=Background color for odd table lines
|
BackgroundTableLineOddColor=Background color for odd table lines
|
||||||
BackgroundTableLineEvenColor=Background color for even table lines
|
BackgroundTableLineEvenColor=Background color for even table lines
|
||||||
MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay)
|
MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay)
|
||||||
@ -1995,3 +1996,5 @@ PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated
|
|||||||
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
|
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
|
||||||
RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard
|
RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard
|
||||||
JumpToBoxes=Jump to Setup -> Widgets
|
JumpToBoxes=Jump to Setup -> Widgets
|
||||||
|
MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time"
|
||||||
|
MeasuringScaleDesc=The scale is the number of places you have to move the decimal part to match the default reference unit. For "time" unit type, it is the number of seconds. Values between 80 and 99 are reserved values.
|
||||||
|
|||||||
@ -106,3 +106,5 @@ MainPrinterToUse=Main printer to use
|
|||||||
OrderPrinterToUse=Order printer to use
|
OrderPrinterToUse=Order printer to use
|
||||||
MainTemplateToUse=Main template to use
|
MainTemplateToUse=Main template to use
|
||||||
OrderTemplateToUse=Order template to use
|
OrderTemplateToUse=Order template to use
|
||||||
|
BarRestaurant=Bar Restaurant
|
||||||
|
AutoOrder=Customer auto order
|
||||||
@ -325,7 +325,8 @@ CompanyDeleted=Company "%s" deleted from database.
|
|||||||
ListOfContacts=List of contacts/addresses
|
ListOfContacts=List of contacts/addresses
|
||||||
ListOfContactsAddresses=List of contacts/addresses
|
ListOfContactsAddresses=List of contacts/addresses
|
||||||
ListOfThirdParties=List of Third Parties
|
ListOfThirdParties=List of Third Parties
|
||||||
ShowContact=Show contact
|
ShowCompany=Third Party
|
||||||
|
ShowContact=Contact-Address
|
||||||
ContactsAllShort=All (No filter)
|
ContactsAllShort=All (No filter)
|
||||||
ContactType=Contact type
|
ContactType=Contact type
|
||||||
ContactForOrders=Order's contact
|
ContactForOrders=Order's contact
|
||||||
|
|||||||
@ -62,5 +62,5 @@ InterLineId=Line id intervention
|
|||||||
InterLineDate=Line date intervention
|
InterLineDate=Line date intervention
|
||||||
InterLineDuration=Line duration intervention
|
InterLineDuration=Line duration intervention
|
||||||
InterLineDesc=Line description intervention
|
InterLineDesc=Line description intervention
|
||||||
RepeatableIntervention=Template of intevention
|
RepeatableIntervention=Template of intervention
|
||||||
ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template
|
ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template
|
||||||
|
|||||||
@ -953,12 +953,13 @@ SearchIntoMembers=Members
|
|||||||
SearchIntoUsers=Users
|
SearchIntoUsers=Users
|
||||||
SearchIntoProductsOrServices=Products or services
|
SearchIntoProductsOrServices=Products or services
|
||||||
SearchIntoProjects=Projects
|
SearchIntoProjects=Projects
|
||||||
|
SearchIntoMO=Manufacturing Orders
|
||||||
SearchIntoTasks=Tasks
|
SearchIntoTasks=Tasks
|
||||||
SearchIntoCustomerInvoices=Customer invoices
|
SearchIntoCustomerInvoices=Customer invoices
|
||||||
SearchIntoSupplierInvoices=Vendor invoices
|
SearchIntoSupplierInvoices=Vendor invoices
|
||||||
SearchIntoCustomerOrders=Sales orders
|
SearchIntoCustomerOrders=Sales orders
|
||||||
SearchIntoSupplierOrders=Purchase orders
|
SearchIntoSupplierOrders=Purchase orders
|
||||||
SearchIntoCustomerProposals=Customer proposals
|
SearchIntoCustomerProposals=Commercial proposals
|
||||||
SearchIntoSupplierProposals=Vendor proposals
|
SearchIntoSupplierProposals=Vendor proposals
|
||||||
SearchIntoInterventions=Interventions
|
SearchIntoInterventions=Interventions
|
||||||
SearchIntoContracts=Contracts
|
SearchIntoContracts=Contracts
|
||||||
|
|||||||
@ -1803,6 +1803,7 @@ TopMenuDisableImages=Cacher les images du menu principal
|
|||||||
LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche
|
LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche
|
||||||
BackgroundTableTitleColor=Couleur de fond pour la ligne de titres des liste/tableaux
|
BackgroundTableTitleColor=Couleur de fond pour la ligne de titres des liste/tableaux
|
||||||
BackgroundTableTitleTextColor=Couleur du texte pour la ligne de titre des tableaux
|
BackgroundTableTitleTextColor=Couleur du texte pour la ligne de titre des tableaux
|
||||||
|
BackgroundTableTitleTextlinkColor=Couleur du texte pour la ligne de titre lien des tableaux
|
||||||
BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables
|
BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables
|
||||||
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales
|
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales
|
||||||
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)
|
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)
|
||||||
|
|||||||
@ -180,8 +180,10 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
|||||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql');
|
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql');
|
||||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql');
|
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql');
|
||||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql');
|
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql');
|
||||||
|
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.key.sql');
|
||||||
dol_delete_file($destdir.'/img/object_myobject.png');
|
dol_delete_file($destdir.'/img/object_myobject.png');
|
||||||
dol_delete_file($destdir.'/class/myobject.class.php');
|
dol_delete_file($destdir.'/class/myobject.class.php');
|
||||||
|
dol_delete_dir($destdir.'/class');
|
||||||
dol_delete_dir($destdir.'/sql');
|
dol_delete_dir($destdir.'/sql');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2122,7 +2124,7 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("LanguageFile").' :</span> ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("LanguageFile").' :</span> ';
|
||||||
if (!is_array($dicts) || empty($dicts)) print '<span class="opacitymedium">'.$langs->trans("NoDictionaries").'</span>';
|
if (!is_array($dicts) || empty($dicts)) print '<span class="opacitymedium">'.$langs->trans("NoDictionaries").'</span>';
|
||||||
@ -2867,7 +2869,7 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -3007,7 +3009,7 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -3099,12 +3101,13 @@ elseif (!empty($module))
|
|||||||
print '<span class="opacitymedium">'.$langs->trans("HooksDefDesc").'</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans("HooksDefDesc").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table><tr><td>';
|
print '<table>';
|
||||||
|
|
||||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||||
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong class="">'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong class="">'.$pathtofile.'</strong>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print '<a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
@ -3113,13 +3116,15 @@ elseif (!empty($module))
|
|||||||
if (dol_is_file($dirins.'/'.$pathtohook))
|
if (dol_is_file($dirins.'/'.$pathtohook))
|
||||||
{
|
{
|
||||||
print '<strong>'.$pathtohook.'</strong>';
|
print '<strong>'.$pathtohook.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
print '</td>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '<td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a> ';
|
||||||
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inithook&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inithook&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -3163,6 +3168,14 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table>';
|
print '<table>';
|
||||||
|
|
||||||
|
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong class="">'.$pathtofile.'</strong>';
|
||||||
|
print '</td><td>';
|
||||||
|
print '<a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
if (!empty($triggers))
|
if (!empty($triggers))
|
||||||
{
|
{
|
||||||
foreach ($triggers as $trigger)
|
foreach ($triggers as $trigger)
|
||||||
@ -3171,7 +3184,7 @@ elseif (!empty($module))
|
|||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("TriggersFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("TriggersFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
print '</td><td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
||||||
print '<td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '<td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -3180,9 +3193,11 @@ elseif (!empty($module))
|
|||||||
{
|
{
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("NoTrigger");
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("NoTrigger");
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inittrigger&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inittrigger&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3227,7 +3242,7 @@ elseif (!empty($module))
|
|||||||
if (dol_is_file($dirins.'/'.$pathtohook))
|
if (dol_is_file($dirins.'/'.$pathtohook))
|
||||||
{
|
{
|
||||||
print '<strong>'.$pathtohook.'</strong>';
|
print '<strong>'.$pathtohook.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
print '</td><td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3279,7 +3294,7 @@ elseif (!empty($module))
|
|||||||
if (dol_is_file($dirins.'/'.$pathtohook))
|
if (dol_is_file($dirins.'/'.$pathtohook))
|
||||||
{
|
{
|
||||||
print '<strong>'.$pathtohook.'</strong>';
|
print '<strong>'.$pathtohook.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
print '</td><td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3335,7 +3350,7 @@ elseif (!empty($module))
|
|||||||
$pathtofile = $widget['relpath'];
|
$pathtofile = $widget['relpath'];
|
||||||
|
|
||||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print '</td><td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -3473,7 +3488,7 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -3602,7 +3617,7 @@ elseif (!empty($module))
|
|||||||
if (preg_match('/\.md$/i', $spec['name'])) $format = 'markdown';
|
if (preg_match('/\.md$/i', $spec['name'])) $format = 'markdown';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
print '</td><td><a class="editfielda paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
|
||||||
print '<td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '<td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -3657,7 +3672,7 @@ elseif (!empty($module))
|
|||||||
|
|
||||||
// HTML
|
// HTML
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
||||||
if (!dol_is_file($outputfiledoc)) print '<strong>'.$langs->trans("FileNotYetGenerated").'</strong>';
|
if (!dol_is_file($outputfiledoc)) print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
else {
|
else {
|
||||||
print '<strong>';
|
print '<strong>';
|
||||||
print '<a href="'.$outputfiledocurl.'" target="_blank">';
|
print '<a href="'.$outputfiledocurl.'" target="_blank">';
|
||||||
@ -3670,7 +3685,7 @@ elseif (!empty($module))
|
|||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "PDF").' : ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "PDF").' : ';
|
||||||
if (!dol_is_file($outputfiledocpdf)) print '<strong>'.$langs->trans("FileNotYetGenerated").'</strong>';
|
if (!dol_is_file($outputfiledocpdf)) print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
else {
|
else {
|
||||||
print '<strong>';
|
print '<strong>';
|
||||||
print '<a href="'.$outputfiledocurlpdf.'" target="_blank">';
|
print '<a href="'.$outputfiledocurlpdf.'" target="_blank">';
|
||||||
@ -3744,7 +3759,7 @@ elseif (!empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModulePackage").' : ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModulePackage").' : ';
|
||||||
if (!dol_is_file($outputfilezip)) print '<strong>'.$langs->trans("FileNotYetGenerated").'</strong>';
|
if (!dol_is_file($outputfilezip)) print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
else {
|
else {
|
||||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||||
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||||
|
|||||||
@ -9,8 +9,6 @@ charset = utf-8
|
|||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
# PHP PSR-2 Coding Standards
|
|
||||||
# http://www.php-fig.org/psr/psr-2/
|
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|||||||
@ -1047,10 +1047,10 @@ class MyObject extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Action executed by scheduler
|
* Action executed by scheduler
|
||||||
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
|
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
|
||||||
|
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
|
||||||
*
|
*
|
||||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
*/
|
*/
|
||||||
//public function doScheduledJob($param1, $param2, ...)
|
|
||||||
public function doScheduledJob()
|
public function doScheduledJob()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@ -152,7 +152,7 @@ if ($object->id > 0)
|
|||||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
@ -178,9 +178,7 @@ if ($object->id > 0)
|
|||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
$morehtmlref.=$proj->ref;
|
|
||||||
$morehtmlref.='</a>';
|
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -331,9 +331,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
/*
|
/*
|
||||||
// Ref bis
|
// Ref customer
|
||||||
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->myobject->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->myobject->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
@ -344,13 +344,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='</form>';
|
||||||
} else {
|
} else {
|
||||||
@ -360,13 +361,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.=$proj->getNomUrl();
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
*/
|
|
||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
if ($permissiontodelete)
|
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,6 +129,46 @@ if ($object->id)
|
|||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
$linkback = '<a href="'.dol_buildpath('/mymodule/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.dol_buildpath('/mymodule/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
/*
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref.=' : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref.='</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|||||||
@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea
|
|||||||
if (!$sortorder) $sortorder = "ASC";
|
if (!$sortorder) $sortorder = "ASC";
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
|
||||||
$search = array();
|
$search = array();
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
@ -133,9 +133,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
$morehtmlref.=$proj->ref;
|
|
||||||
$morehtmlref.='</a>';
|
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1008,7 +1008,7 @@ class Mo extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
|
||||||
if ($option = 'production') $url = dol_buildpath('/mrp/mo_production.php', 1).'?id='.$this->id;
|
if ($option == 'production') $url = dol_buildpath('/mrp/mo_production.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
if ($option != 'nolink')
|
if ($option != 'nolink')
|
||||||
{
|
{
|
||||||
@ -1226,10 +1226,10 @@ class Mo extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Action executed by scheduler
|
* Action executed by scheduler
|
||||||
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
|
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
|
||||||
|
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
|
||||||
*
|
*
|
||||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
*/
|
*/
|
||||||
//public function doScheduledJob($param1, $param2, ...)
|
|
||||||
public function doScheduledJob()
|
public function doScheduledJob()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@ -169,7 +169,7 @@ if ($object->id > 0)
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= $proj->getNomUrl();
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -427,7 +427,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/
|
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
$morehtmlref .= $langs->trans('ThirdParty').' ';
|
||||||
|
$morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
if (!empty($conf->projet->enabled))
|
if (!empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
@ -452,7 +453,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= $proj->getNomUrl();
|
$morehtmlref .= ' : '.$proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
@ -639,7 +640,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
if ($permissiontodelete)
|
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,7 +147,7 @@ if ($object->id)
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= $proj->getNomUrl();
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ if ($user->socid > 0) // Protection if external user
|
|||||||
|
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
|
||||||
$search = array();
|
$search = array();
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,7 +122,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= $proj->getNomUrl();
|
$morehtmlref .= ' : '.$proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref .= '';
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -716,18 +716,18 @@ class Products extends DolibarrApi
|
|||||||
if (!DolibarrApiAccess::$user->rights->produit->supprimer) {
|
if (!DolibarrApiAccess::$user->rights->produit->supprimer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$result = $this->product->fetch($id);
|
$result = $this->productsupplier->fetch($id);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Product not found');
|
throw new RestException(404, 'Product not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) {
|
if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resultsupplier = 0;
|
$resultsupplier = 0;
|
||||||
if ($result) {
|
if ($result > 0) {
|
||||||
$this->productsupplier->fetch($id);
|
$resultsupplier = $this->productsupplier->remove_product_fournisseur_price($priceid);
|
||||||
$resultsupplier = $this->product->remove_product_fournisseur_price($priceid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $resultsupplier;
|
return $resultsupplier;
|
||||||
|
|||||||
@ -254,8 +254,10 @@ class FormProduct
|
|||||||
$out .= $comboenhancement;
|
$out .= $comboenhancement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strpos($htmlname, 'search_') !== 0) {
|
||||||
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||||
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse;
|
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse;
|
||||||
|
}
|
||||||
|
|
||||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled' : '').' id="'.$htmlname.'" name="'.($htmlname.($disabled ? '_disabled' : '')).'">';
|
$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled' : '').' id="'.$htmlname.'" name="'.($htmlname.($disabled ? '_disabled' : '')).'">';
|
||||||
if ($empty) $out .= '<option value="-1">'.($empty_label ? $empty_label : ' ').'</option>';
|
if ($empty) $out .= '<option value="-1">'.($empty_label ? $empty_label : ' ').'</option>';
|
||||||
|
|||||||
@ -1443,7 +1443,7 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Sets an accountancy code for a product.
|
* Sets an accountancy code for a product.
|
||||||
* Also calls PRODUCT_MODIFY trigger when modified
|
* Also calls PRODUCT_MODIFY trigger when modified
|
||||||
*
|
*
|
||||||
@ -5639,9 +5639,10 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage products or services
|
* Class to manage products or services.
|
||||||
|
* Do not use 'Service' as class name since it is already used by APIs.
|
||||||
*/
|
*/
|
||||||
class Service extends Product
|
class ProductService extends Product
|
||||||
{
|
{
|
||||||
public $picto = 'service';
|
public $picto = 'service';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
foreach ($listofsearchfields as $key => $value)
|
foreach ($listofsearchfields as $key => $value)
|
||||||
{
|
{
|
||||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -201,7 +201,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
|
||||||
print '<tr '.$bc[0].'><td class="center" colspan="2">';
|
print '<tr class="oddeven"><td class="center" colspan="2">';
|
||||||
$sql = "SELECT c.label, count(*) as nb";
|
$sql = "SELECT c.label, count(*) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
|
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
|
||||||
@ -413,7 +413,7 @@ llxFooter();
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Print html activity for product type
|
* Print html activity for product type
|
||||||
*
|
*
|
||||||
* @param int $product_type Type of product
|
* @param int $product_type Type of product
|
||||||
@ -422,7 +422,6 @@ $db->close();
|
|||||||
function activitytrim($product_type)
|
function activitytrim($product_type)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $db;
|
global $conf, $langs, $db;
|
||||||
global $bc;
|
|
||||||
|
|
||||||
// We display the last 3 years
|
// We display the last 3 years
|
||||||
$yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));
|
$yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user